Rust advisories / glsl-layout
Vulnerability HighRUSTSEC-2021-0005 · glsl-layout
RUSTSEC-2021-0005: Double drop upon panic in 'fn map_array()'
Short answerA security vulnerability in the glsl-layout crate: Double drop upon panic in 'fn map_array()'. High severity (CVSS 7.5). Fixed in 0.4.0: update to a fixed version.
| Crate | glsl-layout |
|---|---|
| Type | Vulnerability (memory-corruption) |
| Affected versions | Before 0.4.0. |
| Fixed in | 0.4.0 |
| Severity | High, CVSS 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| Published | 2021-01-10 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2021-25902, GHSA-cx4j-fxr7-jxg8 |
What to do
- See which version you have:
cargo tree -i glsl-layout(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p glsl-layout. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleglsl-layout = "0.4.0") 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 guard against panic within the user-provided function f (2nd parameter of fn map_array), and thus panic within f causes double drop of a single object.
The flaw was corrected in the 0.4.0 release by wrapping the object vulnerable to a double drop within ManuallyDrop<T>.
References
- Package: crates.io/crates/glsl-layout
- Advisory: rustsec.org/advisories/RUSTSEC-2021-0005.html
- Web: github.com/rustgd/glsl-layout/pull/10
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?