CVE-2019-9423: Opencv python Out-of-bounds Write Vulnerability

HIGH
Advisory Identifier: GHSA-8849-5h85-98qw
CVSS 7.8
CWE-787
Published
Advisory Summary

CVE-2019-9423 is a HIGH (CVSS 7.8) out-of-bounds write vulnerability (CWE-787: Out-of-bounds Write) affecting Opencv python libraries in the PyPI ecosystem. The issue involves out-of-bounds write in opencv. Remediation is available in the latest vendor maintenance releases.

CVE-2019-9423 at a Glance

CVE Identifier CVE-2019-9423
GHSA Identifier GHSA-8849-5h85-98qw
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Opencv python
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2019-9423

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.

opencv-python fixed: Latest secure release
pip install opencv-python>=Latest secure release
opencv-python-headless fixed: Latest secure release
pip install opencv-python-headless>=Latest secure release
opencv-contrib-python fixed: Latest secure release
pip install opencv-contrib-python>=Latest secure release
opencv-contrib-python-headless fixed: Latest secure release
pip install opencv-contrib-python-headless>=Latest secure release
Verify Direct and Transitive Dependencies

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-9423, 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 the patched release), 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-787: Out-of-bounds Write, where the product writes 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

In opencv calls that use libpng, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege with no additional execution privileges required. User interaction is not required for exploitation. Product: AndroidVersions: Android-10Android ID: A-110986616

CVE-2019-9423 Affected Opencv python Versions

4 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
opencv-python
PyPI
≤ 4.1.1.26
opencv-python-headless
PyPI
≤ 4.1.1.26
opencv-contrib-python
PyPI
≤ 4.1.1.26
opencv-contrib-python-headless
PyPI
≤ 4.1.1.26

References

Frequently Asked Questions

What is CVE-2019-9423?
CVE-2019-9423 is a security vulnerability in Opencv python involving Out-of-bounds Write in OpenCV under CWE-787: Out-of-bounds Write.
Which Opencv python versions are affected?
Affected versions include releases prior to current release patches across affected packages: opencv-python, opencv-python-headless, opencv-contrib-python, opencv-contrib-python-headless.
What version fixes CVE-2019-9423?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is opencv-python affected?
Yes, opencv-python is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is opencv-python-headless affected?
Yes, opencv-python-headless is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2019-9423?
CVE-2019-9423 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2019-9423?
CVE-2019-9423 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2019-9423?
Run the dependency tree command: 'pip show opencv-python'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8849-5h85-98qw",
  "modified" : "2021-10-06T19:53:25Z",
  "published" : "2021-10-12T22:22:17Z",
  "aliases" : [ "CVE-2019-9423" ],
  "summary" : "Out-of-bounds Write in OpenCV",
  "details" : "In opencv calls that use libpng, there is a possible out of bounds write due to a missing bounds check. This could lead to local escalation of privilege with no additional execution privileges required. User interaction is not required for exploitation. Product: AndroidVersions: Android-10Android ID: A-110986616",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-python"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.1.1.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-python-headless"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.1.1.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-contrib-python"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.1.1.26"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-contrib-python-headless"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.1.1.26"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-9423"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/opencv/opencv-python"
  }, {
    "type" : "WEB",
    "url" : "https://source.android.com/security/bulletin/android-10"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2019/10/25/17"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2019/10/27/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2019/11/07/1"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2020/12/05/1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-06T19:53:25Z",
    "nvd_published_at" : "2019-09-27T19:15:00Z"
  }
}