Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious grayscale pixel content
-
ExploitTarget app encodes grayscale frame via built-in MJPEG encoder
-
ExecutionFaulty level shift drives out-of-bounds cat_table/huff_dc_tab lookups
-
ImpactAdjacent or uninitialized memory leaked into output file or process crash
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK
1 technique across 1 tactic: Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The host application must use OpenCV's built-in MJPEG encoder (CAP_OPENCV_MJPEG / VideoWriter with MJPG fourcc) to write single-channel grayscale frames (isColor=false), and the attacker must control the pixel content of those frames; the flaw is in the encoder/writer path, not the decoder. Exploitation is limited by the local attack vector (AV:L), required passive user interaction (UI:P), a specific attack requirement and high complexity (AT:P/AC:H) meaning the vulnerable grayscale-MJPEG encoding code path must actually be exercised with attacker-influenced data, and it affects OpenCV 3.0.0-4.14.0 and 5.0.0-5.1.0; impact is a small memory disclosure into the output file or a process crash rather than code execution. Updating to the patched version is the complete fix. |
| Impact | Signals point to a genuine but low-urgency issue. The CVSS 4.0 score of 5.8 (medium) reflects a hard-to-reach local path: AV:L (local), AC:H (high complexity), AT:P (a specific attack requirement must hold), PR:N (no privileges) and UI:P (passive user interaction), with impact limited to VC:L (small memory leak) and VA:H (process crash/DoS). It is not a remote-unauthenticated RCE. No CISA KEV listing is present and no EPSS probability was supplied, so there is no evidence of active or at-scale exploitation; the vendor/aggregator Decision label is this_month, i.e. patch on a normal maintenance cadence rather than an emergency. No weaponized public exploit was provided, though the upstream fix commit and a new regression test publicly disclose the exact trigger, which modestly raises the chance of a PoC emerging. Net: a real but moderate-priority bug whose risk is bounded by the local vector, high complexity, and the narrow precondition that the host application must encode attacker-controlled single-channel grayscale frames with OpenCV's built-in MJPEG encoder. EPSS was not provided in the input and should be checked to refine prioritization. |
| Exploit ScenarioDerived | An application that re-encodes user-supplied single-channel grayscale frames to MJPEG via OpenCV's built-in VideoWriter processes attacker-crafted pixel content; the incorrect level shift in convertToYUV() drives unchecked cat_table and huff_dc_tab lookups out of bounds, writing adjacent or uninitialized process memory into the output video file or crashing the encoder. No weaponized public exploit was identified, but the upstream fix (PR #31094) and its regression test reveal the precise trigger. The local vector, required user interaction, and high attack complexity make reliable, repeatable exploitation difficult. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 25, 2026
An out-of-bounds read in OpenCV's built-in MJPEG encoder lets an attacker who controls the pixel content of single-channel grayscale frames written to MJPEG video cause adjacent or uninitialized memory to be copied into the resulting file, or crash the process. The flaw affects OpenCV 3.0.0 through 4.14.0 and 5.0.0 through 5.1.0, but only when a host application uses the built-in encoder (CAP_OPENCV_MJPEG, VideoWriter with the MJPG fourcc) with isColor=false, so the vulnerable code path must actually be exercised with attacker-influenced data; the CVSS 4.0 score of 5.8 reflects a local attack vector, high attack complexity, a specific attack pre-condition and passive user interaction, with limited confidentiality impact and high availability impact rather than code execution. No public exploit has been identified at time of analysis, and OpenCV has published upstream fixes. Exploitation requires the victim application to encode attacker-supplied grayscale frames, which makes exposure highly deployment-specific.
RemediationAI
Patch available per vendor advisory: OpenCV has released upstream fixes for the convertToYUV() level shift in pull request 31094 (commit a85f8a0de94a0fbdb7d7fef51cb5132299cf35d1) with the companion change in pull request 29859, referenced from https://github.com/opencv/opencv/pull/31094 and https://github.com/opencv/opencv/pull/29859; installing a build that contains these commits is the complete fix per the assessment, and the upstream advisory should be checked for the exact release that carries them since no discrete patched version number is stated in the available data. Because the bug is only reachable when CAP_OPENCV_MJPEG encodes single-channel grayscale frames, an interim compensating control is to avoid writing grayscale (isColor=false) MJPEG through the built-in encoder in any workflow where frame pixel content comes from untrusted or third-party sources, for example by converting frames to a three-channel format before writing or by using a different VideoWriter backend; the trade-offs are higher memory and CPU cost for the color conversion and possible behavioral differences or reduced portability with alternate backends. Since exploitation also requires the attacker to control pixel data fed to the encoder, restricting that data flow reduces exposure, but updating remains the only complete remediation.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
OpenCV's MJPEG writer lives in modules/videoio/src/cap_mjpeg_encoder.cpp and its convertToYUV() helper performs the RGB-to-YUV level shift before DCT coding. For the single-channel (grayscale) branch the encoder applied pix_data[j]*4 - 128*4 instead of the correct pix_data[j] - 128, scaling the luma values by four so that coefficients fell far outside the range the Huffman tables were sized for. The subsequent quantization step then indexes cat_table and huff_dc_tab without validating the resulting category, producing an out-of-bounds read (CWE-125) of adjacent or uninitialized memory that is emitted into the encoded bitstream, or an invalid table access that terminates the process. The published fix in pull request 31094 changes the expression to (short)(pix_data[j] - 128) and adds a Videoio_MJPEG_Gray roundtrip regression test over quality settings 75, 90 and 100; related changes are tracked in pull request 29859 and commit a85f8a0de94a0fbdb7d7fef51cb5132299cf35d1. The defect is strictly in the encoder/writer path, not the decoder, and the trigger is exercised only when grayscale frames are encoded through CAP_OPENCV_MJPEG.
Know when Opencv gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N
Local grayscale-MJPEG encoding path with attacker-controlled pixels but requiring the app to invoke that encoding (AV:L/AC:H/UI:R), unauthenticated input (PR:N), small memory leak (C:L) and crash (A:H), no scope change.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
OpenCV (Open Source Computer Vision Library) through 3.3 has an out-of-bounds write error in the function FillColorRow4
OpenCV 3.0.0 has a double free issue that allows attackers to execute arbitrary code. Rated high severity (CVSS 8.8), th
OpenCV (Open Source Computer Vision Library) through 3.3 has a buffer overflow in the cv::BmpDecoder::readData function
OpenCV (Open Source Computer Vision Library) through 3.3 has an out-of-bounds write error in the FillColorRow8 function
OpenCV (Open Source Computer Vision Library) through 3.3 has an out-of-bounds write error in the FillUniColor function i
OpenCV (Open Source Computer Vision Library) through 3.3 has an invalid write in the cv::RLByteStream::getBytes function
OpenCV (Open Source Computer Vision Library) through 3.3 has an out-of-bounds write error in the function FillColorRow1
OpenCV (Open Source Computer Vision Library) through 3.3 has an out-of-bounds read error in the function icvCvt_BGRA2BGR
OpenCV (Open Source Computer Vision Library) through 3.3 has an out-of-bounds read error in the cv::RBaseStream::readBlo
An issue was discovered in OpenCV before 3.4.7 and 4.x before 4.1.1. Rated high severity (CVSS 8.2), this vulnerability
OpenCV (Open Source Computer Vision Library) through 3.3 has a denial of service (memory consumption) issue, as demonstr
OpenCV (Open Source Computer Vision Library) through 3.3 has a denial of service (CPU consumption) issue, as demonstrate
EUVD-2026-135763
GHSA-qc46-3cj7-2qc9
NVD
CVE.org
EPSS
Exploit-DB