Repository navigation
Conversation
|
Upstream review is now available: the RustCrypto maintainer confirms that v0.10 is not affected, because it stores the position separately. The published repository advisory API, updated2026-10-27T10:55:47Z, now lists At2026-10-27T11:30Z, the central GitHub advisory and OSV still listed the old introduced0 range; OSV returned GHSA-qwgh-2vcv-g2f7 for block-buffer0.10.4. The public query is reproducible: {"package":{"ecosystem":"crates.io","name":"block-buffer"},"version":"0.10.4"}POST that JSON to https://api.osv.dev/v1/query. Could you review/reconcile this proposed correction with the accepted upstream record and update the central entry? I am not asserting the first affected prerelease: this PR's prerelease bound and the maintainer's published stable bound differ, so that detail needs its own verification. |
|
I independently verified the exact One range detail to reconcile before merge: this PR changes |
What this changes
For
block_buffer(crates.io),affected[0].ranges[0].events[0].introducedmoves from"0"to"0.11.0-pre". The"fixed": "0.12.1"event is unchanged, so this only narrows the lower bound.Why
The advisory's impact depends on the cursor position living inside the block that caller-provided callbacks can reach:
EagerBufferkeeps its cursor in the last byte of the internal block, andReadBufferkeeps it inbuffer[0]. Neither the inline cursor nor theReadBuffertype exists in the 0.10.x line.0.10.4 stores the cursor in a separate field (https://docs.rs/crate/block-buffer/0.10.4/source/src/lib.rs):
pub struct BlockBuffer<BlockSize, Kind> { buffer: Block<BlockSize>, pos: u8, _pd: PhantomData<Kind> }(lines 55-64).set_pos_uncheckedwrites onlyself.pos(lines 236-240), and every call site derives the value internally.digest_blocksgives the callback an immutable&Blockreference to the internal buffer (line 165) or block slices derived from the caller's input;posis only updated after the callbacks return (line 175).digest_padpasses&self.bufferimmutably and resets afterwards (lines 307-315). Inset_data,process_blocksreceives the caller's data blocks, not the internal cursor (line 271).posat its previous, valid value: no callback path can overwrite the cursor from input.The separate
posfield is also present in the 0.10.0-pre line (https://docs.rs/crate/block-buffer/0.10.0-pre/source/src/lib.rs).The inline layout starts at 0.11.0-pre (published 2022-12-19):
src/lib.rs:pub struct BlockBuffer<BS: BlockSizes, K: BufferKind> { buffer: Block<Self>, pos: K::Pos }, withEager::Pos = ()(https://docs.rs/crate/block-buffer/0.11.0-pre/source/src/lib.rs).src/sealed.rs:Eager::get_posreturnsbuf[buf.len() - 1]andEager::set_poswritesbuf[buf.len() - 1](https://docs.rs/crate/block-buffer/0.11.0-pre/source/src/sealed.rs).src/read.rs:ReadBufferdocuments "The first byte of the block is used as position." (https://docs.rs/crate/block-buffer/0.11.0-pre/source/src/read.rs).Eager::get_pos/Eager::set_poson the last byte of the block (https://docs.rs/crate/block-buffer/0.11.0/source/src/sealed.rs), so 0.11.0 remains covered by this range.ResetGuardaround the callback calls inBlockBufferandReadBuffer, and its changelog entry is "0.12.1 — Fixed: Exception safety bug".So the affected mechanism first appears in
0.11.0-pre, and"introduced": "0"additionally flags 0.10.x and earlier, which have no inline cursor and noReadBuffer.Scope
Versions
0.11.0-prethrough0.12.0remain affected. This PR does not claim that 0.10.x is free of unrelated issues; it only states that the cursor-corruption path described in this advisory cannot occur there because the cursor is not stored in the block.