GHSA-xfhw-6mc4-mgxf: crayon ObjectPool Creates Uninitialized Memory When Vulnerability
HIGHGHSA-xfhw-6mc4-mgxf is a HIGH (CVSS 7.5) objectpool creates uninitialized memory when vulnerability (CWE-908: Use of Uninitialized Resource) affecting crayon libraries in the crates.io ecosystem. The issue involves objectpool creates uninitialized memory when freeing objects. Remediation is available in the latest vendor maintenance releases.
GHSA-xfhw-6mc4-mgxf at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix GHSA-xfhw-6mc4-mgxf
To remediate this vulnerability, upgrade all affected crayon 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 crayon to Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for crayon
How to Check if You Are Affected
To determine whether your application is affected by GHSA-xfhw-6mc4-mgxf, inspect your project dependencies for crayon:
inspect dependencies for crayon
Analyze the terminal output to locate any version of crayon in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-908: Use of Uninitialized Resource, where the product uses or accesses a resource that has not been initialized. In crayon, 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-xfhw-6mc4-mgxf Affected crayon Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
crayon
|
crates.io |
≥ 0.6.0
≤ 0.7.1
|
|
References
Frequently Asked Questions
What is GHSA-xfhw-6mc4-mgxf?
Which crayon versions are affected?
What version fixes GHSA-xfhw-6mc4-mgxf?
Is crayon affected?
What is the CVSS score of GHSA-xfhw-6mc4-mgxf?
What CWE is associated with GHSA-xfhw-6mc4-mgxf?
How can I check crates.io dependencies for GHSA-xfhw-6mc4-mgxf?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xfhw-6mc4-mgxf",
"modified" : "2024-04-05T15:40:40Z",
"published" : "2024-04-05T15:40:40Z",
"aliases" : [ ],
"summary" : "crayon: ObjectPool creates uninitialized memory when freeing objects",
"details" : "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.\n\nExtremely basic usage of the crate can trigger this issue, e.g. this code from a doctest:\n\n```rust\nuse crayon::prelude::*;\napplication::oneshot().unwrap();\n\nlet mut params = MeshParams::default();\n\nlet mesh = video::create_mesh(params, None).unwrap();\n\n// Deletes the mesh object.\nvideo::delete_mesh(mesh); // <-- UB\n```\n\nThe Clippy warning for this code was silenced in commit c2fde19caf6149d91faa504263f0bc5cafc35de5.\n\nDiscovered via https://asan.saethlin.dev/ub?crate=crayon&version=0.7.1\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "crayon"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.6.0"
}, {
"last_affected" : "0.7.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/shawnscode/crayon/issues/109"
}, {
"type" : "WEB",
"url" : "https://github.com/shawnscode/crayon/commit/c2fde19caf6149d91faa504263f0bc5cafc35de5"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/shawnscode/crayon"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2024-0018.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-908" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-04-05T15:40:40Z",
"nvd_published_at" : null
}
}