GHSA-qwgh-2vcv-g2f7Medium▾ Sunlitblock_buffer: panic corrupts inline buffer position
▾ Sunlit zone — Low / medium · no exploitation signal
impact 27.5 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
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.
The following two tests fail miri:
#[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.
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.
The issue was discovered by GPT-5.5
block_buffer < 0.12.1Upgrade to a patched release:
block_buffer 0.12.1Connected by shared product, vendor, weakness, or advisory.
CVE-2015-2546High· 8.2The kernel-mode driver in Microsoft Windows Vista SP2, Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8, Windows 8.1, Windows Server 2012 Gold and R2, Windows RT Gold and 8.1, and Windows 10 allows local users to gain privile…
CVE-2020-0796Critical· 10.0A remote code execution vulnerability exists in the way that the Microsoft Server Message Block 3.1.1 (SMBv3) protocol handles certain requests, aka 'Windows SMBv3 Client/Server Remote Code Execution Vulnerability'.
CVE-2020-3562High· 8.6A vulnerability in the SSL/TLS inspection of Cisco Firepower Threat Defense (FTD) Software for Cisco Firepower 2100 Series firewalls could allow an unauthenticated, remote attacker to cause a denial of service (DoS) condition on an affec…
CVE-2021-31979High· 7.8Windows Kernel Elevation of Privilege Vulnerability
CVE-2025-26597High· 7.8A buffer overflow flaw was found in X.Org and Xwayland
CVE-2026-100745Medium· 6.3A vulnerability has been found in Edimax BR-6428nC 1.16