{"answers":{"affected":"3 open source packages ship an affected version, including elf_rs.","exploited":"There is no known exploitation of GHSA-g6pw-999w-j75m in the wild and no public exploit code.","fix":"Upgrade elf_rs to 0.3.0 or later.","what":"GHSA-g6pw-999w-j75m is a memory corruption vulnerability in elf_rs, published on 31 Oct 2022."},"fix_prompt":"Check this codebase for GHSA-g6pw-999w-j75m and fix it if it is affected.\n\nWhat it is: GHSA-g6pw-999w-j75m is a memory corruption vulnerability in elf_rs, published on 31 Oct 2022. \nExploitation: There is no known exploitation of GHSA-g6pw-999w-j75m in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- elf_rs (crates.io): affected all versions; fixed in 0.3.0\n- elf_rs (crates.io): affected all versions; fixed in 0.3.0\n- elf_rs (crates.io): affected from 0.0.0-0; fixed in 0.3.0\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-g6pw-999w-j75m/ (Markdown: https://insights.sbomify.com/GHSA-g6pw-999w-j75m/index.md)","id":"GHSA-g6pw-999w-j75m","markdown":"https://insights.sbomify.com/GHSA-g6pw-999w-j75m/index.md","name":"GHSA-g6pw-999w-j75m","record":{"aliases":["RUSTSEC-2022-0079"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust ELF parsing library","requires_auth":"none","summary":"A Rust library for parsing ELF files fails to validate section header offsets, allowing attackers to cause crashes via malformed input.","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":"The crate has several unsafe sections that don't perform proper pointer validation.\n\nAn example can be found in the following function:\n\n```\nfn section_header_raw(\u0026self) -\u003e \u0026[ET::SectionHeader] {\n    let sh_off = self.elf_header().section_header_offset() as usize;\n    let sh_num = self.elf_header().section_header_entry_num() as usize;\n    unsafe {\n        let sh_ptr = self.content().as_ptr().add(sh_off);\n        from_raw_parts(sh_ptr as *const ET::SectionHeader, sh_num)\n    }\n}\n```\n\nWhile this will work perfectly fine *if* the ELF header is valid, malicious or malformed input can contain a section header offset of an arbitrary size, meaning that the resultant pointer in the unsafe block can point to an artibrary address in the address space of the process.\n\nThis can result in unpredictable behaviour, and in our fuzz testing, we discovered that it's trivial to cause SIGABRT (signal 6), or SEGV (signal 11).\n\nThe function should either be marked as unsafe, with a note that the caller is responsible for providing only valid inputs, or it should ideally do the due diligence to ensure that the offset doesn't exceed the bounds of the header (and add additional checks as necessary).","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":"ELF header parsing library doesn't check for valid offset","id":"GHSA-g6pw-999w-j75m","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2022"},"n_packages":3,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.3.0"],"introduced":["0"],"last_affected":[],"package":"elf_rs","purl":null,"source":"GHSA-g6pw-999w-j75m"},{"ecosystem":"crates.io","fixed":["0.3.0"],"introduced":["0"],"last_affected":[],"package":"elf_rs","purl":"pkg:cargo/elf_rs","source":"GHSA-g6pw-999w-j75m"},{"ecosystem":"crates.io","fixed":["0.3.0"],"introduced":["0.0.0-0"],"last_affected":[],"package":"elf_rs","purl":"pkg:cargo/elf_rs","source":"RUSTSEC-2022-0079"}],"products":null,"published":"2022-10-31","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 for parsing ELF files fails to validate section header offsets, allowing attackers to cause crashes via malformed input.","url":"https://insights.sbomify.com/GHSA-g6pw-999w-j75m/"}