GHSA-cvhw-2593-5j2q CVE-2016-1516 PYSEC-2026-2816 PYSEC-2026-707
Double Free in OpenCV
- Severity
- 8.8 / 10
- High · CVSS 3.0
- Exploit chance (EPSS)
- 2.35%
- Chance of exploitation in the next 30 days. Higher than 83.66% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-415 Double Free
- Fix
- Available
- 2 packages have a fixed version
Description
OpenCV 3.0.0 has a double free issue that allows attackers to execute arbitrary code. This issue was fixed in OpenCV version 3.3.1 (corresponding to OpenCV-Python and and OpenCV-Contrib-Python 3.3.1.11).
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| opencv-contrib-python | < 3.3.1.11 |
3.3.1.11 |
| opencv-python | < 3.3.1.11 |
3.3.1.11 |
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.3.1.11
- pip
pip install --upgrade "opencv-contrib-python>=3.3.1.11"- poetry
poetry add "opencv-contrib-python>=3.3.1.11"- uv
uv add "opencv-contrib-python>=3.3.1.11"
opencv-python PyPI → 3.3.1.11
- pip
pip install --upgrade "opencv-python>=3.3.1.11"- poetry
poetry add "opencv-python>=3.3.1.11"- uv
uv add "opencv-python>=3.3.1.11"
Severity breakdown
CVSS 3.0 8.8
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-415: Double Free
The product calls free() twice on the same memory address.
How to prevent it
- Architecture and Design: Choose a language that provides automatic memory management.
- Implementation: Ensure that each allocation is freed only once. After freeing a chunk, set the pointer to NULL to ensure the pointer cannot be freed again. In complicated error conditions, be sure that clean-up routines respect the state of allocation properly. If the language is object oriented, ensure that object destructors delete each chunk of memory only once.
- Implementation: Use a static analysis tool to find double free instances.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why 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 |
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