Security mailing lists by PureSourceCode

GHSA-xfhw-6mc4-mgxf

HIGH 7.5CVSS 3.1

crayon: 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

SourceScored byVersionScoreVector / 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

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io crayon >= 0.6.0, <= 0.7.1
OSV crates.io crayon >= 0.6.0

References

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)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.