fix(security): bump lru 0.12 -> 0.18.1 (RUSTSEC-2026-0002) and unblind the deny gate - #6
Draft
h4x0r wants to merge 2 commits into
Draft
fix(security): bump lru 0.12 -> 0.18.1 (RUSTSEC-2026-0002) and unblind the deny gate#6h4x0r wants to merge 2 commits into
h4x0r wants to merge 2 commits into
Conversation
…d the deny gate
lru 0.12.5's `IterMut::next`/`next_back` create a temporary exclusive reference
to the key when dereferencing the internal node pointer, invalidating the shared
pointer the internal `HashMap` still holds — a Stacked Borrows violation
(RUSTSEC-2026-0002, `informational = "unsound"`, patched in >= 0.16.3).
ewf-core only calls `LruCache::{new,get,put,iter}`, never `iter_mut()`, so the
unsound path is not reachable from this crate today. The bump is still correct:
nothing structurally prevents a future caller from reaching for `iter_mut`, and
the affected version must not ship in the dependency graph regardless.
The requirement states a minor+patch floor (`0.18.1`) rather than `0.16`, because
a bare `0.16` caret can still resolve 0.16.0-0.16.2, which are affected.
The two fuzz workspaces carry their own lockfiles and were independently pinned
to 0.12.5, so the fuzzers were exercising the unsound version; both are updated.
Unblind the gate that should have caught this
---------------------------------------------
The advisory was in `deny.toml`'s ignore list, so it would have been suppressed
anyway — but it was never even evaluated. cargo-deny 0.19.0 defaults `unsound`
to "workspace", then builds the workspace-member set that scope compares against
ONLY when the unrelated *unmaintained* scope is "workspace"/"transitive"
(src/advisories.rs:77-93). With `unmaintained` at its own "all" default the set
is empty, the membership test at line 120 is always false, and every
`informational = "unsound"` advisory hits `continue` unreported.
Setting `unsound = "all"` takes the unconditional branch at line 111, so it does
not depend on that set and stays correct if upstream fixes the gating.
Verified against cargo-deny 0.19.0 with lru forced back to 0.12.5:
error[unsound]: `IterMut` violates Stacked Borrows by invalidating internal pointer
--> Cargo.lock:75:1
75 | lru 0.12.5 registry+https://github.com/rust-lang/crates.io-index
ID: RUSTSEC-2026-0002
Solution: Upgrade to >=0.16.3
advisories FAILED
and on the fixed tree: `advisories ok, bans ok, licenses ok, sources ok`.
Both ignore entries are deleted rather than re-homed. cargo-deny reported each as
`advisory-not-detected`: RUSTSEC-2026-0002 is fixed by the bump, and `adler`
(RUSTSEC-2025-0056) has left the graph entirely. The prior comment also
misattributed RUSTSEC-2026-0002 to `console`; `console` has no advisory at all.
Gate: build, 483 tests passed, clippy -D warnings, fmt --check, cargo deny check.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The lru 0.12.5 -> 0.18.1 security bump moves hashbrown 0.15.5 -> 0.17.1 and pulls foldhash 0.2.0, so all three fall outside the existing exemptions and cargo-vet fails the release PR until the versions are restated. Exemption, not `certify`: nobody has read these 629 lines of diff, and a certify record asserts that somebody did. Exemption is the truthful mechanism here (the form all 125 of this repo's other third-party entries already take). No trust entry is available — none of the imported google/mozilla/bytecode-alliance/embark audit sets covers these publishers, which is why `cargo vet suggest` offers only a manual diff audit. `cargo vet --locked`: Vetting Succeeded (23 fully audited, 125 exempted). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes RUSTSEC-2026-0002 (
lruIterMutviolates Stacked Borrows) by widening the caret0.12->0.18.1, and fixes thedeny.tomlconfig that made the advisory invisible to CI in the first place.Zero source changes — clean build, 483 tests pass.
The advisory
lru'sIterMut::next/next_backtemporarily create an exclusive reference to the key when dereferencing the internal node pointer, invalidating the shared pointer the internalHashMapstill holds.informational = "unsound",patched = [">= 0.16.3"].Reachability, stated honestly:
ewf-corecalls onlyLruCache::{new, get, put, iter}— neveriter_mut()— so the unsound path is not reachable from this crate as written. The bump is still right: nothing structurally stops a future caller from reaching foriter_mut, and the affected version should not be in the graph.The requirement is
0.18.1, not0.16, because a bare0.16caret can still resolve 0.16.0-0.16.2, which are affected.Both fuzz workspaces carry their own lockfiles and were independently pinned to
lru 0.12.5, so the fuzzers were exercising the unsound version. Both are updated.The gate could not have caught this
The advisory was already in
deny.toml's ignore list — but it was never even evaluated.cargo-deny 0.19.0 defaults
unsoundto"workspace", then builds the workspace-member set that scope compares against only when the unrelatedunmaintainedscope is"workspace"/"transitive"(src/advisories.rs:77-93). Withunmaintainedat its own"all"default, that set is empty, the membership test at line 120 is always false, and everyinformational = "unsound"advisory hitscontinueunreported.Setting
unsound = "all"takes the unconditional branch at line 111 — it does not consult that set at all, so it stays correct if upstream fixes the gating. (Settingunmaintained = "workspace"also works, but only as a side effect of populating the set, and would regress the day the bug is fixed.)Verified empirically against cargo-deny 0.19.0, with the ignore list emptied:
unsoundunmaintainedallnoneworkspacetransitiveallworkspacetransitivenoneProof the gate now fires
Before (caret reverted to
lru = "0.12",unsound = "all"in place):After:
Ignore list emptied, not re-homed
Both entries were reported by cargo-deny as
advisory-not-detected:RUSTSEC-2026-0002— fixed by this bump.RUSTSEC-2025-0056(adler) — has left the dependency graph entirely.The prior comment also misattributed RUSTSEC-2026-0002 to
console, asserting it was "genuinely fixed" by anindicatifbump that resolvedconsole 0.16.4. The advisory is againstlru;consolehas no RustSec advisory at all, and the "phantom console 0.15 CI re-resolution artifact" it described was not the thing being suppressed.Downstream
4n6mountconsumes the publishedewf 0.4.6, whoselru = "0.12"requirement no downstreamcargo updatecan cross. It carries a temporary ignore with an explicit removal condition pointing at this PR (SecurityRonin/4n6mount#11). Once this merges and release-plz publishesewf >= 0.4.8,cargo update -p ewfthere clears it.Verification
cargo build --workspace --all-features·cargo test --workspace --all-features(483 passed, 5 ignored) ·cargo clippy --workspace --all-targets --all-features -- -D warnings·cargo fmt --all --check·cargo deny check🤖 Generated with Claude Code