{"answers":{"affected":"3 open source packages ship an affected version, including neon.","exploited":"There is no known exploitation of GHSA-8mj7-wxmc-f424 in the wild and no public exploit code.","fix":"Upgrade neon to 0.10.1 or later.","what":"GHSA-8mj7-wxmc-f424 is an use after free vulnerability in neon, published on 22 May 2022."},"fix_prompt":"Check this codebase for GHSA-8mj7-wxmc-f424 and fix it if it is affected.\n\nWhat it is: GHSA-8mj7-wxmc-f424 is an use after free vulnerability in neon, published on 22 May 2022. \nExploitation: There is no known exploitation of GHSA-8mj7-wxmc-f424 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- neon (crates.io): affected from 0.8.0; fixed in 0.10.1\n- neon (crates.io): affected from 0.8.0; fixed in 0.10.1\n- neon (crates.io): affected from 0.8.0; fixed in 0.10.1\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-8mj7-wxmc-f424/ (Markdown: https://insights.sbomify.com/GHSA-8mj7-wxmc-f424/index.md)","id":"GHSA-8mj7-wxmc-f424","markdown":"https://insights.sbomify.com/GHSA-8mj7-wxmc-f424/index.md","name":"GHSA-8mj7-wxmc-f424","record":{"aliases":["RUSTSEC-2022-0028"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust Neon library","requires_auth":"none","summary":"A use-after-free vulnerability in the Neon Rust library allows attackers to execute arbitrary code or cause crashes via improperly managed external buffers.","user_interaction":"not_required","vuln_class":"use_after_free"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"Neon provides functionality for creating JavaScript `ArrayBuffer` (and the `Buffer` subtype) instances backed by bytes allocated outside of V8/Node. The [`JsArrayBuffer::external`](https://docs.rs/neon/0.10.0/neon/types/struct.JsArrayBuffer.html#method.external) and [`JsBuffer::external`](https://docs.rs/neon/0.10.0/neon/types/struct.JsBuffer.html#method.external) did not require `T: 'static` prior to Neon `0.10.1`. This allowed creating an externally backed buffer from types that may be freed while they are still referenced by a JavaScript `ArrayBuffer`.\n\nThe following example demonstrates use after free. It compiles on versions `\u003c0.10.1` and fails to compile afterward.\n\n```rust\npub fn soundness_hole(mut cx: FunctionContext) -\u003e JsResult\u003cJsArrayBuffer\u003e {\n    let mut data = vec![0u8, 1, 2, 3];\n    \n    // Creating an external from `\u0026mut [u8]` instead of `Vec\u003cu8\u003e` since there is a blanket impl\n    // of `AsMut\u003cT\u003e for \u0026mut T`\n    let buf = JsArrayBuffer::external(\u0026mut cx, data.as_mut_slice());\n\n    // `buf` is still holding a reference to `data`!\n    drop(data);\n\n    Ok(buf)\n}\n```","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":true,"headline":"Use after free in Neon external buffers","id":"GHSA-8mj7-wxmc-f424","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"use_after_free","year":"2022"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.10.1"],"introduced":["0.8.0"],"last_affected":[],"package":"neon","purl":null,"source":"GHSA-8mj7-wxmc-f424"},{"ecosystem":"crates.io","fixed":["0.10.1"],"introduced":["0.8.0"],"last_affected":[],"package":"neon","purl":"pkg:cargo/neon","source":"GHSA-8mj7-wxmc-f424"},{"ecosystem":"crates.io","fixed":["0.10.1"],"introduced":["0.8.0"],"last_affected":[],"package":"neon","purl":"pkg:cargo/neon","source":"RUSTSEC-2022-0028"}],"products":null,"published":"2022-05-22","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":"A use-after-free vulnerability in the Neon Rust library allows attackers to execute arbitrary code or cause crashes via improperly managed external buffers.","url":"https://insights.sbomify.com/GHSA-8mj7-wxmc-f424/"}