Use of Uninitialized Resource Affecting crayon package, versions >=0.6.0 <0.7.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUST-CRAYON-6579647
  • published7 Apr 2024
  • disclosed5 Apr 2024
  • creditUnknown

Introduced: 5 Apr 2024

CVE NOT AVAILABLE CWE-908  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade crayon to version 0.7.2 or higher.

Overview

crayon is a game framework, which loosely inspired by some amazing blogs on bitsquid, molecular and floooh.

Affected versions of this package are vulnerable to Use of Uninitialized Resource due to the ObjectPool explicitly creating an uninitialized instance of its type parameter when attempting to free an object, and swapping it into the storage. This results in instant undefined behavior from reading the uninitialized memory to write it to the pool storage.

PoC

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

CVSS Scores

version 3.1