CVE-2017-12863: Opencv python Integer Overflow Or Wraparound Vulnerability
HIGHCVE-2017-12863 is a HIGH (CVSS 8.8) integer overflow or wraparound vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Opencv python libraries in the PyPI ecosystem. The issue involves integer overflow or wraparound in opencv. Remediation is available by upgrading affected packages to version 3.3.1.11.
CVE-2017-12863 at a Glance
Security Impact
CVSS: 8.8
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:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2017-12863
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.3.1.11
pip install opencv-contrib-python>=3.3.1.11
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-12863, 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.3.1.11), 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-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. 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-12863 Affected Opencv python Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
opencv-python
|
PyPI |
< 3.3.1.11
|
3.3.1.11
|
|
opencv-contrib-python
|
PyPI |
< 3.3.1.11
|
3.3.1.11
|
References
Frequently Asked Questions
What is CVE-2017-12863?
Which Opencv python versions are affected?
What version fixes CVE-2017-12863?
Is opencv-python affected?
Is opencv-contrib-python affected?
What is the CVSS score of CVE-2017-12863?
What CWE is associated with CVE-2017-12863?
How can I check PyPI dependencies for CVE-2017-12863?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wq8f-wvqp-xvvm",
"modified" : "2021-11-18T15:34:09Z",
"published" : "2021-10-12T22:02:35Z",
"aliases" : [ "CVE-2017-12863" ],
"summary" : "Integer Overflow or Wraparound in OpenCV",
"details" : "In opencv/modules/imgcodecs/src/grfmt_pxm.cpp, function PxMDecoder::readData has an integer overflow when calculate src_pitch. If the image is from remote, may lead to remote code execution or denial of service. This affects OpenCV 3.3 (corresponding to OpenCV-Python 3.3.0.9) and earlier.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-python"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.3.1.11"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.3.0.9"
}
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-contrib-python"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.3.1.11"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.3.0.9"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-12863"
}, {
"type" : "WEB",
"url" : "https://github.com/opencv/opencv/issues/9371"
}, {
"type" : "WEB",
"url" : "https://github.com/opencv/opencv/pull/9376"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/opencv/opencv-python"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2018/07/msg00030.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2021/10/msg00028.html"
}, {
"type" : "WEB",
"url" : "https://security.gentoo.org/glsa/201712-02"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-10-07T20:39:41Z",
"nvd_published_at" : "2017-08-15T16:29:00Z"
}
}