CVE-2019-19624: Out-of-bounds Read in OpenCV

opencv-python Updated 02 Oct 2025

Summary

12/10/2021
Yes i
Moderate
6.5

CVE-2019-19624: Out-of-bounds Read in OpenCV. Affects opencv-python versions < 4.1.0.25. Fixed in 4.1.0.25. How to fix ↓

Also tracked for

The same CVE-2019-19624 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

OpenCV is an open-source computer vision library that provides various functions and algorithms for image and video processing. It is widely used in applications such as robotics, augmented reality, and surveillance systems. OpenCV-Python is a Python wrapper for OpenCV, allowing developers to use OpenCV functionalities in Python applications. However, a vulnerability has been discovered in OpenCV-Python versions before 4.1.1 (OpenCV-Python before 4.1.0.25).

Vulnerability Detail

The vulnerability, identified as CVE-2019-19624, is an out-of-bounds read issue. Specifically, within the calc()/ocl_calc() functions in dis_flow.cpp, the variable 'coarsest_scale' is assumed to be greater than or equal to 'finest_scale'. However, this assumption is not true when dealing with small images, leading to an out-of-bounds read of the heap-allocated arrays Ux and Uy. This vulnerability can be exploited by an attacker to read sensitive information from the heap, potentially resulting in information disclosure or a denial of service.

How To Fix

Latest published version: 5.0.0.93 as of 23 Oct 2026

pip install --upgrade "opencv-python==5.0.0.93"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.1.0.25

This is the first release that contains the fix.

pip install --upgrade "opencv-python==4.1.0.25"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating OpenCV-Python is not immediately feasible, a possible workaround is to avoid processing small images with the affected functions. By ensuring that the images being processed are of sufficient size, the out-of-bounds read issue can be mitigated. Here is an example of how to check and resize an image using the Python Pillow library:

from PIL import Image

def process_image(image_path):
    image = Image.open(image_path)
    width, height = image.size
    if width < 100 or height < 100:
        resized_image = image.resize((100, 100))
        # Process the resized image
    else:
        # Process the original image

process_image('path/to/image.jpg')

Conclusion

In conclusion, the CVE-2019-19624 vulnerability in OpenCV-Python versions before 4.1.1 can lead to an out-of-bounds read issue, potentially resulting in information disclosure or a denial of service. It is crucial to update to the latest version of OpenCV-Python or apply the provided workaround to mitigate the risk. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for opencv-python →

Share this vulnerability

FAQ

OpenCV is an open-source computer vision library that provides various functions and algorithms for image and video processing. It is widely used in applications such as robotics, augmented reality, and surveillance systems.

OpenCV-Python is a Python wrapper for OpenCV, allowing developers to use OpenCV functionalities in Python applications.

An out-of-bounds read vulnerability occurs when a program accesses memory outside the bounds of a defined buffer. This can lead to the exposure of sensitive information or a denial of service.

To fix the vulnerability, update OpenCV-Python to version 4.1.1 or later. Alternatively, avoid processing small images with the affected functions.

Yes, a possible workaround is to ensure that the images being processed are of sufficient size, thereby avoiding the out-of-bounds read issue.

Related vulnerabilities

Recent vulnerabilities recorded for opencv-python.

How To Fix

Latest published version: 5.0.0.93 as of 23 Oct 2026

pip install --upgrade "opencv-python==5.0.0.93"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.1.0.25

This is the first release that contains the fix.

pip install --upgrade "opencv-python==4.1.0.25"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback