GHSA-429q-fhh4-r6hj: Anchor `InterfaceAccount` Allows Account Substitution Between Vulnerability

HIGH
CWE-20
Published
Advisory Summary

GHSA-429q-fhh4-r6hj is a HIGH `interfaceaccount` allows account substitution between vulnerability (CWE-20: Improper Input Validation) affecting Anchor libraries in the crates.io ecosystem. The issue involves `interfaceaccount` allows account substitution between unexpected types. Remediation is available by upgrading affected packages to version 1.0.0-rc.2.

GHSA-429q-fhh4-r6hj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-429q-fhh4-r6hj
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Anchor
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-429q-fhh4-r6hj

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

anchor-lang fixed: 1.0.0-rc.2
Upgrade anchor-lang to 1.0.0-rc.2
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 anchor-lang

How to Check if You Are Affected

To determine whether your application is affected by GHSA-429q-fhh4-r6hj, inspect your project dependencies for Anchor:

inspect dependencies for anchor-lang

Analyze the terminal output to locate any version of Anchor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.0-rc.2), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Anchor, 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

### Impact Any uses of `InterfaceAccount` allows another unexpected account type to be passed, after https://github.com/solana-foundation/anchor/pull/3837 disabled discriminator checking for this type. The bug was originally reported and fixed in https://github.com/solana-foundation/anchor/pull/4139, see that PR for more details. ### Patches https://github.com/solana-foundation/anchor/pull/4139 patched the issue and was released in `1.0.0-rc.2`. Users should upgrade to the latest released version of Anchor 1.0. ### References Bug landed in: https://github.com/solana-foundation/anchor/pull/3837 Bug fixed in: https://github.com/solana-foundation/anchor/pull/4139

GHSA-429q-fhh4-r6hj Affected Anchor Versions

1 component(s)
Fixed Versions:
1.0.0-rc.2
Product / Package Ecosystem Affected Versions Fixed Version
anchor-lang
crates.io
≥ 1.0.0-rc.1
< 1.0.0-rc.2
All 1 versions
1.0.0-rc.1
1.0.0-rc.2

References

Frequently Asked Questions

What is GHSA-429q-fhh4-r6hj?
GHSA-429q-fhh4-r6hj is a security vulnerability in Anchor involving `InterfaceAccount` allows account substitution between unexpected types under CWE-20: Improper Input Validation.
Which Anchor versions are affected?
Affected versions include releases prior to 1.0.0-rc.2 across affected packages: anchor-lang.
What version fixes GHSA-429q-fhh4-r6hj?
Upgrading to 1.0.0-rc.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is anchor-lang affected?
Yes, anchor-lang is affected in releases prior to 1.0.0-rc.2. Upgrade your dependency to 1.0.0-rc.2 or later.
What CWE is associated with GHSA-429q-fhh4-r6hj?
GHSA-429q-fhh4-r6hj is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check crates.io dependencies for GHSA-429q-fhh4-r6hj?
Run the dependency tree command: 'inspect dependencies for anchor-lang'. 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-429q-fhh4-r6hj",
  "modified" : "2026-05-19T20:18:35Z",
  "published" : "2026-05-13T15:33:46Z",
  "aliases" : [ ],
  "summary" : "Anchor: `InterfaceAccount` allows account substitution between unexpected types",
  "details" : "### Impact\nAny uses of `InterfaceAccount` allows another unexpected account type to be passed, after https://github.com/solana-foundation/anchor/pull/3837 disabled discriminator checking for this type.\n\nThe bug was originally reported and fixed in https://github.com/solana-foundation/anchor/pull/4139, see that PR for more details.\n\n### Patches\nhttps://github.com/solana-foundation/anchor/pull/4139 patched the issue and was released in `1.0.0-rc.2`. Users should upgrade to the latest released version of Anchor 1.0.\n\n### References\nBug landed in: https://github.com/solana-foundation/anchor/pull/3837\nBug fixed in: https://github.com/solana-foundation/anchor/pull/4139",
  "severity" : [ {
    "type" : "CVSS_V4",
    "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "anchor-lang"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0-rc.1"
      }, {
        "fixed" : "1.0.0-rc.2"
      } ]
    } ],
    "versions" : [ "1.0.0-rc.1" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/otter-sec/anchor/security/advisories/GHSA-429q-fhh4-r6hj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solana-foundation/anchor/security/advisories/GHSA-429q-fhh4-r6hj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solana-foundation/anchor/pull/3837"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solana-foundation/anchor/pull/4139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/solana-foundation/anchor/commit/26ef36968a62e28a1f028e7adae4806af30c747d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/solana-foundation/anchor"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2026-0146.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-13T15:33:46Z",
    "nvd_published_at" : null
  }
}