CVE-2019-16249 in OpenCVinfo

Summary

by MITRE

OpenCV 4.1.1 has an out-of-bounds read in hal_baseline::v_load in core/hal/intrin_sse.hpp when called from computeSSDMeanNorm in modules/video/src/dis_flow.cpp.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 02/04/2025

The vulnerability CVE-2019-16249 represents a critical out-of-bounds read condition within the OpenCV computer vision library version 4.1.1. This flaw exists in the hardware abstraction layer implementation specifically within the hal_baseline::v_load function located in core/hal/intrin_sse.hpp. The issue manifests when this function is invoked through the computeSSDMeanNorm routine in modules/video/src/dis_flow.cpp, which is part of the dense optical flow computation module. The vulnerability arises from inadequate bounds checking during vectorized memory operations that leverage SSE instruction sets for optimized performance.

The technical root cause stems from improper validation of array indices when processing image data during dense optical flow calculations. When the dis_flow module processes video sequences to compute motion vectors, it calls the computeSSDMeanNorm function which subsequently invokes hal_baseline::v_load with potentially invalid memory access parameters. This function operates on packed data structures using SIMD intrinsics, where the vectorized loading operations do not properly validate that the memory addresses being accessed remain within allocated buffer boundaries. The flaw is particularly dangerous because it occurs during video processing operations that are commonly used in security applications, surveillance systems, and real-time computer vision pipelines.

The operational impact of this vulnerability extends across numerous domains where OpenCV is deployed, including security camera systems, medical imaging software, autonomous vehicle platforms, and industrial automation tools. An attacker could potentially exploit this out-of-bounds read to extract sensitive information from memory, cause application crashes, or in more severe cases, potentially execute arbitrary code depending on memory layout and adjacent data structures. The vulnerability affects any application that utilizes the dense optical flow functionality within OpenCV, particularly those processing video streams where the input data might contain malformed or unexpected dimensions that trigger the faulty code path. This issue aligns with CWE-129 and CWE-787, representing improper input validation and out-of-bounds read vulnerabilities respectively, and could be leveraged by threat actors following ATT&CK technique T1059.007 for command and control operations or T1552 for data manipulation.

Mitigation strategies for CVE-2019-16249 require immediate patching of OpenCV installations to version 4.1.2 or later, which contains the necessary bounds checking fixes. Organizations should also implement input validation measures to sanitize video frame dimensions and ensure proper buffer allocation before invoking optical flow computations. Additionally, runtime monitoring and memory protection mechanisms such as address space layout randomization and stack canaries can help detect or prevent exploitation attempts. System administrators should conduct comprehensive vulnerability assessments across all systems utilizing OpenCV, particularly those handling video feeds or security-critical applications, and consider implementing network segmentation to limit potential attack surface exposure. The fix implemented by the OpenCV team involved adding proper bounds validation checks within the vectorized loading operations to prevent memory access violations during optical flow computation processes.

Reservation

09/11/2019

Moderation

accepted

CPE

ready

EPSS

0.01662

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!