{"id":"RUSTSEC-2026-0411","revision":"59c952003b6a4cfe8475283287385545","records":[{"revision":"59c952003b6a4cfe8475283287385545","observedAt":"2026-10-26T14:35:44.727+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0411","aliases":[],"title":"Out-of-bounds read in `Log2Cache::nlog2n()`, `nlog2n_difference()` and `plog2p()`","description":"`Log2Cache::new(n)` fills its three tables with entries for `0..=n`, but the\nthree accessor methods index those tables with `get_unchecked` on a value the\ncaller supplies. Nothing bounds the argument and nothing documents a bound, so\nany value above the `n` the cache was built with reads past the end of the\nvector. `CountType` is `u32`, so the read can land up to `u32::MAX` elements\naway, and `plog2p()` returns the value it read, disclosing whatever lies there.\n\nFor example, `Log2Cache::new(4)` builds tables holding 5 entries (indices\n0,1,2,3,4). Then `cache.nlog2n(60000)` reads index 60000, far outside the\nallocation. Under AddressSanitizer this faults with `SEGV`; Miri reports it as\nundefined behavior at `src/log2cache.rs:42`.\n\n`nlog2n_difference()` is off by one further: in the affected versions `new(n)`\npushes `n` entries into that table rather than `n + 1`, so even\n`nlog2n_difference(n)` is out of bounds.\n\nThis can be triggered through safe public APIs — `Log2Cache::new()` and any of\n`nlog2n()`, `nlog2n_difference()` and `plog2p()` — with no `unsafe` required\nfrom the caller.","state":0,"publishedAt":"2026-10-22T12:00:00+00:00","modifiedAt":"2026-10-26T14:00:05.0919044+00:00","affected":[{"ecosystem":"crates.io","name":"dahl-salso","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.0.0-0"},{"kind":"fixed","version":"0.7.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/dahl-salso","https://rustsec.org/advisories/RUSTSEC-2026-0411.html","https://github.com/dbdahl/rust-dahl-salso/issues/2"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0411","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0411","identifiers":["RUSTSEC-2026-0411"]},"retained":false,"historicalAffected":[]}],"coverage":[]}