Vulnerability HighRUSTSEC-2026-0146 · anchor-lang
RUSTSEC-2026-0146: `InterfaceAccount` allows account substitution between unexpected types
Short answerA security vulnerability in the anchor-lang crate: `InterfaceAccount` allows account substitution between unexpected types. GitHub rates it High. Fixed in 1.0.0-rc.2: update to a fixed version.
| Crate | anchor-lang |
|---|---|
| Type | Vulnerability |
| Affected versions | From 1.0.0-rc.1 before 1.0.0-rc.2. |
| Fixed in | 1.0.0-rc.2 |
| Severity | High (GitHub rating) CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N |
| Published | 2026-05-08 |
| Last changed | 2026-10-12 |
| Also known as | GHSA-429q-fhh4-r6hj |
What to do
- See which version you have:
cargo tree -i anchor-lang(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p anchor-lang. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleanchor-lang = "1.0.0-rc.2") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Affected versions of anchor-lang allowed InterfaceAccount to accept accounts with an unexpected Anchor discriminator. A change to InterfaceAccount caused checked deserialization to be bypassed for this account wrapper, so validation proved only that the account owner matched one of the accepted interface owners. It did not prove that the account data belonged to the expected account type.
Programs using InterfaceAccount rely on Anchor to enforce both owner and account-type validation before the handler runs. With discriminator checking disabled, an attacker could pass another account type owned by an accepted program and have it deserialized through the expected interface wrapper. This could bypass account-type assumptions made by the program and lead to incorrect authorization or state handling.
The issue was fixed in anchor-lang 1.0.0-rc.2 by restoring checked deserialization for InterfaceAccount::try_from, while keeping explicitly unchecked behavior available only through the unchecked API. Users should upgrade to anchor-lang 1.0.0-rc.2 or later.
References
- Package: crates.io/crates/anchor-lang
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0146.html
- Web: github.com/solana-foundation/anchor/pull/3837
- Web: github.com/otter-sec/anchor/pull/3837
- Web: github.com/otter-sec/anchor/pull/4139
- Web: github.com/otter-sec/anchor/commit/26ef36968a62e28a1f028e7adae4806af30c747d
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for anchor-lang
Up next
Same crateanchor-lang: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?