CVE-2019-15939: Opencv python Divide By Zero Vulnerability
MODERATECVE-2019-15939 is a MODERATE (CVSS 5.9) divide by zero vulnerability (CWE-369: Divide By Zero) affecting Opencv python libraries in the PyPI ecosystem. The issue involves divide by zero in opencv.. Remediation is available by upgrading affected packages to version 4.1.1.26.
CVE-2019-15939 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2019-15939
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>=4.1.1.26
pip install opencv-python-headless>=4.1.1.26
pip install opencv-contrib-python>=4.1.1.26
pip install opencv-contrib-python-headless>=4.1.1.26
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-2019-15939, 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 4.1.1.26), 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-369: Divide By Zero, where the product divides a value by zero. 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-2019-15939 Affected Opencv python Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
opencv-python
|
PyPI |
< 4.1.1.26
|
4.1.1.26
|
|
opencv-python-headless
|
PyPI |
< 4.1.1.26
|
4.1.1.26
|
|
opencv-contrib-python
|
PyPI |
< 4.1.1.26
|
4.1.1.26
|
|
opencv-contrib-python-headless
|
PyPI |
< 4.1.1.26
|
4.1.1.26
|
References
Frequently Asked Questions
What is CVE-2019-15939?
Which Opencv python versions are affected?
What version fixes CVE-2019-15939?
Is opencv-python affected?
Is opencv-python-headless affected?
What is the CVSS score of CVE-2019-15939?
What CWE is associated with CVE-2019-15939?
How can I check PyPI dependencies for CVE-2019-15939?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hxfw-jm98-v4mq",
"modified" : "2021-11-18T15:27:49Z",
"published" : "2021-10-12T22:21:56Z",
"aliases" : [ "CVE-2019-15939" ],
"summary" : "Divide By Zero in OpenCV.",
"details" : "An issue was discovered in OpenCV 4.1.0 (OpenCV-Python 4.1.0.25). There is a divide-by-zero error in cv::HOGDescriptor::getDescriptorSize in modules/objdetect/src/hog.cpp.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/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" : "4.1.1.26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.1.0.25"
}
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-python-headless"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.1.26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.1.0.25"
}
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-contrib-python"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.1.26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.1.0.25"
}
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "opencv-contrib-python-headless"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.1.26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.1.0.25"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-15939"
}, {
"type" : "WEB",
"url" : "https://github.com/OpenCV/opencv/issues/15287"
}, {
"type" : "WEB",
"url" : "https://github.com/opencv/opencv/pull/15382"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/opencv/opencv-python"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2021/10/msg00028.html"
}, {
"type" : "WEB",
"url" : "http://lists.opensuse.org/opensuse-security-announce/2019-12/msg00025.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-369" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-10-06T20:35:29Z",
"nvd_published_at" : "2019-09-05T16:15:00Z"
}
}