GHSA-xfhw-6mc4-mgxf
HIGH 7.5CVSS 3.1crayon: ObjectPool creates uninitialized memory when freeing objects
As of version 0.6.0, the ObjectPool explicitly creates an uninitialized instance of its type parameter when it attempts to free an object, and swaps it into the storage. This causes instant undefined behavior due to reading the uninitialized memory in order to write it to the pool storage.
Extremely basic usage of the crate can trigger this issue, e.g. this code from a doctest:
use crayon::prelude::*;
application::oneshot().unwrap();
let mut params = MeshParams::default();
let mesh = video::create_mesh(params, None).unwrap();
// Deletes the mesh object.
video::delete_mesh(mesh); // <-- UB
The Clippy warning for this code was silenced in commit c2fde19caf6149d91faa504263f0bc5cafc35de5.
Discovered via https://asan.saethlin.dev/ub?crate=crayon&version=0.7.1
- Published
- 27 Feb 2024
- Last modified
- 11 Apr 2024
- Weakness
- CWE-908
- Also known as
- RUSTSEC-2024-0018
- Sources
- OSVJSONOSV RUSTSEC-2024-0018JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 3.1 | HIGH 7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | crayon | >= 0.6.0, <= 0.7.1 | |
| OSV | crates.io | crayon | >= 0.6.0 |
References
- https://github.com/shawnscode/crayon/issues/109 · WEB, REPORT
- https://github.com/shawnscode/crayon/commit/c2fde19caf6149d91faa504263f0bc5cafc35de5 · WEB
- https://github.com/shawnscode/crayon · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2024-0018.html · WEB, ADVISORY
- https://crates.io/crates/crayon · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 27 Feb 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 5 Apr 2024)