mediumVulnerability

GHSA-qwgh-2vcv-g2f7

### 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

Properties

ghsa_id
GHSA-qwgh-2vcv-g2f7
severity
medium
summary
block_buffer: panic corrupts inline buffer position
cve_id
GHSA-qwgh-2vcv-g2f7
is_ghsa_only
true
ghsa_published
2026-08-19T19:15:34Z
source_url
https://github.com/advisories/GHSA-qwgh-2vcv-g2f7
ghsa_updated
2026-08-19T19:15:35Z

Related Entities (4)

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]rust/block_buffer

AFFECTS (1)

[Software]rust/block_buffer

HAS_WEAKNESS (1)

[Weakness]Improper Restriction of Operations within the Bounds of a Memory Buffer

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-qwgh-2vcv-g2f7 — Ninja Signal Threat Intelligence | Ninja Signal