{"id":"RUSTSEC-2026-0411","summary":"Out-of-bounds read in `Log2Cache::nlog2n()`, `nlog2n_difference()` and `plog2p()`","details":"`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.","modified":"2026-10-26T14:00:05.091904359Z","published":"2026-10-22T12:00:00Z","database_specific":{"license":"CC0-1.0"},"references":[{"type":"PACKAGE","url":"https://crates.io/crates/dahl-salso"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0411.html"},{"type":"REPORT","url":"https://github.com/dbdahl/rust-dahl-salso/issues/2"}],"affected":[{"package":{"name":"dahl-salso","ecosystem":"crates.io","purl":"pkg:cargo/dahl-salso"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"},{"fixed":"0.7.0"}]}],"ecosystem_specific":{"affected_functions":null,"affects":{"functions":[],"arch":[],"os":[]}},"database_specific":{"categories":["memory-corruption","memory-exposure"],"cvss":null,"informational":"unsound","source":"https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0411.json"}}],"schema_version":"1.9.0"}