{"answers":{"affected":"3 open source packages ship an affected version, including array-macro.","exploited":"There is no known exploitation of GHSA-83gg-pwxf-jr89 in the wild and no public exploit code.","fix":"Upgrade array-macro to 1.0.5 or later.","what":"GHSA-83gg-pwxf-jr89 is a code injection vulnerability in array-macro, published on 7 May 2020."},"fix_prompt":"Check this codebase for GHSA-83gg-pwxf-jr89 and fix it if it is affected.\n\nWhat it is: GHSA-83gg-pwxf-jr89 is a code injection vulnerability in array-macro, published on 7 May 2020. \nExploitation: There is no known exploitation of GHSA-83gg-pwxf-jr89 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- array-macro (crates.io): affected from 0.1.2; fixed in 1.0.5\n- array-macro (crates.io): affected from 0.1.2; fixed in 1.0.5\n- array-macro (crates.io): affected from 0.1.2; fixed in 1.0.5\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-83gg-pwxf-jr89/ (Markdown: https://insights.sbomify.com/GHSA-83gg-pwxf-jr89/index.md)","id":"GHSA-83gg-pwxf-jr89","markdown":"https://insights.sbomify.com/GHSA-83gg-pwxf-jr89/index.md","name":"GHSA-83gg-pwxf-jr89","record":{"aliases":["RUSTSEC-2020-0161"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust array macro crate","requires_auth":"none","summary":"A Rust library vulnerability allows trait implementations to hijack internal method calls, potentially leading to memory unsoundness and arbitrary code execution.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"Affected versions of this crate called some methods using auto-ref. The affected code looked like this.\n\n```rust\nlet mut arr = $crate::__core::mem::MaybeUninit::uninit();\nlet mut vec = $crate::__ArrayVec::\u003cT\u003e::new(arr.as_mut_ptr() as *mut T);\n```\n\nIn this case, the problem is that `as_mut_ptr` is a method of `\u0026mut MaybeUninit`, not `MaybeUninit`. This made it possible for traits to hijack the method calls in order to cause unsoundness.\n\n```rust\ntrait AsMutPtr\u003cT\u003e {\n    fn as_mut_ptr(\u0026self) -\u003e *mut T;\n}\nimpl\u003cT\u003e AsMutPtr\u003cT\u003e for std::mem::MaybeUninit\u003cT\u003e {\n    fn as_mut_ptr(\u0026self) -\u003e *mut T {\n        std::ptr::null_mut()\n    }\n}\narray![0; 1];\n```\n\nThe flaw was corrected by explicitly referencing variables in macro body in order to avoid auto-ref.","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":"`array!` macro is unsound in presence of traits that implement methods it calls internally","id":"GHSA-83gg-pwxf-jr89","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"code_injection","year":"2020"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["1.0.5"],"introduced":["0.1.2"],"last_affected":[],"package":"array-macro","purl":null,"source":"GHSA-83gg-pwxf-jr89"},{"ecosystem":"crates.io","fixed":["1.0.5"],"introduced":["0.1.2"],"last_affected":[],"package":"array-macro","purl":"pkg:cargo/array-macro","source":"GHSA-83gg-pwxf-jr89"},{"ecosystem":"crates.io","fixed":["1.0.5"],"introduced":["0.1.2"],"last_affected":[],"package":"array-macro","purl":"pkg:cargo/array-macro","source":"RUSTSEC-2020-0161"}],"products":null,"published":"2020-05-07","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 Rust library vulnerability allows trait implementations to hijack internal method calls, potentially leading to memory unsoundness and arbitrary code execution.","url":"https://insights.sbomify.com/GHSA-83gg-pwxf-jr89/"}