rustsec-2026-0146
Vulnerability from osv_rustsec
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.
{
"affected": [
{
"database_specific": {
"categories": [],
"cvss": "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",
"informational": null
},
"ecosystem_specific": {
"affected_functions": null,
"affects": {
"arch": [],
"functions": [],
"os": []
}
},
"package": {
"ecosystem": "crates.io",
"name": "anchor-lang",
"purl": "pkg:cargo/anchor-lang"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0-rc.1"
},
{
"fixed": "1.0.0-rc.2"
}
],
"type": "SEMVER"
}
],
"versions": []
}
],
"aliases": [
"GHSA-429q-fhh4-r6hj"
],
"database_specific": {
"license": "CC-BY-4.0"
},
"details": "Affected versions of `anchor-lang` allowed `InterfaceAccount` to accept accounts\nwith an unexpected Anchor discriminator. A change to `InterfaceAccount` caused\nchecked deserialization to be bypassed for this account wrapper, so validation\nproved only that the account owner matched one of the accepted interface owners.\nIt did not prove that the account data belonged to the expected account type.\n\nPrograms using `InterfaceAccount` rely on Anchor to enforce both owner and\naccount-type validation before the handler runs. With discriminator checking\ndisabled, an attacker could pass another account type owned by an accepted\nprogram and have it deserialized through the expected interface wrapper. This\ncould bypass account-type assumptions made by the program and lead to incorrect\nauthorization or state handling.\n\nThe issue was fixed in `anchor-lang` 1.0.0-rc.2 by restoring checked\ndeserialization for `InterfaceAccount::try_from`, while keeping explicitly\nunchecked behavior available only through the unchecked API. Users should\nupgrade to `anchor-lang` 1.0.0-rc.2 or later.",
"id": "RUSTSEC-2026-0146",
"modified": "2026-05-19T04:53:18Z",
"published": "2026-05-08T12:00:00Z",
"references": [
{
"type": "PACKAGE",
"url": "https://crates.io/crates/anchor-lang"
},
{
"type": "ADVISORY",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0146.html"
},
{
"type": "ADVISORY",
"url": "https://github.com/otter-sec/anchor/security/advisories/GHSA-429q-fhh4-r6hj"
},
{
"type": "WEB",
"url": "https://github.com/otter-sec/anchor/pull/3837"
},
{
"type": "WEB",
"url": "https://github.com/otter-sec/anchor/pull/4139"
},
{
"type": "WEB",
"url": "https://github.com/otter-sec/anchor/commit/26ef36968a62e28a1f028e7adae4806af30c747d"
}
],
"related": [],
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "`InterfaceAccount` allows account substitution between unexpected types"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.