Rust advisories / webp
Unsound MediumRUSTSEC-2024-0443 · webp
RUSTSEC-2024-0443: webp crate may expose memory contents when encoding an image
Short answerwebp has an API that can cause undefined behaviour from safe code: webp crate may expose memory contents when encoding an image. Fixed in 0.3.1.
| Crate | webp |
|---|---|
| Type | Unsound (memory-exposure) |
| Affected versions | Before 0.3.1. |
| Fixed in | 0.3.1 |
| Severity | Medium (GitHub rating) |
| Published | 2024-09-06 |
| Last changed | 2025-10-28 |
| Also known as | GHSA-9q78-27f3-2jmh |
What to do
- See which version you have:
cargo tree -i webp(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p webp. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplewebp = "0.3.1") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Affected versions of this crate did not check that the input slice passed to "webp::Encoder::encode() is large enough for the specified image dimensions.
If the input slice is too short, the library will read out of bounds of the buffer and encode other memory contents as an image, resulting in memory exposure or a segmentation fault.
The flaw was corrected in pull request #44 by always validating the input buffer size when constructing the encoder.
References
- Package: crates.io/crates/webp
- Advisory: rustsec.org/advisories/RUSTSEC-2024-0443.html
- Report: github.com/jaredforth/webp/issues/40
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?