Skip to content

GHSA-fm39-cw8h-3p63 CVE-2019-14491 PYSEC-2026-2797 PYSEC-2026-2818 PYSEC-2026-2836 PYSEC-2026-720

Out-of-bounds Read in OpenCV

High PyPI
Severity
8.2 / 10
High · CVSS 3.0
Exploit chance (EPSS)
2.89%
Chance of exploitation in the next 30 days. Higher than 86.90% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-125 Out-of-bounds Read
Fix
Available
4 packages have a fixed version

Description

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::predictOrderedcv::HaarEvaluator in modules/objdetect/src/cascadedetect.hpp, which leads to denial of service.

Affected versions

PyPI

PackageVulnerableFixed in
opencv-contrib-python
< 3.4.7.28
3.4.7.28
opencv-contrib-python
>= 4.0.0.21, < 4.1.1.26
4.1.1.26
opencv-contrib-python
< 3.4.7.28
>= 4.0.0.21, < 4.1.1.26
3.4.7.28
4.1.1.26
opencv-contrib-python-headless
< 3.4.7.28
3.4.7.28
opencv-contrib-python-headless
>= 4.0.0.21, < 4.1.1.26
4.1.1.26
opencv-contrib-python-headless
< 3.4.7.28
>= 4.0.0.21, < 4.1.1.26
3.4.7.28
4.1.1.26
opencv-python
< 3.4.7.28
3.4.7.28
opencv-python
>= 4.0.0.21, < 4.1.1.26
4.1.1.26
opencv-python
< 3.4.7.28
>= 4.0.0.21, < 4.1.1.26
3.4.7.28
4.1.1.26
opencv-python-headless
< 3.4.7.28
3.4.7.28
opencv-python-headless
>= 4.0.0.21, < 4.1.1.26
4.1.1.26
opencv-python-headless
< 3.4.7.28
>= 4.0.0.21, < 4.1.1.26
3.4.7.28
4.1.1.26

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

opencv-contrib-python PyPI → 3.4.7.28

pip
pip install --upgrade "opencv-contrib-python>=3.4.7.28"
poetry
poetry add "opencv-contrib-python>=3.4.7.28"
uv
uv add "opencv-contrib-python>=3.4.7.28"

opencv-contrib-python-headless PyPI → 3.4.7.28

pip
pip install --upgrade "opencv-contrib-python-headless>=3.4.7.28"
poetry
poetry add "opencv-contrib-python-headless>=3.4.7.28"
uv
uv add "opencv-contrib-python-headless>=3.4.7.28"

opencv-python PyPI → 3.4.7.28

pip
pip install --upgrade "opencv-python>=3.4.7.28"
poetry
poetry add "opencv-python>=3.4.7.28"
uv
uv add "opencv-python>=3.4.7.28"

opencv-python-headless PyPI → 3.4.7.28

pip
pip install --upgrade "opencv-python-headless>=3.4.7.28"
poetry
poetry add "opencv-python-headless>=3.4.7.28"
uv
uv add "opencv-python-headless>=3.4.7.28"

Severity breakdown

CVSS 3.0 8.2

CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
High

Weakness

CWE-125: Out-of-bounds Read

The product reads data past the end, or before the beginning, of the intended buffer.

How to prevent it
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. To reduce the likelihood of introducing an out-of-bounds read, ensure that you validate and ensure correct calculations for any length argument, buffer size calculation, or offset. Be especially careful of relying on a sentinel (i.e. special character such as NUL) in untrusted inputs.
  • Architecture and Design: Use a language that provides appropriate memory abstractions.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
PYSEC-2023-183
opencv-python versions before v4.8.1.78 bundled libwebp binaries in wheels that are vulnerable to CVE-2023-4863.
High Known exploited Also affects opencv-python
PYSEC-2023-181
opencv-contrib-python versions before v4.8.1.78 bundled libwebp binaries in wheels that are vulnerable to CVE-2023-4863.
High Known exploited Also affects opencv-contrib-python
GHSA-qr4w-53vh-m672
opencv-python bundled libwebp binaries in wheels that are vulnerable to CVE-2023-4863
High Also affects opencv-python
GHSA-cxjf-x6jp-p7mc
opencv-contrib-python bundled libwebp binaries in wheels that are vulnerable to CVE-2023-4863
High Also affects opencv-contrib-python
GHSA-9g8h-pjm4-q92p
Out-of-bounds Write in OpenCV.
Medium Also affects opencv-contrib-python
GHSA-q799-q27x-vp7w
Out-of-bounds Write in OpenCV
High Also affects opencv-contrib-python
GHSA-m6vm-8g8v-xfjh
Out-of-bounds Write in OpenCV
High Also affects opencv-contrib-python
GHSA-jggw-2q6g-c3m6
Out-of-bounds Read in OpenCV
Medium Also affects opencv-contrib-python
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor