CVE-2026-137083 in OpenCVinfo

Summary

by MITRE • 11/25/2026

OpenCV 3.0.0 through 4.14.0 and 5.0.0 through 5.1.0 contains an out-of-bounds read vulnerability in the built-in MJPEG encoder when writing grayscale frames due to incorrect level shifting in convertToYUV(). Attackers controlling pixel content written as grayscale MJPEG video can trigger unchecked cat_table and huff_dc_tab lookups, leaking adjacent or uninitialized memory into the output file or crashing the process.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/25/2026

The vulnerability identified within OpenCV versions 3.0.0 through 4.14.0 and 5.0.0 through 5.1.0 represents a critical security flaw in the library's built-in MJPEG encoder, specifically affecting the processing of grayscale frames. This issue stems from an incorrect level shifting operation performed within the convertToYUV function, which is responsible for converting pixel data into formats suitable for video encoding. When handling grayscale input, the algorithm fails to properly adjust the luminance values before they are passed to subsequent encoding stages. This miscalculation leads directly to out-of-bounds memory access conditions during the construction of the MJPEG stream. The core technical failure lies in how the encoder interprets and shifts pixel data levels, creating a scenario where array indices or buffer pointers exceed their allocated boundaries due to invalid arithmetic results derived from improperly shifted values.

From an operational perspective, this vulnerability allows attackers who can control the content of grayscale images being processed by OpenCV to trigger unchecked lookups against critical encoding tables such as cat_table and huff_dc_tab. These tables are essential for Huffman coding in MJPEG compression, mapping symbol categories to their corresponding codes. When the out-of-bounds read occurs, the application accesses memory locations adjacent to or entirely outside these intended table structures. This results in two primary adverse outcomes: information disclosure and denial of service. The leakage of adjacent or uninitialized memory into the output video file can expose sensitive data previously stored in those memory regions, potentially revealing cryptographic keys, user credentials, or other proprietary information depending on what was resident in RAM at the time of execution. Alternatively, if the accessed memory is unmapped or protected, the process will encounter a segmentation fault and crash, leading to service disruption for any application relying on OpenCV for video processing tasks.

This vulnerability aligns with Common Weakness Enumeration (CWE) category CWE-125, which describes Out-of-bounds Read vulnerabilities where software reads data past the end or before the beginning of the intended buffer. It also relates closely to CWE-787, as improper level shifting can lead to invalid memory access patterns that compromise system stability and security integrity. In terms of attack vectors, this flaw is exploitable in scenarios where an application accepts user-uploaded grayscale images for encoding into video formats, such as surveillance systems, medical imaging software, or automated quality control pipelines using OpenCV. The exploitation requires the attacker to supply specifically crafted pixel data that triggers the erroneous level shift logic during the conversion process.

Mitigation strategies must prioritize immediate updates to patched versions of OpenCV released after these vulnerabilities were disclosed and analyzed by security researchers. Organizations utilizing affected versions should audit their codebases for any direct calls to MJPEG encoding functions with grayscale inputs and implement input validation checks before processing. If upgrading is not immediately feasible, temporary workarounds include converting grayscale images to RGB or YUV formats explicitly using safe conversion routines that do not rely on the vulnerable internal encoder logic, thereby bypassing the flawed convertToYUV path entirely. Additionally, deploying runtime application self-protection mechanisms or memory safety tools can help detect and mitigate exploitation attempts by monitoring for abnormal memory access patterns associated with this specific flaw. Continuous integration pipelines should include fuzz testing focused on image encoding modules to identify similar edge cases in future development cycles.

Responsible

VulnCheck

Reservation

11/25/2026

Disclosure

11/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00214

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!