{"answers":{"affected":"3 open source packages ship an affected version, including crayon.","exploited":"There is no known exploitation of GHSA-xfhw-6mc4-mgxf in the wild and no public exploit code.","fix":"No fix has been published for GHSA-xfhw-6mc4-mgxf yet. Limit exposure of the affected software until one is available.","what":"GHSA-xfhw-6mc4-mgxf is a memory corruption vulnerability in crayon, published on 27 Feb 2024."},"fix_prompt":"Check this codebase for GHSA-xfhw-6mc4-mgxf and fix it if it is affected.\n\nWhat it is: GHSA-xfhw-6mc4-mgxf is a memory corruption vulnerability in crayon, published on 27 Feb 2024. \nExploitation: There is no known exploitation of GHSA-xfhw-6mc4-mgxf in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- crayon (crates.io): affected from 0.6.0; no fix listed\n- crayon (crates.io): affected from 0.6.0 up to 0.7.1; no fix listed\n- crayon (crates.io): affected from 0.6.0 up to 0.7.1; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-xfhw-6mc4-mgxf/ (Markdown: https://insights.sbomify.com/GHSA-xfhw-6mc4-mgxf/index.md)","id":"GHSA-xfhw-6mc4-mgxf","markdown":"https://insights.sbomify.com/GHSA-xfhw-6mc4-mgxf/index.md","name":"GHSA-xfhw-6mc4-mgxf","record":{"aliases":["RUSTSEC-2024-0018"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust graphics library","requires_auth":"none","summary":"The crayon Rust library triggers undefined behavior by reading uninitialized memory during object pool cleanup, potentially leading to crashes or code execution.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"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); // \u003c-- UB\n```\n\nThe Clippy warning for this code was silenced in commit c2fde19caf6149d91faa504263f0bc5cafc35de5.\n\nDiscovered via https://asan.saethlin.dev/ub?crate=crayon\u0026version=0.7.1","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"crayon: ObjectPool creates uninitialized memory when freeing objects","id":"GHSA-xfhw-6mc4-mgxf","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2024"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":[],"introduced":["0.6.0"],"last_affected":[],"package":"crayon","purl":"pkg:cargo/crayon","source":"RUSTSEC-2024-0018"},{"ecosystem":"crates.io","fixed":[],"introduced":["0.6.0"],"last_affected":["0.7.1"],"package":"crayon","purl":null,"source":"GHSA-xfhw-6mc4-mgxf"},{"ecosystem":"crates.io","fixed":[],"introduced":["0.6.0"],"last_affected":["0.7.1"],"package":"crayon","purl":"pkg:cargo/crayon","source":"GHSA-xfhw-6mc4-mgxf"}],"products":null,"published":"2024-02-27","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"open","licence":"CC0 1.0","name":"RustSec","prefix":"RUSTSEC"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"The crayon Rust library triggers undefined behavior by reading uninitialized memory during object pool cleanup, potentially leading to crashes or code execution.","url":"https://insights.sbomify.com/GHSA-xfhw-6mc4-mgxf/"}