{"answers":{"affected":"2 open source packages ship an affected version, including block_buffer.","exploited":"There is no known exploitation of GHSA-qwgh-2vcv-g2f7 in the wild and no public exploit code.","fix":"Upgrade block_buffer to 0.12.1 or later.","what":"GHSA-qwgh-2vcv-g2f7 is a memory corruption vulnerability in block_buffer, published on 19 Aug 2026."},"fix_prompt":"Check this codebase for GHSA-qwgh-2vcv-g2f7 and fix it if it is affected.\n\nWhat it is: GHSA-qwgh-2vcv-g2f7 is a memory corruption vulnerability in block_buffer, published on 19 Aug 2026. \nExploitation: There is no known exploitation of GHSA-qwgh-2vcv-g2f7 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- block_buffer (crates.io): affected all versions; fixed in 0.12.1\n- block_buffer (crates.io): affected all versions; fixed in 0.12.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-qwgh-2vcv-g2f7/ (Markdown: https://insights.sbomify.com/GHSA-qwgh-2vcv-g2f7/index.md)","id":"GHSA-qwgh-2vcv-g2f7","markdown":"https://insights.sbomify.com/GHSA-qwgh-2vcv-g2f7/index.md","name":"GHSA-qwgh-2vcv-g2f7","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["code_execution","denial_of_service"],"network_reachable":"unknown","non_default_config":false,"product_category":"Rust buffer library","requires_auth":"none","summary":"A caught panic in block_buffer can corrupt internal cursor positions, leading to out-of-bounds memory access and potential 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":"### Summary\n\nA caught panic may leave the cursor position of `EagerBuffer` or `ReadBuffer` in a corrupted state; this in turn allows out-of-bounds reads/writes.\n\n### Details \u0026 PoC\n\nThe following two tests fail miri:\n\n```rust\n#[cfg(miri)]\n#[test]\nfn eager_digest_blocks_panic_corrupts_inline_position() {\n    // `EagerBuffer` stores its cursor in the last byte of the internal block.\n    // When `digest_blocks` completes a previously partial block, it overwrites\n    // that byte with input data before invoking the caller-provided `compress`\n    // callback. If the callback panics, safe code can catch the panic and keep\n    // using the buffer while its cursor byte no longer satisfies the internal\n    // `pos \u003c block_size` invariant. Under Miri this `get_pos` call reaches the\n    // `unreachable_unchecked` used for the assumed-valid cursor.\n    let mut buf = EagerBuffer::\u003cU4\u003e::new(\u0026[1, 2]);\n\n    let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\n        buf.digest_blocks(\u0026[3, 0xff], |_| panic!(\"simulated compression failure\"));\n    }));\n\n    let _ = buf.get_pos();\n}\n\n#[cfg(miri)]\n#[test]\nfn read_buffer_generator_panic_corrupts_inline_position() {\n    // `ReadBuffer` stores its cursor in `buffer[0]`, but `write_block` gives\n    // `gen_block` mutable access to the whole internal block before restoring\n    // `buffer[0]` to a valid cursor. If `gen_block` writes an arbitrary first\n    // byte and panics, safe code can catch the panic and later observe an\n    // invalid cursor. Under Miri this `get_pos` call reaches the\n    // `unreachable_unchecked` used for the assumed-valid cursor.\n    let mut buf = ReadBuffer::\u003cU4\u003e::default();\n\n    let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\n        buf.write_block(\n            1,\n            |block| {\n                block[0] = 0xff;\n                panic!(\"simulated block generation failure\");\n            },\n            |_| {},\n        );\n    }));\n\n    let _ = buf.get_pos();\n}\n```\n\nThey fail on an `unreachable_unchecked!()` under the invariant for the `pos` to always be within bounds of the block.\n\n### Impact\n\nWhile the byte that overwrites `pos` may come from untrusted input and is therefore attacker-controlled, this still relies on the surrounding code catching the panic and carrying on, which should be uncommon in practice.\n\nFor this to be exploitable, the attacker also needs a way to trigger a panic here; I have not investigated how feasible that is.\n\n### Credits\n\nThe issue was discovered by GPT-5.5","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":"block_buffer: panic corrupts inline buffer position","id":"GHSA-qwgh-2vcv-g2f7","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"memory_corruption","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["0.12.1"],"introduced":["0"],"last_affected":[],"package":"block_buffer","purl":null,"source":"GHSA-qwgh-2vcv-g2f7"},{"ecosystem":"crates.io","fixed":["0.12.1"],"introduced":["0"],"last_affected":[],"package":"block_buffer","purl":"pkg:cargo/block_buffer","source":"GHSA-qwgh-2vcv-g2f7"}],"products":null,"published":"2026-08-19","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"A caught panic in block_buffer can corrupt internal cursor positions, leading to out-of-bounds memory access and potential code execution.","url":"https://insights.sbomify.com/GHSA-qwgh-2vcv-g2f7/"}