Use-after-free in interned values and cached function results
When an application reads an interned value's fields or uses that value as an input to a tracked function, Salsa must ensure that reusable storage has been validated for the current database revision. This prevents the value's fields and associated cached function results from being freed while in use. Affected versions checked this invariant only with `debug_assert!` when reading fields, and did not check it when using an interned value to access a tracked function's cached result. Bugs in Salsa's dependency tracking, or an application-provided `Eq` implementation that incorrectly treats a changed query result as unchanged, can cause Salsa to reuse cached results containing stale interned values. If the application accesses these values and then interns additional values, Salsa can free the old fields or cached function results while references to them are still in use. This causes use-after-free through safe Rust APIs. Depending on the consuming application, attacker-controlled input may expose process memory or permit arbitrary code execution. The fix asserts that an interned value's reusable storage has been validated for the current database revision before allowing an application to read its fields or access a tracked function's cached result using that value as input. If the assertion fails, Salsa panics before returning references to storage that could be freed while in use. Salsa 0.28.5 and newer address this vulnerability. Dependent applications should update Salsa
RUSTSEC-2026-0308
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:RUSTSEC-2026-0308
salsa
Source reference: /affected/0/package/name
- Affected versions
- Not stated in this record
- Fixed versions
- 0.28.5
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.23.0"
},
{
"fixed": "0.28.5"
}
]
}
],
"package": {
"name": "salsa",
"purl": "pkg:cargo/salsa",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": null,
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0308.json",
"categories": [
"memory-corruption",
"memory-exposure",
"code-execution"
],
"informational": "unsound"
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
]Publisher severity
No explicit severity was provided.
- Event
- #13809 · Revision 1
- Added to Heist Feed
- Publisher date