# GHSA-w5p8-4jcx-2j6r: Improper check of an invariant resulting in incorrect bounds checks

> An integer overflow in kernel size validation allows out-of-bounds reads, potentially causing crashes or information disclosure in applications using the imageproc library.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 May 2026
- **Also known as:** RUSTSEC-2026-0116

## What is GHSA-w5p8-4jcx-2j6r?

GHSA-w5p8-4jcx-2j6r is a vulnerability in imageproc, published on 1 May 2026. 

### Official 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.

## Which versions are affected by GHSA-w5p8-4jcx-2j6r?

9 open source packages ship an affected version, including imageproc.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `imageproc` | crates.io | All versions | 0.23.1 |
| `imageproc` | crates.io | All versions | 0.23.1 |
| `imageproc` | crates.io | From 0.0.0-0 | 0.23.1, 0.24.1, 0.25.1, 0.26.2 |
| `imageproc` | crates.io | From 0.24.0 | 0.24.1 |
| `imageproc` | crates.io | From 0.24.0 | 0.24.1 |
| `imageproc` | crates.io | From 0.25.0 | 0.25.1 |
| `imageproc` | crates.io | From 0.25.0 | 0.25.1 |
| `imageproc` | crates.io | From 0.26.0 | 0.26.2 |
| `imageproc` | crates.io | From 0.26.0 | 0.26.2 |

## How do I fix GHSA-w5p8-4jcx-2j6r?

Upgrade imageproc to a fixed version for your release line: 0.23.1, 0.24.1, 0.25.1 or 0.26.2.

## Is GHSA-w5p8-4jcx-2j6r being exploited?

There is no known exploitation of GHSA-w5p8-4jcx-2j6r in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-w5p8-4jcx-2j6r and fix it if it is affected.

What it is: GHSA-w5p8-4jcx-2j6r is a vulnerability in imageproc, published on 1 May 2026. 
Exploitation: There is no known exploitation of GHSA-w5p8-4jcx-2j6r in the wild and no public exploit code.

Affected packages and fixed versions:
- imageproc (crates.io): affected all versions; fixed in 0.23.1
- imageproc (crates.io): affected all versions; fixed in 0.23.1
- imageproc (crates.io): affected from 0.0.0-0; fixed in 0.23.1, 0.24.1, 0.25.1, 0.26.2
- imageproc (crates.io): affected from 0.24.0; fixed in 0.24.1
- imageproc (crates.io): affected from 0.24.0; fixed in 0.24.1
- imageproc (crates.io): affected from 0.25.0; fixed in 0.25.1
- imageproc (crates.io): affected from 0.25.0; fixed in 0.25.1
- imageproc (crates.io): affected from 0.26.0; fixed in 0.26.2
- imageproc (crates.io): affected from 0.26.0; fixed in 0.26.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-w5p8-4jcx-2j6r/ (Markdown: https://insights.sbomify.com/GHSA-w5p8-4jcx-2j6r/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-w5p8-4jcx-2j6r

---
From sbomify Insights: https://insights.sbomify.com/GHSA-w5p8-4jcx-2j6r/
Summaries are generated and may contain mistakes; the official description above is the record.
