Advisory Database
  • Advisories
  • Dependency Scanning
  1. cargo
  2. ›
  3. webp
  4. ›
  5. GHSA-9q78-27f3-2jmh

GHSA-9q78-27f3-2jmh: webp crate may expose memory contents when encoding an image

August 29, 2025

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

  • github.com/advisories/GHSA-9q78-27f3-2jmh
  • github.com/jaredforth/webp
  • github.com/jaredforth/webp/commit/62b47060d7fb8cc0e92e522ee54948edf5aab556
  • github.com/jaredforth/webp/issues/40
  • github.com/jaredforth/webp/pull/44
  • rustsec.org/advisories/RUSTSEC-2024-0443.html

Code Behaviors & Features

Detect and mitigate GHSA-9q78-27f3-2jmh with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 0.3.1

Fixed versions

  • 0.3.1

Solution

Upgrade to version 0.3.1 or above.

Weakness

  • CWE-125: Out-of-bounds Read

Source file

cargo/webp/GHSA-9q78-27f3-2jmh.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 30 Aug 2025 00:19:05 +0000.