CVE-2026-45137
### Summary 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. ### Details 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. https://github.com/solana-foundation/anchor/blob/5ff3f96eeda91cc54b7fa525631eb8c1394fda04/lang/src/accounts/program.rs#L148-L163 ### PoC Build and deploy the following anchor program: ```rs /// victim.rs /// an anchor program that uses the system program in some way. use anchor_lang::prelude::*; use anchor_lang::prelude::program::invoke; use anchor_lang::prelude::instruction::Instruction; #[derive(Accounts)] pub struct Initialize<'info> { #[account(mut)] pub sender: Signer<'info>, #[account(mut)] pub recipient: SystemAccount<'info>, // the "System" part here should ensure that callers can only pass the system program. pub system_program: Program<'info, System>, } pub fn handler(ctx: Context<Initialize>, amount: u64) -> Result<()> { // this should be the system program id, but due to an issue in the validation logic, this could be any program id. msg!("System progra
Properties
- severity
- high
- summary
- Anchor: Program<'info, System> is not properly validated
- epss_score
- 0.00246
- cvss_score
- 8.2
- ghsa_published
- 2026-05-13T15:31:49Z
- source_url
- https://github.com/advisories/GHSA-c6rc-8jpp-2fgc
- ghsa_updated
- 2026-05-19T16:08:42Z
- ghsa_id
- GHSA-c6rc-8jpp-2fgc
- cve_id
- CVE-2026-45137
- cvss_vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N
- is_ghsa_only
- false
- epss_percentile
- 0.15954
Related Entities (5)
ENRICHED_BY (1)
VULNERABLE_TO (1)
AFFECTS (1)
HAS_WEAKNESS (1)
REPORTED_BY (1)
Explore deeper with Ninja Signal's threat intelligence graph