imageproc, Fragile bounds check when sampling from image, RUSTSEC-2026-0115 (Moderate severity)

Listen to this Post

How the vulnerability works:

The pixel‑reading routine was meant to keep coordinates inside the image. It did this by adding a constant to an input and then using min(result, dim‑1). This logic, however, did not protect against integer overflows in the addition. When the addition overflowed, the clamped value could become a very small number (often zero) instead of the intended coordinate. Because the bounds check was tricked, the code went on to sample the image at several differently calculated positions, and those positions could be far outside the valid image area. This effectively turned a single overflow into a primitive that allowed reading memory beyond the allocated image buffer. The flaw was present because the check was performed on the already‑overflowed value, not on the original input. As a result, an attacker who controls the input coordinates could force the library to read arbitrary bytes from the heap, potentially leaking sensitive data.

DailyCVE form:

Platform: imageproc crate
Version: 0.24.0,0.25.0,0.26.0‑0.26.1
Vulnerability: Integer overflow bounds
Severity: Moderate severity
Date: 2026‑05‑07

Prediction: Patch 2026‑05‑08

What Undercode Say:

Analytics:

Count vulnerable downloads
curl -s https://crates.io/api/v1/crates/imageproc | jq '.crate.downloads'
Check for out‑of‑bounds patterns
rg "min\s(\s.\s+\s.\s,\sdim\s-\s1\s)" -A 5
Monitor imageproc versions in Cargo.lock
grep -E "imageproc [0-9]+.[0-9]+.[0-9]+" Cargo.lock

Exploit:

1. Supply an image with width=65535, height=1.
2. Request pixel at coordinate x=1, y=65535.
3. Internal calc: y + offset → wraps to 0.
4. Bounds check passes (0 < height).
5. Later checks use original y (65535) → out‑of‑bounds.
6. Read arbitrary heap memory.

Protection from this CVE:

  • Upgrade to imageproc 0.24.1, 0.25.1, or 0.26.2 immediately.
  • If upgrade is impossible, audit all uses of imageproc::binary_descriptors::brief.
  • Replace `min(coord + offset, dim‑1)` with checked addition and explicit bounds checks.
  • Use Rust’s `usize::checked_add()` before any index calculation.

Impact:

  • Successful exploit leads to out‑of‑bounds reads of the image buffer.
  • Can leak sensitive heap data (e.g., private keys, session tokens).
  • May be chained with other bugs to achieve information disclosure.
  • Affects all applications that process untrusted images with vulnerable imageproc versions.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top