CVE-2026-45137: CWE-20: Improper Input Validation in solana-foundation anchor
Anchor is a framework providing several convenient developer tools for writing Solana programs. From 1.0.0 to before 1.0.2, an logic error causes anchor programs to accept any program id when requiring the system program id, causing false assumptions resulting in potential arbitrary cpi in programs that invoke system program instructions. In the TryFrom<&'a AccountInfo<'a>> implementation for Program<'a, T>, the id of T is compared with Pubkey::default() to check whether anchor should allow any executable account, or a specific account, because when no T is supplied, T defaults to (), which implements Id::id() by returning Pubkey::default(). This results in T = () and T = System (which has Pubkey::default() as the id) having the same behavior, both allow any executable account. Programs built with anchor assume that the anchor runtime verifies passed in programs of type Program<'a, System> are in fact the system program. This false assumption can lead to arbitrary CPI or payment bypassing when programs try making CPI calls to the system program using the passed in system program due to the fact that the attacker can pass in any program instead of the system program. This vulnerability is fixed in 1.0.2.
AI Analysis
Technical Summary
Anchor framework versions from 1.0.0 up to but not including 1.0.2 contain a logic error in the TryFrom<&'a AccountInfo<'a>> implementation for Program<'a, T>. The code compares the ID of T with Pubkey::default() to decide whether to allow any executable account or a specific one. Because T defaults to () which returns Pubkey::default(), both T = () and T = System (which also uses Pubkey::default()) behave identically, allowing any executable account to be accepted when the system program ID is expected. This leads to a false assumption that the passed program is the system program, enabling attackers to pass arbitrary programs and potentially perform unauthorized CPI calls or payment bypasses. The vulnerability is addressed in Anchor 1.0.2.
Potential Impact
The vulnerability allows an attacker to bypass the intended verification of the system program ID in Anchor programs, potentially enabling arbitrary cross-program invocations or payment bypasses. This could lead to unauthorized actions within Solana programs that rely on Anchor for system program calls. The CVSS score of 8.2 reflects a high impact with low attack complexity and no required privileges or user interaction. There are no known exploits in the wild at this time.
Mitigation Recommendations
Anchor users should upgrade to version 1.0.2 or later, where this vulnerability is fixed. Since the vendor advisory does not explicitly state the patch availability beyond the fix in 1.0.2, users should verify with the official solana-foundation channels for the latest remediation guidance. Programs built on affected versions should be reviewed for potential misuse of system program IDs and updated accordingly.
CVE-2026-45137: CWE-20: Improper Input Validation in solana-foundation anchor
Description
Anchor is a framework providing several convenient developer tools for writing Solana programs. From 1.0.0 to before 1.0.2, an logic error causes anchor programs to accept any program id when requiring the system program id, causing false assumptions resulting in potential arbitrary cpi in programs that invoke system program instructions. In the TryFrom<&'a AccountInfo<'a>> implementation for Program<'a, T>, the id of T is compared with Pubkey::default() to check whether anchor should allow any executable account, or a specific account, because when no T is supplied, T defaults to (), which implements Id::id() by returning Pubkey::default(). This results in T = () and T = System (which has Pubkey::default() as the id) having the same behavior, both allow any executable account. Programs built with anchor assume that the anchor runtime verifies passed in programs of type Program<'a, System> are in fact the system program. This false assumption can lead to arbitrary CPI or payment bypassing when programs try making CPI calls to the system program using the passed in system program due to the fact that the attacker can pass in any program instead of the system program. This vulnerability is fixed in 1.0.2.
CVSS v3.1
Score 8.2high
Affected software
pkg:cargo/solana-foundation/anchorRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Anchor framework versions from 1.0.0 up to but not including 1.0.2 contain a logic error in the TryFrom<&'a AccountInfo<'a>> implementation for Program<'a, T>. The code compares the ID of T with Pubkey::default() to decide whether to allow any executable account or a specific one. Because T defaults to () which returns Pubkey::default(), both T = () and T = System (which also uses Pubkey::default()) behave identically, allowing any executable account to be accepted when the system program ID is expected. This leads to a false assumption that the passed program is the system program, enabling attackers to pass arbitrary programs and potentially perform unauthorized CPI calls or payment bypasses. The vulnerability is addressed in Anchor 1.0.2.
Potential Impact
The vulnerability allows an attacker to bypass the intended verification of the system program ID in Anchor programs, potentially enabling arbitrary cross-program invocations or payment bypasses. This could lead to unauthorized actions within Solana programs that rely on Anchor for system program calls. The CVSS score of 8.2 reflects a high impact with low attack complexity and no required privileges or user interaction. There are no known exploits in the wild at this time.
Mitigation Recommendations
Anchor users should upgrade to version 1.0.2 or later, where this vulnerability is fixed. Since the vendor advisory does not explicitly state the patch availability beyond the fix in 1.0.2, users should verify with the official solana-foundation channels for the latest remediation guidance. Programs built on affected versions should be reviewed for potential misuse of system program IDs and updated accordingly.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-08T20:08:17.210Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a175c27e29bf47b50eb609a
Added to database: 05/27/2026, 21:03:35 UTC
Last enriched: 05/27/2026, 21:33:33 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 96
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.