Description
An out-of-bounds read was discovered in OpenCV before 4.1.1. Specifically, variable coarsest_scale is assumed to be greater than or equal to finest_scale within the calc()/ocl_calc() functions in dis_flow.cpp. However, this is not true when dealing with small images, leading to an out-of-bounds read of the heap-allocated arrays Ux and Uy.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | opencv | 4.1.2+dfsg-3 | — |
| Debian 13 | opencv | 4.1.2+dfsg-3 | — |
| Debian 12 | opencv | 4.1.2+dfsg-3 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 22.04 LTS | opencv | 4.5.4+dfsg-9ubuntu4+esm1 | USN-7247-1 |
| Ubuntu Pro 18.04 LTS | opencv | 3.2.0+dfsg-4ubuntu0.1+esm4 | USN-7247-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | opencv-contrib-python | < 4.1.0.25 | 4.1.0.25 | GHSA-jggw-2q6g-c3m6 |
| PyPI | opencv-contrib-python-headless | < 4.1.0.25 | 4.1.0.25 | GHSA-jggw-2q6g-c3m6 |
| PyPI | opencv-python | < 4.1.0.25 | 4.1.0.25 | GHSA-jggw-2q6g-c3m6 |
| PyPI | opencv-python-headless | < 4.1.0.25 | 4.1.0.25 | GHSA-jggw-2q6g-c3m6 |
Advisories 1
- USN-7247-1 opencv vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026