OpenCV 3.0.0 through 4.14.0 and 5.0.0 through 5.1.0 MJPEG Encoder Out-of-Bounds Read
- State
- Published
- Severity
- 5.8 Medium
- Published
- Nov 25, 2026
- Updated
- Nov 30, 2026
- Reserved
- Nov 25, 2026
Description
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.
| Product | Versions |
|---|---|
| OpenCV OpenCV | 3.0.0 through 4.14.0 Affected5.0.0 through 5.1.0 Affected |
| CVSS | Score | How It's Reached | Source |
|---|---|---|---|
| 4.0 | 5.8 Medium | VulnCheck | |
| 3.1 | 5.3 Medium | VulnCheck |
Weaknesses
- CWE-125 Out-of-bounds Read
References
- https://github.com/opencv/opencv/pull/31094Issue TrackerPatch
- https://github.com/opencv/opencv/commit/a85f8a0de94a0fbdb7d7fef51cb5132299cf35d1Patch
- https://github.com/opencv/opencv/pull/29859Issue TrackerPatch
- https://github.com/opencv/opencv/blob/4.14.0/modules/videoio/src/cap_mjpeg_encoder.cpp#L1140Technical Details
- https://github.com/opencv/opencv/blob/4.14.0/modules/videoio/src/cap_mjpeg_encoder.cpp#L1308Technical Details
- VulnCheck Advisory: OpenCV 3.0.0 through 4.14.0 and 5.0.0 through 5.1.0 MJPEG Encoder Out-of-Bounds ReadThird-Party Advisory
Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.