CVE-2017-12605: Out-of-bounds Write in OpenCV

opencv-python Updated 02 Oct 2025

Summary

12/10/2021
Yes i
High
8.8

CVE-2017-12605: Out-of-bounds Write in OpenCV. Affects opencv-python versions < 3.3.1.11. Fixed in 3.3.1.11. How to fix ↓

Also tracked for

The same CVE-2017-12605 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

OpenCV (Open Source Computer Vision Library) is a popular open-source library for computer vision and image processing tasks. It provides a wide range of functions and algorithms for image and video analysis. OpenCV-Python and OpenCV-Contrib-Python are Python bindings for OpenCV. This vulnerability affects OpenCV versions up to 3.3.0.9 and OpenCV-Python and OpenCV-Contrib-Python versions up to 3.3.0.9. The vulnerability resides in the FillColorRow8 function in utils.cpp, which is used when reading an image file with cv::imread. This function has an out-of-bounds write error, which can lead to arbitrary code execution or a crash of the application.

Vulnerability Detail

The out-of-bounds write vulnerability in OpenCV allows an attacker to overwrite memory outside the bounds of an allocated buffer. By exploiting this vulnerability, an attacker can execute arbitrary code or cause a denial-of-service condition. The vulnerability occurs when reading an image file using the cv::imread function, specifically in the FillColorRow8 function in utils.cpp. An attacker can craft a malicious image file that triggers the out-of-bounds write, potentially leading to the compromise of the application or system. The severity of this vulnerability is rated as HIGH with a CVSS score of 8.8.

How To Fix

Minimum fixed version

3.3.1.11

This is the first release that contains the fix.

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

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

Workaround

There is no known workaround for this vulnerability. It is recommended to update to the latest patched version of OpenCV or OpenCV-Python to mitigate the risk.

Conclusion

The out-of-bounds write vulnerability in OpenCV can lead to arbitrary code execution or a denial-of-service condition. It is crucial to update to the latest patched version of OpenCV or OpenCV-Python to mitigate the risk. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for opencv-python →

Share this vulnerability

FAQ

OpenCV is an open-source computer vision library that provides functions and algorithms for image and video analysis.

This vulnerability allows an attacker to execute arbitrary code or cause a denial-of-service condition by exploiting an out-of-bounds write error in OpenCV.

To fix this vulnerability, update to the latest patched version of OpenCV or OpenCV-Python.

There is no known workaround for this vulnerability. It is recommended to update to the latest patched version.

This vulnerability is rated as HIGH with a CVSS score of 8.8.

Related vulnerabilities

Recent vulnerabilities recorded for opencv-python.

How To Fix

Minimum fixed version

3.3.1.11

This is the first release that contains the fix.

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

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