GHSA-rhfx-m35p-ff5j: Lru `IterMut` Violates Stacked Borrows By Vulnerability

LOW
CWE-476
Published
Advisory Summary

GHSA-rhfx-m35p-ff5j is a LOW `itermut` violates stacked borrows by vulnerability (CWE-476: NULL Pointer Dereference) affecting Lru libraries in the crates.io ecosystem. The issue involves `itermut` violates stacked borrows by invalidating internal pointer. Remediation is available by upgrading affected packages to version 0.16.3.

GHSA-rhfx-m35p-ff5j at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rhfx-m35p-ff5j
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-476: NULL Pointer Dereference
Affected Product Lru
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-rhfx-m35p-ff5j

To remediate this vulnerability, upgrade all affected Lru dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lru fixed: 0.16.3
Upgrade lru to 0.16.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for lru

How to Check if You Are Affected

To determine whether your application is affected by GHSA-rhfx-m35p-ff5j, inspect your project dependencies for Lru:

inspect dependencies for lru

Analyze the terminal output to locate any version of Lru in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.16.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-476: NULL Pointer Dereference, where the product dereferences a pointer that it expects to be valid but is null. In Lru, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Affected versions of this crate contain a soundness issue in the `IterMut` iterator implementation. The `IterMut::next` and `IterMut::next_back` methods temporarily create an exclusive reference to the key when dereferencing the internal node pointer. This invalidates the shared pointer held by the internal `HashMap`, violating Stacked Borrows rules.

GHSA-rhfx-m35p-ff5j Affected Lru Versions

1 component(s)
Fixed Versions:
0.16.3
Product / Package Ecosystem Affected Versions Fixed Version
lru
crates.io
≥ 0.9.0
< 0.16.3
0.16.3

References

Frequently Asked Questions

What is GHSA-rhfx-m35p-ff5j?
GHSA-rhfx-m35p-ff5j is a security vulnerability in Lru involving `IterMut` violates Stacked Borrows by invalidating internal pointer under CWE-476: NULL Pointer Dereference.
Which Lru versions are affected?
Affected versions include releases prior to 0.16.3 across affected packages: lru.
What version fixes GHSA-rhfx-m35p-ff5j?
Upgrading to 0.16.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is lru affected?
Yes, lru is affected in releases prior to 0.16.3. Upgrade your dependency to 0.16.3 or later.
What CWE is associated with GHSA-rhfx-m35p-ff5j?
GHSA-rhfx-m35p-ff5j is classified under CWE-476: NULL Pointer Dereference (The product dereferences a pointer that it expects to be valid but is NULL.).
How can I check crates.io dependencies for GHSA-rhfx-m35p-ff5j?
Run the dependency tree command: 'inspect dependencies for lru'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rhfx-m35p-ff5j",
  "modified" : "2026-01-07T20:38:57Z",
  "published" : "2026-01-07T20:38:57Z",
  "aliases" : [ ],
  "summary" : "`IterMut` violates Stacked Borrows by invalidating internal pointer",
  "details" : "Affected versions of this crate contain a soundness issue in the `IterMut` iterator implementation. The `IterMut::next` and `IterMut::next_back` methods temporarily create an exclusive reference to the key when dereferencing the internal node pointer.\n\nThis invalidates the shared pointer held by the internal `HashMap`, violating Stacked Borrows rules.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:U"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lru"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.0"
      }, {
        "fixed" : "0.16.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jeromefroe/lru-rs/pull/224"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jeromefroe/lru-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0002.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-07T20:38:57Z",
    "nvd_published_at" : null
  }
}