<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Anchor-Lang — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/anchor-lang/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 13 May 2026 15:37:02 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/anchor-lang/feed.xml" rel="self" type="application/rss+xml"/><item><title>Anchor Program Validation Bypass Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-05-anchor-program-validation-bypass/</link><pubDate>Wed, 13 May 2026 15:37:02 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-anchor-program-validation-bypass/</guid><description>A logic error in anchor-lang versions 1.0.0 to 1.0.1 causes anchor programs to accept any program ID when requiring the system program ID, resulting in false assumptions that could lead to arbitrary CPI in programs invoking system program instructions, potentially leading to validation bypass and unauthorized account control.</description><content:encoded><![CDATA[<p>Anchor is a framework for building Solana programs. A validation vulnerability exists in anchor-lang versions 1.0.0 and 1.0.1 where programs built with anchor incorrectly validate the <code>system_program</code> account. Specifically, the <code>TryFrom</code> implementation for <code>Program&lt;'a, T&gt;</code> compares the ID of T with <code>Pubkey::default()</code> to check whether anchor should allow any executable account or a specific account. Due to this logic, both <code>T = ()</code> and <code>T = System</code> exhibit the same behavior, allowing any executable account. This flaw allows attackers to pass arbitrary program IDs instead of the system program ID, causing false assumptions and enabling potential CPI and payment bypasses.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies a vulnerable Anchor program (version 1.0.0 or 1.0.1) that uses the <code>Program&lt;'info, System&gt;</code> type to ensure a valid system program account.</li>
<li>The attacker crafts a malicious transaction, replacing the expected system program ID with the ID of a program they control (e.g., the Compute Budget program, or a custom program).</li>
<li>The vulnerable program&rsquo;s <code>Initialize</code> function receives the attacker-provided program ID as the <code>system_program</code> account.</li>
<li>Due to the flawed validation logic, the Anchor runtime incorrectly accepts the attacker-provided program ID as a valid system program.</li>
<li>The vulnerable program constructs a transfer instruction using the (incorrect) attacker-supplied program ID.</li>
<li>The program invokes the transfer instruction, intending to transfer lamports using the system program. However, because the program ID is controlled by the attacker, no transfer occurs, or the transfer is redirected to an attacker-controlled program based on the malicious program logic.</li>
<li>The vulnerable program proceeds under the false assumption that the transfer has succeeded, potentially leading to incorrect state updates.</li>
<li>The attacker bypasses intended restrictions and potentially gains control of accounts meant to be owned by the system program, or blocks transfers.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability impacts on-chain programs that depend on the system program, potentially leading to CPI bypasses and unauthorized payment diversions. This could result in financial losses and compromised program functionality. The vulnerability affects programs using <code>rust/anchor-lang</code> in versions 1.0.0 and 1.0.1. The severity of the vulnerability is rated as high due to the potential for significant financial impact and unauthorized account control.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade <code>rust/anchor-lang</code> to version 1.0.2 or later to remediate the vulnerability.</li>
<li>Deploy the provided Sigma rule <code>Detect Anchor Program ID Validation Bypass</code> to identify potential exploitation attempts targeting the vulnerable validation logic.</li>
<li>Audit existing Anchor programs for improper system program account validation, specifically examining the <code>TryFrom&lt;&amp;'a AccountInfo&lt;'a&gt;&gt;</code> implementation for <code>Program&lt;'a, T&gt;</code>.</li>
<li>Use static analysis tools to detect vulnerable code patterns in Anchor programs that rely on system program interactions.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>anchor</category><category>solana</category><category>account-validation</category><category>cpi-bypass</category></item><item><title>Anchor: InterfaceAccount Allows Account Substitution</title><link>https://feed.craftedsignal.io/briefs/2026-05-anchor-interfaceaccount-substitution/</link><pubDate>Wed, 13 May 2026 15:36:36 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-anchor-interfaceaccount-substitution/</guid><description>The `InterfaceAccount` in `anchor-lang` allows an unexpected account type to be passed due to disabled discriminator checking, patched in version 1.0.0-rc.2 and later.</description><content:encoded><![CDATA[<p>A vulnerability exists within the <code>InterfaceAccount</code> type in the <code>anchor-lang</code> package of the Anchor framework. This flaw allows for the substitution of account types because discriminator checking was unintentionally disabled in pull request #3837. An attacker could potentially exploit this by passing an account of an unexpected type, leading to unexpected behavior in Solana programs. The vulnerability affects version 1.0.0-rc.1. The fix was implemented in pull request #4139 and released in <code>1.0.0-rc.2</code>. Users are strongly advised to upgrade to the latest released version of Anchor 1.0 to mitigate this risk. This impacts programs utilizing the Anchor framework on the Solana blockchain.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker identifies a Solana program utilizing <code>InterfaceAccount</code> with Anchor version 1.0.0-rc.1.</li>
<li>The attacker crafts a malicious transaction that attempts to pass an account of an incorrect type to the program via <code>InterfaceAccount</code>.</li>
<li>The program, lacking discriminator checking due to the vulnerability, accepts the incorrect account.</li>
<li>The program attempts to process the provided account based on the expected type.</li>
<li>Due to type mismatch, the program may experience unexpected behavior, such as data corruption.</li>
<li>The attacker leverages the corrupted data to manipulate program logic.</li>
<li>The attacker is able to perform unauthorized actions within the Solana program.</li>
<li>This can lead to financial loss, unauthorized data access, or denial of service for other users.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability allows attackers to substitute account types in Solana programs using the Anchor framework&rsquo;s <code>InterfaceAccount</code>, potentially leading to data corruption and unauthorized actions.  This impacts any Solana program using the vulnerable <code>InterfaceAccount</code> in <code>anchor-lang</code> version 1.0.0-rc.1. Successful exploitation could result in financial loss, data breaches, or denial-of-service for users of the affected Solana programs.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to the latest released version of Anchor 1.0 (&gt;= 1.0.0-rc.2) as described in the advisory to patch the vulnerable <code>InterfaceAccount</code> type.</li>
<li>Examine your Solana programs for uses of <code>InterfaceAccount</code> in conjunction with <code>anchor-lang</code> 1.0.0-rc.1 and prioritize patching these programs.</li>
<li>Monitor Solana program activity for unexpected account interactions and type mismatches as a potential indicator of exploitation.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>anchor</category><category>solana</category><category>interfaceaccount</category><category>account-substitution</category></item></channel></rss>