Junglewise Threat Intelligence

CVE-2017-12864: PYSEC-2026-697 - Integer Overflow or Wraparound in OpenCV

CVE-2017-12864 · Severity: low · CVSS 3 · Published 2026-07-02

Technologies: OpenCV, opencv-python (PyPI), opencv-contrib-python (PyPI). Vendors: OpenCV, PyPI.

Executive brief

OpenCV, a widely-used computer vision library, contains an integer overflow vulnerability in its PXM image file format parser. When processing a maliciously crafted image file from an untrusted source, the vulnerability can lead to denial of service or remote code execution.

Technical details

The vulnerability is an integer overflow (CWE-190) in the ReadNumber function within opencv/modules/imgcodecs/src/grfmt_pxm.cpp. The function fails to validate input length before performing arithmetic operations on pixel dimension values, allowing an attacker to trigger signed integer overflow. The attack vector is network-based if the image is sourced remotely; it requires processing a maliciously crafted PXM image file without strict input validation. Successful exploitation can result in denial of service or remote code execution. The vulnerability was patched in OpenCV 3.3.1.11.

Affected products

  • OpenCV OpenCV 3.3.0.9 and earlier
  • OpenCV opencv-python 3.3.0.9 and earlier
  • OpenCV opencv-contrib-python 3.3.0.9 and earlier

Timeline

  • 2017-08-15: disclosed
  • 2017: patched: Fixed in OpenCV 3.3.1.11
  • 2021-10-12: advisory

References

Related threats