CVE-2019-14491: Opencv python Out-of-bounds Read Vulnerability

HIGH
Advisory Identifier: GHSA-fm39-cw8h-3p63
CVSS 8.2
CWE-125
Published
Advisory Summary

CVE-2019-14491 is a HIGH (CVSS 8.2) 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.7.28, 4.1.1.26.

CVE-2019-14491 at a Glance

CVE Identifier CVE-2019-14491
GHSA Identifier GHSA-fm39-cw8h-3p63
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Opencv python
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.2

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:L/I:N/A:H).

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

How to Fix CVE-2019-14491

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: 3.4.7.28
pip install opencv-python>=3.4.7.28
opencv-python fixed: 4.1.1.26
pip install opencv-python>=4.1.1.26
opencv-python-headless fixed: 3.4.7.28
pip install opencv-python-headless>=3.4.7.28
opencv-python-headless fixed: 4.1.1.26
pip install opencv-python-headless>=4.1.1.26
opencv-contrib-python fixed: 3.4.7.28
pip install opencv-contrib-python>=3.4.7.28
opencv-contrib-python fixed: 4.1.1.26
pip install opencv-contrib-python>=4.1.1.26
opencv-contrib-python-headless fixed: 3.4.7.28
pip install opencv-contrib-python-headless>=3.4.7.28
opencv-contrib-python-headless fixed: 4.1.1.26
pip install opencv-contrib-python-headless>=4.1.1.26
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-14491, 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.7.28), 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

An issue was discovered in OpenCV before 3.4.7 and 4.x before 4.1.1 (OpenCV-Python before 3.4.7.28 and 4.x before 4.1.1.26). There is an out of bounds read in the function cv::predictOrdered<cv::HaarEvaluator> in modules/objdetect/src/cascadedetect.hpp, which leads to denial of service.

CVE-2019-14491 Affected Opencv python Versions

8 component(s)
Fixed Versions:
3.4.7.284.1.1.26
Product / Package Ecosystem Affected Versions Fixed Version
opencv-python
PyPI
< 3.4.7.28
3.4.7.28
opencv-python
PyPI
≥ 4.0.0.21
< 4.1.1.26
4.1.1.26
opencv-python-headless
PyPI
< 3.4.7.28
3.4.7.28
opencv-python-headless
PyPI
≥ 4.0.0.21
< 4.1.1.26
4.1.1.26
opencv-contrib-python
PyPI
< 3.4.7.28
3.4.7.28
opencv-contrib-python
PyPI
≥ 4.0.0.21
< 4.1.1.26
4.1.1.26
opencv-contrib-python-headless
PyPI
< 3.4.7.28
3.4.7.28
opencv-contrib-python-headless
PyPI
≥ 4.0.0.21
< 4.1.1.26
4.1.1.26

References

Frequently Asked Questions

What is CVE-2019-14491?
CVE-2019-14491 is a security vulnerability in Opencv python involving Out-of-bounds Read in OpenCV under CWE-125: Out-of-bounds Read.
Which Opencv python versions are affected?
Affected versions include releases prior to 3.4.7.28, 4.1.1.26 across affected packages: opencv-python, opencv-python-headless, opencv-contrib-python, opencv-contrib-python-headless.
What version fixes CVE-2019-14491?
Upgrading to 3.4.7.28, 4.1.1.26 (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 3.4.7.28, 4.1.1.26. Upgrade your dependency to 3.4.7.28, 4.1.1.26 or later.
Is opencv-python-headless affected?
Yes, opencv-python-headless is affected in releases prior to 3.4.7.28, 4.1.1.26. Upgrade your dependency to 3.4.7.28, 4.1.1.26 or later.
What is the CVSS score of CVE-2019-14491?
CVE-2019-14491 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H.
What CWE is associated with CVE-2019-14491?
CVE-2019-14491 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check PyPI dependencies for CVE-2019-14491?
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-fm39-cw8h-3p63",
  "modified" : "2021-10-07T15:12:30Z",
  "published" : "2021-10-12T22:07:14Z",
  "aliases" : [ "CVE-2019-14491" ],
  "summary" : "Out-of-bounds Read in OpenCV",
  "details" : "An issue was discovered in OpenCV before 3.4.7 and 4.x before 4.1.1 (OpenCV-Python before 3.4.7.28 and 4.x before 4.1.1.26). There is an out of bounds read in the function cv::predictOrdered<cv::HaarEvaluator> in modules/objdetect/src/cascadedetect.hpp, which leads to denial of service.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-python"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.4.7.28"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.4.6.27"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-python"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0.21"
      }, {
        "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" : "3.4.7.28"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.4.6.27"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-python-headless"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0.21"
      }, {
        "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" : "3.4.7.28"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.4.6.27"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-contrib-python"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0.21"
      }, {
        "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" : "3.4.7.28"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.4.6.27"
    }
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "opencv-contrib-python-headless"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0.21"
      }, {
        "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-14491"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencv/opencv/issues/15125"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/opencv/opencv-python"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencv/opencv/compare/33b765d...4a7ca5a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/opencv/opencv/compare/371bba8...ddbd10c"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HPFLN6QAX6SUA4XR4NMKKXX26H3TYCVQ"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-07T15:12:30Z",
    "nvd_published_at" : "2019-08-01T17:15:00Z"
  }
}