# GHSA-w5p8-4jcx-2j6r: imageproc: integer overflow in kernel size check leads to out-of-bounds read

- Severity: Medium (CVSS:4.0, scored by GitHub) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-05-01T12:00:00.000Z
- Modified: 2026-09-10T03:51:07.150Z
- Also known as: RUSTSEC-2026-0116
- Related: https://github.com/image-rs/imageproc/pull/777
- Weaknesses: CWE-125, CWE-190

## Description

A bounds verification of a slice storage of a 2-dimensional matrix's coefficients (a kernel) would compare the total size against the product of individual dimensions. This would erroneously cast *after* the multiplication and consequently fail to detect possible violations when overflow occurs.

Afterwards, the individual sizes were trusted to properly constrain coordinates within the matrix to indices valid for the underlying storage. With a crafted `Kernel` object, certain combinations of coordinates could then cause an out-of-bounds access in an `unsafe` function while fulfilling its documented preconditions. The kernel value could be passed to library functions that trusted the preconditions and then performed such reads.

(As written by GitHub Advisory Database.)

## Affected

- imageproc (crates.io): before 0.23.1; from 0.24.0 before 0.24.1; from 0.25.0 before 0.25.1; from 0.26.0 before 0.26.2; from 0.0.0-0 before 0.23.1

## References

- <https://github.com/image-rs/imageproc> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0116.html> (advisory, web)
- <https://crates.io/crates/imageproc> (package)

## Sources

- GitHub Advisory Database: [GHSA-w5p8-4jcx-2j6r](https://github.com/advisories/GHSA-w5p8-4jcx-2j6r), CC-BY-4.0, modified 2026-09-10
- RustSec Advisory Database: [RUSTSEC-2026-0116](https://rustsec.org/advisories/RUSTSEC-2026-0116.html), CC0-1.0, modified 2026-05-07

---

Page: https://cve.day/GHSA-w5p8-4jcx-2j6r · Whole record: https://cve.day/GHSA-w5p8-4jcx-2j6r.json · Rebuilt by cve.day 2026-11-25T22:56:43.344Z
