{"id":"RUSTSEC-2026-0411","aliases":["RUSTSEC-2026-0411"],"related":[],"kind":"vulnerability","state":"published","title":"Out-of-bounds read in `Log2Cache::nlog2n()`, `nlog2n_difference()` and `plog2p()`","summary":"`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.","summaryFormat":"markdown","summarySource":"rustsec","descriptions":[{"lang":"en","text":"`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.","format":"markdown","source":"rustsec"}],"published":"2026-10-22T12:00:00.000Z","modified":"2026-10-26T14:00:05.091Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.7.0"}],"ecosystem":"crates.io","package":"dahl-salso","purl":"pkg:cargo/dahl-salso","source":"rustsec"}],"references":[{"url":"https://crates.io/crates/dahl-salso","tags":["package"],"sources":["rustsec"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0411.html","tags":["advisory"],"sources":["rustsec"]},{"url":"https://github.com/dbdahl/rust-dahl-salso/issues/2","tags":["report"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0411","url":"https://rustsec.org/advisories/RUSTSEC-2026-0411.html","licence":"CC0-1.0","modified":"2026-10-26T14:00:05.091Z"}],"updatedAt":"2026-11-25T22:56:43.455Z"}