CVE-2017-18009: Opencv python Out-of-bounds Read Vulnerability
HIGHCVE-2017-18009 is a HIGH (CVSS 7.5) out-of-bounds read vulnerability (CWE-125: Out-of-bounds Read) affecting Opencv python libraries in the PyPI ecosystem. The issue involves out-of-bounds read in opencv. Remediation is available by upgrading affected packages to version 3.4.1.15.
CVE-2017-18009 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2017-18009
To remediate this vulnerability, upgrade all affected Opencv python dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install opencv-python>=3.4.1.15
pip install opencv-contrib-python>=3.4.1.15
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show opencv-python
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2017-18009, inspect your installed packages using pip:
pip show opencv-python
Analyze the terminal output to locate any version of Opencv python in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.4.1.15), your application is affected.
Note: The pip show opencv-python command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Opencv python, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2017-18009 Affected Opencv python Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
opencv-python
|
PyPI |
< 3.4.1.15
|
3.4.1.15
|
|
opencv-contrib-python
|
PyPI |
< 3.4.1.15
|
3.4.1.15
|
References
Frequently Asked Questions
What is CVE-2017-18009?
Which Opencv python versions are affected?
What version fixes CVE-2017-18009?
Is opencv-python affected?
Is opencv-contrib-python affected?
What is the CVSS score of CVE-2017-18009?
What CWE is associated with CVE-2017-18009?
How can I check PyPI dependencies for CVE-2017-18009?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-83rh-hx5x-q9p5",
"modified" : "2021-10-07T20:17:07Z",
"published" : "2021-10-12T22:03:23Z",
"aliases" : [ "CVE-2017-18009" ],
"summary" : "Out-of-bounds Read in OpenCV",
"details" : "In OpenCV 3.3.1 (corresponding with OpenCV-Python 3.3.1.11), a heap-based buffer over-read exists in the function cv::HdrDecoder::checkSignature in modules/imgcodecs/src/grfmt_hdr.cpp.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-python"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.1.15"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.3.1.11"
}
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-contrib-python"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.4.1.15"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.3.1.11"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-18009"
}, {
"type" : "WEB",
"url" : "https://github.com/opencv/opencv/issues/10479"
}, {
"type" : "WEB",
"url" : "https://github.com/opencv/opencv/pull/10480/commits/4ca89db22dea962690f31c1781bce5937ee91837"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/opencv/opencv-python"
}, {
"type" : "WEB",
"url" : "http://www.securityfocus.com/bid/106945"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-10-07T20:17:07Z",
"nvd_published_at" : null
}
}