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

opencv-python Updated 02 Oct 2025

Summary

12/10/2021
Yes i
High
8.8

CVE-2017-12597: 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-12597 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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

OpenCV (Open Source Computer Vision Library) is a popular open-source library used for computer vision and image processing tasks. It provides a wide range of functions and algorithms for image and video analysis. OpenCV versions up to 3.3 (including opencv-python and opencv-contrib-python up to version 3.3.0.9) are affected by a vulnerability that allows an out-of-bounds write error in the FillColorRow1 function in utils.cpp when reading an image file using cv::imread.

Vulnerability Detail

The vulnerability in OpenCV can be exploited by an attacker to write data beyond the boundaries of an allocated buffer. This can lead to various consequences, including remote code execution, denial of service, or information disclosure. The issue originates from a flaw in the FillColorRow1 function in utils.cpp, which fails to properly validate input data. By providing a specially crafted image file, an attacker can trigger the out-of-bounds write and potentially execute arbitrary code or crash the application.

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

As a temporary workaround, users can avoid using the cv::imread function with untrusted or unknown image files. Instead, they can implement additional input validation and sanitization checks before processing image files. This can help mitigate the risk of exploitation until the packages are updated.

Conclusion

The out-of-bounds write vulnerability in OpenCV can have severe consequences, including remote code execution and denial of service. It is crucial to update the affected packages to the latest versions as soon as possible. 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 used for image and video analysis tasks.

OpenCV versions up to 3.3 (including opencv-python and opencv-contrib-python up to version 3.3.0.9) are affected.

The vulnerability can potentially allow an attacker to execute arbitrary code, cause a denial of service, or disclose sensitive information.

To fix the vulnerability, update the opencv-python and opencv-contrib-python packages to version 3.3.1.11 or higher.

As a temporary workaround, avoid using the cv::imread function with untrusted or unknown image files.

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