GHSA-9q78-27f3-2jmh: Webp Webp Crate May Expose Memory Vulnerability
MODERATEGHSA-9q78-27f3-2jmh is a MODERATE webp crate may expose memory vulnerability (CWE-125: Out-of-bounds Read) affecting Webp libraries in the crates.io ecosystem. The issue involves webp crate may expose memory contents when encoding an image. Remediation is available by upgrading affected packages to version 0.3.1.
GHSA-9q78-27f3-2jmh at a Glance
How to Fix GHSA-9q78-27f3-2jmh
To remediate this vulnerability, upgrade all affected Webp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade webp to 0.3.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for webp
How to Check if You Are Affected
To determine whether your application is affected by GHSA-9q78-27f3-2jmh, inspect your project dependencies for Webp:
inspect dependencies for webp
Analyze the terminal output to locate any version of Webp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.1), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Webp, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-9q78-27f3-2jmh Affected Webp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
webp
|
crates.io |
< 0.3.1
|
0.3.1
|
References
Frequently Asked Questions
What is GHSA-9q78-27f3-2jmh?
Which Webp versions are affected?
What version fixes GHSA-9q78-27f3-2jmh?
Is webp affected?
What CWE is associated with GHSA-9q78-27f3-2jmh?
How can I check crates.io dependencies for GHSA-9q78-27f3-2jmh?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9q78-27f3-2jmh",
"modified" : "2025-08-29T20:30:04Z",
"published" : "2025-08-29T20:30:04Z",
"aliases" : [ ],
"summary" : "webp crate may expose memory contents when encoding an image",
"details" : "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.\n\nIf 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.\n\nThe flaw was corrected in [pull request #44](https://github.com/jaredforth/webp/pull/44) by always validating the input buffer size when constructing the encoder.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "webp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.3.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jaredforth/webp/issues/40"
}, {
"type" : "WEB",
"url" : "https://github.com/jaredforth/webp/pull/44"
}, {
"type" : "WEB",
"url" : "https://github.com/jaredforth/webp/commit/62b47060d7fb8cc0e92e522ee54948edf5aab556"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jaredforth/webp"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0443.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-125" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-08-29T20:30:04Z",
"nvd_published_at" : null
}
}