<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Verichains]]></title><description><![CDATA[Leading finance security firm in APAC. Trusted by top blockchain customers such as Binance, Bullish, Bybit, Galaxy Digital, Polygon, BNB Chain, Aptos, Sui, Kakao, Line Corp, Abu Dhabi Blockchain Center (ADBC), as well as many banks and mobile wallets.]]></description><link>https://blog.verichains.io</link><image><url>https://substackcdn.com/image/fetch/$s_!XZCb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F20abd958-d8c9-49ef-8c21-44117564e63e_1280x1280.png</url><title>Verichains</title><link>https://blog.verichains.io</link></image><generator>Substack</generator><lastBuildDate>Thu, 23 Apr 2026 12:45:13 GMT</lastBuildDate><atom:link href="https://blog.verichains.io/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Verichains]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[info@verichains.io]]></webMaster><itunes:owner><itunes:email><![CDATA[info@verichains.io]]></itunes:email><itunes:name><![CDATA[Verichains]]></itunes:name></itunes:owner><itunes:author><![CDATA[Verichains]]></itunes:author><googleplay:owner><![CDATA[info@verichains.io]]></googleplay:owner><googleplay:email><![CDATA[info@verichains.io]]></googleplay:email><googleplay:author><![CDATA[Verichains]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[How a Missing Bounds Check Led to $237K Exploit on Hyperbridge]]></title><description><![CDATA[On April 13, 2026, an attacker minted 1 billion bridged DOT tokens out of thin air on Ethereum - and dumped them for roughly $237,000 in ETH. The target was Hyperbridge, Polytope Labs&#8217; trust-minimized interoperability protocol connecting Polkadot to EVM chains.]]></description><link>https://blog.verichains.io/p/how-a-missing-bounds-check-led-to</link><guid isPermaLink="false">https://blog.verichains.io/p/how-a-missing-bounds-check-led-to</guid><dc:creator><![CDATA[th13vn]]></dc:creator><pubDate>Thu, 16 Apr 2026 09:51:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!WihU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On April 13, 2026, an attacker minted <strong>1 billion bridged DOT tokens</strong> out of thin air on Ethereum - and dumped them for roughly <strong>$237,000 in ETH</strong>. The target was <strong>Hyperbridge</strong>, Polytope Labs&#8217; trust-minimized interoperability protocol connecting Polkadot to EVM chains. The culprit wasn&#8217;t a complex cryptographic attack or a sophisticated flash loan scheme, but a single missing bounds check in a Merkle Mountain Range (MMR) verification library that allowed completely forged cross-chain messages to pass as legitimate.</p><p>What makes this incident particularly ironic? Just twelve days earlier, on April 1, Hyperbridge had published a satirical post joking about suffering a catastrophic exploit - boasting their protocol was &#8220;un-hackable.&#8221; Reality had other plans.</p><ul><li><p><strong>Date:</strong> April 13, 2026, 03:39 &#8211; 05:08 UTC</p></li><li><p><strong>Protocol:</strong> Hyperbridge / ISMP Token Gateway (Ethereum)</p></li><li><p><strong>Loss:</strong> ~$237,000 (108.2 ETH)</p></li><li><p><strong>Root Cause:</strong> Missing <code>leaf_index &lt; leafCount</code> bounds check in MMR proof verification</p></li><li><p><strong>Attacker:</strong> <code>0xC513E4f5D7a93A1Dd5B7C4D9f6cC2F52d2F1F8E7</code></p></li><li><p><strong>Tokens Affected:</strong> DOT (1B), ARGN (999B), MANTA (211K), CERE (23B)</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WihU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WihU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 424w, https://substackcdn.com/image/fetch/$s_!WihU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 848w, https://substackcdn.com/image/fetch/$s_!WihU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 1272w, https://substackcdn.com/image/fetch/$s_!WihU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WihU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png" width="1456" height="534" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:534,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:550924,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/194386206?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WihU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 424w, https://substackcdn.com/image/fetch/$s_!WihU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 848w, https://substackcdn.com/image/fetch/$s_!WihU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 1272w, https://substackcdn.com/image/fetch/$s_!WihU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7cfbea8-aed8-4b55-b150-03b7f95a2748_2806x1030.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">One of attacker transactions</figcaption></figure></div><h2><strong>Background</strong></h2><p><strong>Hyperbridge</strong> is a cross-chain interoperability layer built by Polytope Labs that connects Polkadot to EVM-compatible chains like Ethereum. It uses the <strong>Interoperable State Machine Protocol (ISMP)</strong> to relay messages between chains, with smart contracts on Ethereum responsible for verifying cross-chain state proofs and dispatching actions like token minting and transfers.</p><p>The bridge&#8217;s security model relies on <strong>Merkle Mountain Range (MMR) proofs</strong> - a data structure used in Polkadot&#8217;s consensus - to verify that incoming cross-chain messages are legitimate. The <code>HandlerV1</code> contract processes these messages: it fetches a committed Merkle root, validates message inclusion against that root, and if verification passes, dispatches the requested action.</p><p>The critical assumption? That the MMR verification library would reject any message not genuinely included in the Merkle tree. That assumption was wrong.</p><h2><strong>Root Cause</strong></h2><p>The vulnerability lies in the <code>CalculateRoot</code> function of the <code>MerkleMountainRange</code> library - a shared Solidity dependency maintained by Polytope Labs for verifying MMR proofs.</p><p>The function has a special early-exit path for single-leaf trees:</p><pre><code><code>// MerkleMountainRange.sol - CalculateRoot function
// https://github.com/polytope-labs/solidity-merkle-trees

function CalculateRoot(
    bytes32[] memory proof,
    MmrLeaf[] memory leaves,
    uint256 leafCount
) internal pure returns (bytes32) {
    // special handle the only 1 leaf MMR
    if (leafCount == 1 &amp;&amp; leaves.length == 1 &amp;&amp; leaves[0].leaf_index == 0) {
        return leaves[0].hash;  // &lt;-- Returns the actual leaf hash
    }
    // ... general computation path follows ...
}
</code></code></pre><p>When <code>leafCount = 1</code> and <code>leaf_index = 0</code>, the function returns <code>leaves[0].hash</code> - the actual commitment from the cross-chain message. This is the correct behavior.</p><p><strong>Here&#8217;s where it gets interesting.</strong> When the attacker set <code>leaf_index = 1</code> - an out-of-bounds index for a tree with only one leaf (<code>leafCount = 1</code>) - the early-exit condition fails because <code>leaves[0].leaf_index == 0</code> is no longer true. The function falls through to the general computation path:</p><pre><code><code>for (uint256 p; p &lt; length; ) {
    uint256 height = subtrees[p];
    current_subtree += 2 ** height;

    LeafIterator memory subtreeLeaves = getSubtreeLeaves(
        leaves, leafIter, current_subtree
    );

    if (subtreeLeaves.length == 0) {
        // No leaves in this subtree - take next proof element
        if (proofIter.data.length == proofIter.offset) {
            break;
        } else {
            push(peakRoots, next(proofIter));  // &lt;-- proof[0] goes directly into peakRoots!
        }
    } else if (subtreeLeaves.length == 1 &amp;&amp; height == 0) {
        push(peakRoots, leaves[subtreeLeaves.offset].hash);
    } else {
        push(peakRoots, CalculateSubtreeRoot(leaves, subtreeLeaves, proofIter, height));
    }
    unchecked { ++p; }
}
</code></code></pre><p>Since <code>leaf_index = 1</code> is out of range, <code>getSubtreeLeaves</code> finds zero leaves matching the subtree. The code enters the <code>subtreeLeaves.length == 0</code> branch and pushes <code>proof[0]</code> directly into <code>peakRoots</code>. After the peak-bagging loop, <code>peakRoots.data[0]</code> is returned as the computed root.</p><p><strong>The result:</strong> <code>CalculateRoot</code> returns <code>proof[0]</code>. The attacker simply sets <code>proof[0]</code> equal to the expected overlay root. The &#8220;computed root&#8221; matches the &#8220;expected root&#8221; - verification passes. The actual leaf hash - the attacker&#8217;s forged message commitment - <strong>is never used in the calculation at all</strong>.</p><h2><strong>Step-by-Step: The Attack</strong></h2><p>The attacker executed a series of transactions between 03:39 and 05:08 UTC, systematically exploiting the vulnerability across multiple bridged tokens:</p><ol><li><p><strong>Test Run</strong> - At 03:39 UTC, the attacker deployed a contract and executed a small test transaction involving DAI (~$423), probing the exploit path (<a href="https://etherscan.io/tx/0xfa23fb22cc8ff10518e561817dea838d3232f7573fd90bd81fd7a30a9161b6f6">tx </a><code>0xfa23fb22...</code>)</p></li><li><p><strong>ARGN Token Mint</strong> - At 04:20 UTC, the attacker minted <strong>~1 billion ARGN tokens</strong>, routing them through Uniswap V3 and Odos Router V3, netting approximately <strong>1.75 ETH</strong> (<a href="https://etherscan.io/tx/0xb28ab9526e1538bdb7a26ec8485d055f9e417620c72a2f4de0f42234b5f8ac09">tx </a><code>0xb28ab952...</code>)</p></li><li><p><strong>DOT Probe</strong> - At 04:26 UTC, the attacker minted <strong>10,000 DOT</strong> in a smaller test, extracting ~0.02 ETH. This transaction had partial execution revert issues, suggesting the attacker was calibrating parameters (<a href="https://etherscan.io/tx/0xb80c7d4cde034689eb9aa42f0d28aa01d12e233e3805a7c8888ed871b7443c3a">tx </a><code>0xb80c7d4c...</code>)</p></li><li><p><strong>Main DOT Dump</strong> - At 04:33 UTC, the attacker minted <strong>1,000,000 DOT</strong> (~$1,260,000 in nominal value) and swapped them through Uniswap V4 and Odos Router, extracting approximately <strong>0.387 ETH</strong> (<a href="https://etherscan.io/tx/0x743f4bdb67df7e6db57346e557f94ded8d7f85e854040963b7f345545e227125">tx </a><code>0x743f4bdb...</code>)</p></li><li><p><strong>Continued Extraction</strong> - At 04:51 UTC, another <strong>712,403 DOT</strong> were minted and dumped through Uniswap V4, with diminishing returns as liquidity pools dried up (<a href="https://etherscan.io/tx/0x6f1efcde4a52db999c8cd233364d889292ae5ba357d9f2ead3dd3774010a0808">tx </a><code>0x6f1efcde...</code>)</p></li><li><p><strong>Final Sweep</strong> - At 05:07 UTC, the attacker minted a final <strong>1,000 DOT</strong>, squeezing the last drops of liquidity from the pool (<a href="https://etherscan.io/tx/0xb93aab835e4002f7d46b63e37a156c78abd1d9256df094d63321deeb514a0634">tx </a><code>0xb93aab83...</code>)</p></li></ol><p>Each exploit transaction followed the same pattern: deploy a new contract, call <code>HandlerV1.handlePostRequests</code> with a forged <code>ChangeAssetAdmin</code> message using the MMR bypass (setting <code>leaf_index = 1</code>, <code>leafCount = 1</code>, and <code>proof[0] = overlay_root</code>), gain admin/minter privileges on the target bridged token contract, mint tokens, and dump them through DEX aggregators.</p><h2><strong>Code Analysis</strong></h2><p>The vulnerability is a textbook case of inconsistent library behavior at edge cases. Here&#8217;s the core of the issue in the <code>HandlerV1.handlePostRequests</code> function:</p><pre><code><code>// HandlerV1.sol - handlePostRequests
// https://github.com/polytope-labs/hyperbridge/blob/05031ae/evm/src/core/HandlerV1.sol

function handlePostRequests(IHost host, PostRequestMessage calldata request) 
    external notFrozen(host) 
{
    uint256 requestsLen = request.requests.length;
    MmrLeaf[] memory leaves = new MmrLeaf[](requestsLen);

    for (uint256 i = 0; i &lt; requestsLen; ++i) {
        PostRequestLeaf memory leaf = request.requests[i];
        bytes32 commitment = leaf.request.hash();
        // leaf.kIndex and leaf.index come directly from untrusted input
        // No validation that leaf.index &lt; leafCount!
        leaves[i] = MmrLeaf(leaf.kIndex, leaf.index, commitment);
    }

    bytes32 root = host.stateMachineCommitment(request.proof.height).overlayRoot;
    if (root == bytes32(0)) revert StateCommitmentNotFound();

    // Passes attacker-controlled leaf_index to the MMR verifier
    bool valid = MerkleMountainRange.VerifyProof(
        root, request.proof.multiproof, leaves, request.proof.leafCount
    );
    if (!valid) revert InvalidProof();

    // If verification "passes", forged messages get dispatched
    for (uint256 i = 0; i &lt; requestsLen; ++i) {
        PostRequestLeaf memory leaf = request.requests[i];
        host.dispatchIncoming(leaf.request, _msgSender());
    }
}
</code></code></pre><p>The handler accepts <code>leaf.index</code> and <code>leafCount</code> directly from the calldata - completely attacker-controlled. No sanity check verifies that <code>leaf.index &lt; leafCount</code>. This untrusted input flows directly into the MMR library&#8217;s <code>CalculateRoot</code>, triggering the bypass.</p><p>The following proof-of-concept demonstrates the inconsistency:</p><pre><code><code>function test_MerkleMountainRange_InconsistentBehavior() public {
    bytes32[] memory proof = new bytes32[](1);
    proof[0] = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;

    MmrLeaf[] memory leaves = new MmrLeaf[](1);

    // Case A: leaf_index = 0 &#8594; early exit, returns leaf hash (correct)
    leaves[0] = MmrLeaf(0, 0, 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
    bytes32 rootA = MerkleMountainRange.CalculateRoot(proof, leaves, 1);
    // rootA = 0xbbbb...  &#8592; leaf hash, proof is ignored

    // Case B: leaf_index = 1 &#8594; bypasses early exit, returns proof[0] (VULNERABLE)
    leaves[0] = MmrLeaf(0, 1, 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
    bytes32 rootB = MerkleMountainRange.CalculateRoot(proof, leaves, 1);
    // rootB = 0xaaaa...  &#8592; attacker controls this! leaf hash completely ignored
}
</code></code></pre><p><strong>The fix is remarkably simple</strong> - a single bounds check:</p><pre><code><code>// Add this before the CalculateRoot computation:
require(leaf.index &lt; leafCount, "leaf index out of bounds");
</code></code></pre><p>One line of validation. That&#8217;s the difference between a secure bridge and a $237K exploit with billions in unbacked tokens minted.</p><h2><strong>Lessons Learned</strong></h2><ul><li><p><strong>Validate all inputs at system boundaries.</strong> The handler accepted <code>leaf_index</code> and <code>leafCount</code> from untrusted calldata and passed them directly to a security-critical library. Every parameter that feeds into proof verification must be bounds-checked before use - trusting that a library will handle edge cases correctly is a dangerous assumption.</p></li><li><p><strong>Fuzz test cryptographic libraries exhaustively.</strong> The MMR library&#8217;s behavior diverged at a single edge case (<code>leaf_index &gt;= leafCount</code>). Random fuzzing with arbitrary <code>leaf_index</code> values would have caught this inconsistency immediately. Cryptographic verification code demands the highest testing standards - property-based and fuzz testing are non-negotiable.</p></li><li><p><strong>Library security is protocol security.</strong> The vulnerable code lived in <code>solidity-merkle-trees</code>, a shared dependency. Bridge protocols that delegate proof verification to external libraries must audit those libraries as rigorously as their own code. A bug in a dependency is a bug in your protocol.</p></li><li><p><strong>Inconsistent edge-case behavior is a vulnerability class.</strong> The <code>CalculateRoot</code> function had two code paths that behaved fundamentally differently based on <code>leaf_index</code>. Path A (index 0) used the leaf hash; Path B (index 1) used the proof element. This kind of bifurcated logic in security-critical code is a red flag that demands explicit documentation and testing.</p></li><li><p><strong>Defense-in-depth for cross-chain bridges.</strong> Beyond proof verification, secondary safeguards - rate limiting on minting, admin-change timelocks, anomaly detection - could have limited the blast radius even after verification was bypassed.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.verichains.io/subscribe?"><span>Subscribe now</span></a></p><h2><strong>Conclusion</strong></h2><p>The Hyperbridge exploit is a stark reminder that in cross-chain security, the most devastating vulnerabilities often hide in the most fundamental building blocks. A single missing bounds check - <code>leaf_index &lt; leafCount</code> - turned a Merkle Mountain Range verifier into an open door, allowing an attacker to forge cross-chain messages, seize admin privileges, and mint billions in unbacked tokens across DOT, ARGN, MANTA, and CERE.</p><p>Despite minting over $2 billion in nominal token value, the attacker walked away with roughly $237K - a testament to the thin liquidity of bridged assets, but cold comfort for a protocol that staked its reputation on being &#8220;trust-minimized.&#8221; The ironic timing - just twelve days after an April Fools&#8217; post joking about being hacked - underscores that security claims must be backed by rigorous engineering, not confidence.</p><p>This incident reinforces that <strong>oracle and proof verification code is the bedrock of cross-chain security</strong>. When the verification layer fails, everything built on top of it fails. In DeFi, a missing bounds check isn&#8217;t a minor oversight - it&#8217;s an existential risk.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Deep Dive into the dTRINITY cbBTC Exploit]]></title><description><![CDATA[On March 17, 2026, the DeFi protocol dTRINITY, a lending protocol on Ethereum, suffered a security incident resulting in an estimated loss of ~$257.3K.]]></description><link>https://blog.verichains.io/p/deep-dive-into-the-dtribity-cbbtc</link><guid isPermaLink="false">https://blog.verichains.io/p/deep-dive-into-the-dtribity-cbbtc</guid><dc:creator><![CDATA[HL]]></dc:creator><pubDate>Mon, 06 Apr 2026 03:13:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!eWSv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Overview</h2><p>On March 17, 2026, the DeFi protocol <strong>dTRINITY</strong>, a lending protocol on Ethereum, suffered a security incident resulting in an estimated loss of <strong>~$257.3K</strong>.</p><p>The exploit stemmed from an <strong>empty market weakness</strong> commonly found in forks of Aave V3, where reserves with <strong>extremely low liquidity</strong> can behave unpredictably. In this scenario, repeated accumulation of flash loan premiums caused the <code>liquidityIndex</code> to increase to an abnormally high level, disrupting the accuracy of the reserve&#8217;s accounting. This distortion led to precision issues in deposit and withdrawal calculations, enabling the attacker to artificially inflate collateral value, borrow dUSD against it, and reclaim the deposited <code>cbBTC</code> for a net gain.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>Technical Analysis of the Exploit</h2><h3>Incident Overview</h3><ul><li><p><strong>Date:</strong> March 17, 2026</p></li><li><p><strong>Protocol:</strong> dTRINITY</p></li><li><p><strong>L2Pool Contrac</strong>t: <a href="https://etherscan.io/address/0xfda3a0effe2f3917aa60e0741c6788619ae19e84">0xfda3a0effe2f3917aa60e0741c6788619ae19e84</a></p></li><li><p><strong>Exploiter Address:</strong> <a href="https://etherscan.io/address/0x08cfdff8ded5f1326628077f38d4f90df6417fd9">0x08cfdff8ded5f1326628077f38d4f90df6417fd9</a></p></li><li><p><strong>Attack Transactions:</strong></p><ul><li><p><a href="https://etherscan.io/tx/0x8d33d688def03551cb77b0463f55ae5a670f5ebf3bbb5b8aa0e284c040ae7139">0x8d33d688def03551cb77b0463f55ae5a670f5ebf3bbb5b8aa0e284c040ae7139</a></p></li><li><p><a href="https://etherscan.io/tx/0xbec4c8ae19c44990984fd41dc7dd1c9a22894adccf31ca6b61b5aa084fc33260">0xbec4c8ae19c44990984fd41dc7dd1c9a22894adccf31ca6b61b5aa084fc33260</a></p></li></ul></li></ul><div><hr></div><h3>Root Cause</h3><p>The exploit stemmed from an <strong>empty market vulnerability</strong> in the lending pool of <strong>dTRITINY</strong>, an <strong>AAVE</strong> V3&#8211;style implementation, where the cbBTC reserve operated with <strong>near-zero liquidity</strong>.</p><p>At the core of the issue is the protocol&#8217;s liquidity index update mechanism, which is triggered on every flash loan repayment through <code>_handleFlashLoanRepayment</code> and is defined as:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{liquidityIndex}_{new}\n=\n\\text{liquidityIndex}_{old}\n\\times\n\\left(1 + \\frac{\\text{premiumToLP}}{\\text{totalLiquidity}}\\right)\n&quot;,&quot;id&quot;:&quot;SLSICESHPG&quot;}" data-component-name="LatexBlockToDOM"></div><p>Under these conditions, repeated flash loan premium accrual caused the reserve&#8217;s <code>liquidityIndex</code> to increase <strong>disproportionately</strong>, as the index update mechanism scales inversely with total liquidity. With minimal liquidity, even small premiums led to significant index inflation.</p><p>This created a <strong>misalignment between scaled balances and underlying assets</strong>, introducing a rounding asymmetry in which:</p><ul><li><p>Small deposits minted shares at an artificially low cost</p></li><li><p>Withdrawals redeemed disproportionately higher value</p></li></ul><p>As a result, the attacker was able to <strong>inflate collateral value</strong>, borrow against it, and extract real assets from the protocol.</p><h2>Attack Flow</h2><p>The exploit was executed across <strong>two sequential transactions</strong>, leveraging abnormal growth of the <code>liquidityIndex</code> in a near-empty cbBTC reserve.</p><h3><code>liquidityIndex</code> Manipulation Transaction</h3><p>Transaction: <a href="https://etherscan.io/tx/0x8d33d688def03551cb77b0463f55ae5a670f5ebf3bbb5b8aa0e284c040ae7139">0x8d33d688def03551cb77b0463f55ae5a670f5ebf3bbb5b8aa0e284c040ae7139</a></p><p>The attacker executed a multi-step strategy to manipulate the internal accounting of the <strong>cbBTC reserve</strong>, ultimately inflating the <code>liquidityIndex</code> far beyond its true economic value.</p><ul><li><p>Borrowed <code>cbBTC</code> from <strong>Morpho Blue</strong> and deposited it into the <code>dLEND-cbBTC</code> pool, minting 100 scaled shares.</p></li><li><p>Withdrew 99 shares, leaving only a share balance and effectively reducing the reserve to an <strong>almost-empty state.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4rd0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4rd0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 424w, https://substackcdn.com/image/fetch/$s_!4rd0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 848w, https://substackcdn.com/image/fetch/$s_!4rd0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 1272w, https://substackcdn.com/image/fetch/$s_!4rd0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4rd0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png" width="1456" height="610" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:610,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:476899,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/193241153?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4rd0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 424w, https://substackcdn.com/image/fetch/$s_!4rd0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 848w, https://substackcdn.com/image/fetch/$s_!4rd0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 1272w, https://substackcdn.com/image/fetch/$s_!4rd0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5418ead6-4043-47ed-a14c-435681b31e19_2130x892.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li><li><p>Transferred <strong>0.8 cbBTC</strong> directly to the <strong>dLEND-cbBTC</strong> aToken contract.</p></li><li><p>Repeatedly invoked <code>flashLoan</code> operations to accumulate premiums into the reserve, causing the <code>liquidityIndex</code> to increase <strong>disproportionately</strong> (reaching ~6.22e27)</p></li><li><p>Performed additional deposit/withdraw cycles to extract residual liquidity from the pool</p></li><li><p>Repaid the flash loan</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8gwD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8gwD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 424w, https://substackcdn.com/image/fetch/$s_!8gwD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 848w, https://substackcdn.com/image/fetch/$s_!8gwD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 1272w, https://substackcdn.com/image/fetch/$s_!8gwD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8gwD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png" width="1456" height="285" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:285,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:201143,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/193241153?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8gwD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 424w, https://substackcdn.com/image/fetch/$s_!8gwD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 848w, https://substackcdn.com/image/fetch/$s_!8gwD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 1272w, https://substackcdn.com/image/fetch/$s_!8gwD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b086a19-6377-42d7-aaab-ecbd9826e942_2354x460.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li></ul><p>At the end of this transaction, the reserve was left in a <strong>distorted state</strong>, where the <code>liquidityIndex</code> was significantly inflated relative to actual liquidity.</p><h3>Collateral Inflation and Profit Extraction Transaction</h3><p>Transaction: <a href="https://etherscan.io/tx/0xbec4c8ae19c44990984fd41dc7dd1c9a22894adccf31ca6b61b5aa084fc33260">0xbec4c8ae19c44990984fd41dc7dd1c9a22894adccf31ca6b61b5aa084fc33260</a></p><p>With the manipulated reserve state in place, the attacker proceeded to extract value by leveraging the inflated <code>liquidityIndex</code>.</p><ul><li><p>Borrowed <strong>cbBTC</strong> again from <strong>Morpho Blue</strong> and deposited <strong>~7.72 cbBTC</strong> into the compromised reserve. Due to the inflated <code>liquidityIndex</code>, the deposit was <strong>overvalued</strong>, resulting in an artificially large collateral position.</p></li><li><p>Used this inflated collateral to borrow approximately ~<strong>257.3K dUSD</strong> from the <strong>dLEND-dUSD</strong> market.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eWSv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eWSv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 424w, https://substackcdn.com/image/fetch/$s_!eWSv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 848w, https://substackcdn.com/image/fetch/$s_!eWSv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 1272w, https://substackcdn.com/image/fetch/$s_!eWSv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eWSv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png" width="1456" height="548" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:548,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:473474,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/193241153?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eWSv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 424w, https://substackcdn.com/image/fetch/$s_!eWSv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 848w, https://substackcdn.com/image/fetch/$s_!eWSv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 1272w, https://substackcdn.com/image/fetch/$s_!eWSv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e6943f8-d515-4544-97ea-642947d1d424_2180x820.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Borrowing, Depositing cbBTC, and Borrowing dUSD</figcaption></figure></div></li><li><p>Continued extracting <strong>cbBTC</strong> through <strong>repeated deposit and withdrawal cycles.</strong></p></li><li><p>Repaid the flash loan and transferred the borrowed <strong>dUSD</strong> to the attacker&#8217;s externally owned account (EOA)</p></li></ul><h2>Conclusion</h2><p>This incident highlights how flaws in index-based accounting under low-liquidity conditions can be exploited to create severe economic distortions. By reducing the <strong>cbBTC</strong> reserve to a near-empty state and artificially inflating the <code>liquidityIndex</code> through flash loan premiums, the attacker was able to overvalue collateral and borrow assets far beyond legitimate limits. The exploit underscores the importance of enforcing liquidity constraints and ensuring that critical accounting variables remain tightly aligned with actual underlying value.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[DBXen Exploit Analysis]]></title><description><![CDATA[On March 11, 2026, DBXen was exploited through a vulnerability on the custom logic, resulting in the loss of approximately $149,000.]]></description><link>https://blog.verichains.io/p/dbxen-exploit-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/dbxen-exploit-analysis</guid><dc:creator><![CDATA[f4tu]]></dc:creator><pubDate>Fri, 27 Mar 2026 09:01:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!bnhn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On March 11, 2026, DBXen was exploited through a vulnerability on the custom logic, resulting in the loss of approximately $149,000. Let&#8217;s take a closer look at how the attack was carried out.</p><p><strong>Original Attacker : </strong></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p><strong><a href="https://bscscan.com/address/0xe92fa2a5fef535479a91ab9ed90b26256ff276f1">https://bscscan.com/address/0xe92fa2a5fef535479a91ab9ed90b26256ff276f1</a></strong></p><p><strong><a href="https://etherscan.io/address/0x63150ac8e35c6c685e93ee4d7d5cb8eafb2f016b">https://etherscan.io/address/0x63150ac8e35c6c685e93ee4d7d5cb8eafb2f016b</a></strong></p><p><strong>Vulnerable Contract : </strong></p><p><strong><a href="https://bscscan.com/address/0x9caf6c4e5b9e3a6f83182befd782304c7a8ee6de">https://bscscan.com/address/0x9caf6c4e5b9e3a6f83182befd782304c7a8ee6de</a></strong></p><p><strong><a href="https://etherscan.io/address/0xf5c80c305803280b587f8cabbccdc4d9bf522abd">https://etherscan.io/address/0xf5c80c305803280b587f8cabbccdc4d9bf522abd</a></strong></p><p><strong>Attack Tx : </strong></p><p><strong><a href="https://bscscan.com/tx/0xe66e54586827d6a9e1c75bd1ea42fa60891ad341909d29ec896253ee2365d366">https://bscscan.com/tx/0xe66e54586827d6a9e1c75bd1ea42fa60891ad341909d29ec896253ee2365d366</a></strong></p><p><strong><a href="https://etherscan.io/tx/0x914a5af790e55b8ea140a79da931fc037cb4c4457704d184ad21f54fb808bc37">https://etherscan.io/tx/0x914a5af790e55b8ea140a79da931fc037cb4c4457704d184ad21f54fb808bc37</a></strong></p><h1><strong>Analysis</strong></h1><p>The contract is a reward distribution system where users burn XEN tokens to earn DBXen rewards and a share of protocol fees. The system operates in discrete time intervals called cycles. During each cycle, users can burn tokens via <code>burnBatch</code>, and their contribution is tracked through <code>accCycleBatchesBurned</code>. At the end of a cycle, rewards are distributed proportionally based on the number of batches burned relative to the total batches burned in that cycle.</p><p>In addition to rewards, users can earn fees generated by the protocol. These fees are distributed based on a user&#8217;s accumulated rewards and stake. The function <code>updateStats</code> plays a central role by settling all pending rewards, fees, and stake transitions for a user whenever they interact with the contract (e.g., claiming rewards or fees).</p><p>The vulnerability arises from inconsistent use of <code>msg.sender</code> and <code>_msgSender()</code> across the contract. Specifically, different parts of the same logical flow attribute user actions to different addresses.</p><p>In <code>bunBatch</code>, the contract uses <code>_msgSender()</code> when updating <code>accCycleBatchesBurned</code>, meaning the burned amount is credited to the actual user. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G79D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G79D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 424w, https://substackcdn.com/image/fetch/$s_!G79D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 848w, https://substackcdn.com/image/fetch/$s_!G79D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 1272w, https://substackcdn.com/image/fetch/$s_!G79D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G79D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png" width="1456" height="465" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:465,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:152979,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/192286629?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!G79D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 424w, https://substackcdn.com/image/fetch/$s_!G79D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 848w, https://substackcdn.com/image/fetch/$s_!G79D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 1272w, https://substackcdn.com/image/fetch/$s_!G79D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa2bc02e-a1ef-46b2-a564-378840f8e6c0_1534x490.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, when interacting with the XEN token contract, the burn mechanism uses <code>msg.sender</code>, which corresponds to the forwarder in a meta-transaction context. As a result, the burn operation is executed on behalf of the forwarder, not the user.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kSk2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kSk2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 424w, https://substackcdn.com/image/fetch/$s_!kSk2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 848w, https://substackcdn.com/image/fetch/$s_!kSk2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 1272w, https://substackcdn.com/image/fetch/$s_!kSk2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kSk2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png" width="1456" height="618" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:618,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:164248,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/192286629?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kSk2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 424w, https://substackcdn.com/image/fetch/$s_!kSk2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 848w, https://substackcdn.com/image/fetch/$s_!kSk2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 1272w, https://substackcdn.com/image/fetch/$s_!kSk2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb6f0b29d-202f-4db2-90f7-4a8dd645cc45_1734x736.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>First, the attacker calls <code>burnBatch</code> via a trusted forwarder. This results in <code>accCycleBatchesBurned</code> being incremented for the attacker, while <code>lastActiveCycle</code> is updated for the forwarder. At this point, the system already holds inconsistent state.</p><p>Next, the attacker calls either <code>claimRewards</code> or <code>claimFees</code>. Both of these functions internally call <code>updateStats</code>, which attempts to calculate pending rewards for the user.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e5mD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e5mD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 424w, https://substackcdn.com/image/fetch/$s_!e5mD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 848w, https://substackcdn.com/image/fetch/$s_!e5mD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!e5mD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e5mD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png" width="1432" height="1406" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1406,&quot;width&quot;:1432,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:303480,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/192286629?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!e5mD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 424w, https://substackcdn.com/image/fetch/$s_!e5mD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 848w, https://substackcdn.com/image/fetch/$s_!e5mD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!e5mD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff83d7a57-d567-4e87-a164-7b2d78cac775_1432x1406.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Inside <code>updateStats</code>, the contract checks whether the current cycle is greater than <code>lastActiveCycle[account]</code> and whether the user has non-zero burned batches. Because <code>lastActiveCycle[attacker]</code> was never updated, this condition remains true even after rewards have already been calculated.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QY6Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QY6Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 424w, https://substackcdn.com/image/fetch/$s_!QY6Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 848w, https://substackcdn.com/image/fetch/$s_!QY6Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 1272w, https://substackcdn.com/image/fetch/$s_!QY6Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QY6Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png" width="1456" height="338" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:338,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101091,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/192286629?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QY6Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 424w, https://substackcdn.com/image/fetch/$s_!QY6Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 848w, https://substackcdn.com/image/fetch/$s_!QY6Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 1272w, https://substackcdn.com/image/fetch/$s_!QY6Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F021c6179-d18d-4abc-90e0-c6d17d494775_1768x410.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>As a result, the contract repeatedly assumes that the attacker&#8217;s burn contribution has not yet been processed and recalculates rewards every time <code>updateStats</code> is invoked.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bnhn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bnhn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 424w, https://substackcdn.com/image/fetch/$s_!bnhn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 848w, https://substackcdn.com/image/fetch/$s_!bnhn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 1272w, https://substackcdn.com/image/fetch/$s_!bnhn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bnhn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png" width="1456" height="586" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:586,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:656691,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/192286629?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bnhn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 424w, https://substackcdn.com/image/fetch/$s_!bnhn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 848w, https://substackcdn.com/image/fetch/$s_!bnhn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 1272w, https://substackcdn.com/image/fetch/$s_!bnhn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7988c1d0-3466-412a-8d26-d1839b5aae30_2794x1124.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1><strong>Conclusion</strong></h1><p>The root cause of the vulnerability is inconsistent identity handling in a meta-transaction context. By mixing <code>msg.sender</code> and <code>_msgSender()</code> across different parts of the same execution flow, the contract attributes related state updates to different addresses. This leads to a breakdown in internal accounting, allowing an attacker to repeatedly claim rewards from a single action and ultimately drain funds from the protocol.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Solv Protocol Hack Analysis]]></title><description><![CDATA[Solv Protocol (SOLV) is a Bitcoin DeFi platform that allows users to stake BTC or liquid staking tokens (LSTs) in exchange for SolvBTC.]]></description><link>https://blog.verichains.io/p/solv-protocol-hack-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/solv-protocol-hack-analysis</guid><dc:creator><![CDATA[LCD]]></dc:creator><pubDate>Fri, 13 Mar 2026 03:00:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PnRL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Solv Protocol (SOLV)</strong> is a Bitcoin DeFi platform that allows users to stake BTC or liquid staking tokens (LSTs) in exchange for SolvBTC. Its Bitcoin Reserve Offering (BRO) enables institutions to mint SOLV using BTC reserves while generating yield through DeFi strategies. On <strong>March 3, 2026</strong>, the protocol&#8217;s BRO vaults experienced an <strong>exploit</strong>, resulting in a loss of <strong>38.0474 SolvBTC (~$2.7M)</strong>. The root cause was a <strong>smart contract vulnerability resembling a re-entrancy&#8211;like attack</strong>.</p><h1>Overview</h1><ul><li><p><strong>Attacker</strong>: <a href="https://etherscan.io/address/0xa407fe273db74184898cb56d2cb685615e1c0d6e">0xA407fE273DB74184898CB56D2cb685615e1C0D6e</a></p></li><li><p><strong>Attacker&#8217;s contract</strong>: <a href="https://etherscan.io/address/0x6aa78a9b245cc56377b21401b517ec8c03a40f03">0x6aA78a9B245Cc56377b21401B517EC8c03a40F03</a></p></li><li><p><strong>Attacker&#8217;s wallet</strong>: <a href="https://etherscan.io/address/0xb32d389901f963e7c87168724fbdcc3a9db20dc9">0xb32D389901f963E7C87168724fBDCC3A9DB20dc9</a></p></li><li><p><strong>Vulnerable contract</strong>: <a href="https://etherscan.io/address/0x15f7c1ac69f0c102e4f390e45306bd917f21cfcf">BitcoinReserveOffering</a></p></li><li><p><strong>Attack transaction</strong>: <a href="https://etherscan.io/tx/0x44e637c7d85190d376a52d89ca75f2d208089bb02b7c4708ad2aaae3a97a958d">0x44e637c7d85190d376a52d89ca75f2d208089bb02b7c4708ad2aaae3a97a958d</a></p></li></ul><h1>Analysis</h1><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PnRL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PnRL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 424w, https://substackcdn.com/image/fetch/$s_!PnRL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 848w, https://substackcdn.com/image/fetch/$s_!PnRL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 1272w, https://substackcdn.com/image/fetch/$s_!PnRL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PnRL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png" width="1456" height="845" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:845,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:609760,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/190690332?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PnRL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 424w, https://substackcdn.com/image/fetch/$s_!PnRL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 848w, https://substackcdn.com/image/fetch/$s_!PnRL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 1272w, https://substackcdn.com/image/fetch/$s_!PnRL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd8f594-b72f-4922-8369-d725037de7c4_2222x1290.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>From an initial review of the transaction, the attacker executed a <strong>22-iteration loop</strong> to mint and burn tokens, with the amount of <strong>BRO tokens doubling each time</strong> (what an interesting strategy!).</p><p>In each cycle, the attacker performed the following steps:</p><ol><li><p><strong>Burned BRO</strong> to receive a <strong>GOEFS NFT</strong> (a vault share NFT used to represent ownership and enable functions such as voting).</p></li><li><p><strong>Burned the NFT</strong> to redeem the <strong>BRO tokens back</strong>.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ds8h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ds8h!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 424w, https://substackcdn.com/image/fetch/$s_!ds8h!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 848w, https://substackcdn.com/image/fetch/$s_!ds8h!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 1272w, https://substackcdn.com/image/fetch/$s_!ds8h!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ds8h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png" width="1456" height="897" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:897,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:706293,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/190690332?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ds8h!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 424w, https://substackcdn.com/image/fetch/$s_!ds8h!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 848w, https://substackcdn.com/image/fetch/$s_!ds8h!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 1272w, https://substackcdn.com/image/fetch/$s_!ds8h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1a78d354-2275-44ce-a67d-d5d6981e92c6_2320x1430.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A deeper inspection reveals an interesting issue in the <code>mint()</code> function: it mints BRO tokens <strong>twice</strong> for a single burned NFT. This effectively means that an attacker could <strong>acquire an NFT and redeem it to receive double the amount of BRO</strong>, creating an immediate profit opportunity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7KEp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7KEp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 424w, https://substackcdn.com/image/fetch/$s_!7KEp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 848w, https://substackcdn.com/image/fetch/$s_!7KEp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 1272w, https://substackcdn.com/image/fetch/$s_!7KEp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7KEp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png" width="1456" height="951" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:951,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:424163,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/190690332?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7KEp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 424w, https://substackcdn.com/image/fetch/$s_!7KEp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 848w, https://substackcdn.com/image/fetch/$s_!7KEp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 1272w, https://substackcdn.com/image/fetch/$s_!7KEp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0567f932-eb10-490b-b5ea-587e11e829ef_1938x1266.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After double-checking the verified source code of <a href="https://etherscan.io/address/0x15f7c1ac69f0c102e4f390e45306bd917f21cfcf">BitcoinReserveOffering</a>, we can confirm that the contract contains a <strong>double-mint vulnerability</strong>. This flaw is the root cause of the exploit.</p><p>P/S: This is <strong>not a re-entrancy bug</strong>, since the control flow remains entirely within the contract and <strong>no external calls are involved</strong>. As a result, the vulnerability stems from flawed internal logic rather than re-entrant execution.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B42s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B42s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 424w, https://substackcdn.com/image/fetch/$s_!B42s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 848w, https://substackcdn.com/image/fetch/$s_!B42s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 1272w, https://substackcdn.com/image/fetch/$s_!B42s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B42s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png" width="1456" height="629" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:629,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:661353,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/190690332?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B42s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 424w, https://substackcdn.com/image/fetch/$s_!B42s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 848w, https://substackcdn.com/image/fetch/$s_!B42s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 1272w, https://substackcdn.com/image/fetch/$s_!B42s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4bdfeb2-b4f8-4014-8bd5-95cbb9e27160_2534x1094.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In the end, the attacker accumulated approximately <strong>567M BRO tokens</strong>. He then exchanged only <strong>165M BRO for 38 SolvBTC</strong>, and subsequently used <strong>Uniswap</strong> to swap the SolvBTC for <strong>1,211 WETH</strong>, which was ultimately converted to <strong>ETH and transferred back to his EOA wallet</strong>.</p><h1>Summary</h1><p>In this exploit, attacker took advantage of a flaw in the contract logic to repeatedly manipulate the mint and redemption process and extract funds from the system. To reduce the risk of similar incidents, DeFi protocols should adopt strong security practices throughout development. This includes conducting comprehensive <strong>smart contract audits by reputable security firms</strong>, implementing thorough testing (especially for mint, burn, and accounting logic), and adding safeguards such as monitoring and emergency controls. Regular security reviews and audits are particularly important for complex financial contracts, as they can help detect subtle logic flaws before deployment.</p>]]></content:encoded></item><item><title><![CDATA[LAXO Token Exploit: AMM Reserve Manipulation via Burn Mechanism]]></title><description><![CDATA[On February 22, 2026, the LAXO token on Binance Smart Chain (BSC) was exploited through a flaw in its token transfer logic and burn mechanism.]]></description><link>https://blog.verichains.io/p/laxo-token-exploit-amm-reserve-manipulation</link><guid isPermaLink="false">https://blog.verichains.io/p/laxo-token-exploit-amm-reserve-manipulation</guid><dc:creator><![CDATA[lifebow]]></dc:creator><pubDate>Tue, 10 Mar 2026 03:07:34 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XZCb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F20abd958-d8c9-49ef-8c21-44117564e63e_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On <strong>February 22, 2026</strong>, the <strong>LAXO token</strong> on <strong>Binance Smart Chain (BSC)</strong> was exploited through a flaw in its token transfer logic and burn mechanism. The vulnerability allowed an attacker to manipulate the reserve accounting of the <strong>LAXO/USDT </strong>PancakeSwap liquidity pool.</p><h2>Incident Overview</h2><p><strong>Date:</strong> Feb 22, 2026</p><p><strong>Platform:</strong> Binance Smart Chain (BSC)</p><p><strong>Attacker Address:</strong> 0x17f9132E66A78b93195b4B186702Ad18Fdcd6E3D</p><p><strong>Attack Contract</strong>: 0x6588ACB7dd37887C707C08AC710A82c9F9A7C1E9</p><p><strong>Laxo Token Contract:</strong> 0x62951CaD7659393BF07fbe790cF898A3B6d317CB</p><p><strong>Attack Transaction:</strong> 0xd58f3ef6414b59f95f55dae1acb3d5d6e626acf5333917c6d43fe422d98ac7d3</p><p></p><h2>Exploit Mechanics</h2><p>All steps below were executed within a single transaction by the attack contract:</p><ol><li><p>Borrowed <strong>350k USDT</strong> from a PancakeSwap V3 pool using a <strong>flash loan</strong>.</p></li><li><p>Bought a large amount of <strong>LAXO tokens</strong> from the <strong>LAXO/USDT pool</strong>, temporarily stored them in <strong>PancakeRouter</strong>.</p></li><li><p>Added a small amount of liquidity (<strong>BNB and LAXO</strong>) and immediately removed it.</p><p>This trick allowed the attacker to retrieve the temporarily stored tokens from PancakeRouter and avoid the swap fee from step 2.</p></li><li><p>Sold all <strong>LAXO tokens</strong> back into the <strong>LAXO/USDT pool</strong>.</p><p>This action triggered the <strong>burn mechanism</strong>, which incorrectly updated the reserves in the PancakeSwap pool. The attacker was then able to withdraw <strong>487k USDT</strong>.</p></li><li><p>Repaid <strong>350,175 USDT</strong> to the PancakeSwap V3 pool to settle the flash loan.</p></li></ol><h3><strong>Root Cause Analysis</strong></h3><p>The root issue occurs in <strong>step 4</strong>, where the PancakeSwap pool updates its reserves incorrectly.</p><p>A deeper look into the <code>_transfer</code> internal function of the LAXO token reveals a <strong>burn mechanism triggered when users sell tokens</strong>. The problem lies in the <strong>position of the </strong><code>sync</code><strong> call</strong>.</p><p>The contract executes <code>sync</code> <strong>after transferring tokens from the pair to the dead address</strong> (burn). The <code>sync</code> function updates the pair reserves based on the <strong>remaining LAXO and USDT balances</strong> in the pair contract.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EarB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EarB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 424w, https://substackcdn.com/image/fetch/$s_!EarB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 848w, https://substackcdn.com/image/fetch/$s_!EarB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 1272w, https://substackcdn.com/image/fetch/$s_!EarB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EarB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png" width="670" height="475" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:475,&quot;width&quot;:670,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108875,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/190367401?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EarB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 424w, https://substackcdn.com/image/fetch/$s_!EarB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 848w, https://substackcdn.com/image/fetch/$s_!EarB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 1272w, https://substackcdn.com/image/fetch/$s_!EarB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd833440-6509-4f6f-a9aa-84b40b7ad15c_670x475.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The sync action occurs immediately after burning, causing the pair to record incorrect reserves. This inflates the LAXO reserve value, enabling the attacker to extract excess USDT from the pool when selling the remaining LAXO tokens.</p><p></p><h2>Conclusion</h2><p>The LAXO exploit highlights the risks of improper token logic interacting with AMM liquidity pools. A misordered burn operation and <code>sync</code> call caused the PancakeSwap pair to record incorrect reserves. This broke the pool&#8217;s reserve accounting and allowed the attacker to extract excess USDT. The incident shows that token mechanisms such as burns or fees must be carefully designed to avoid interfering with pool reserve updates. Projects should thoroughly review and test how their token contracts interact with AMM pools to ensure reserve calculations remain accurate and secure.</p>]]></content:encoded></item><item><title><![CDATA[Solidity's Hidden Flexibility: How ABI Encoding Assumptions Led to an Exploit]]></title><description><![CDATA[UniswapV4Router04 Exploit]]></description><link>https://blog.verichains.io/p/soliditys-hidden-flexibility-how</link><guid isPermaLink="false">https://blog.verichains.io/p/soliditys-hidden-flexibility-how</guid><dc:creator><![CDATA[TK]]></dc:creator><pubDate>Wed, 04 Mar 2026 08:21:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!EzCt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On March 3, 2026, a vulnerability was exploited in the <strong>UniswapV4Router04</strong> contract deployed by <strong>z0r0z.eth</strong> on Ethereum, resulting in an approximate loss of <strong>$42.1K</strong>. The attacker exploited a hardcoded <strong>calldata</strong> <strong>offset</strong> in an inline assembly authorization check, bypassing the payer verification and draining USDC from a victim who had previously approved the router.</p><h2><strong>Overview</strong></h2><p><strong>Vulnerable Contract:</strong> <a href="https://etherscan.io/address/0x00000000000044a361ae3cac094c9d1b14eece97">0x00000000000044a361ae3cac094c9d1b14eece97</a></p><p><strong>Exploit TX:</strong> <a href="https://etherscan.io/tx/0xfe34c4beee447de536bbd3d613aa0e3aa7eeb63832e9453e4ef3999924ab466a">0xfe34c4beee447de536bbd3d613aa0e3aa7eeb63832e9453e4ef3999924ab466a</a></p><h2><strong>Exploit Analysis</strong></h2><p>The <strong>UniswapV4Router04</strong> provides multiple swap functions. Most of these functions safely hardcode <code>payer: msg.sender</code> into the <code>BaseData</code> struct, ensuring only the caller&#8217;s tokens can be spent. However, one overload - <code>swap(bytes calldata data, uint256 deadline)</code> - accepts pre-encoded data directly from the caller and uses inline assembly for authorization. This is where the vulnerability lies.</p><h3><strong>The Vulnerable Function</strong></h3><p>The <code>swap(bytes,uint256)</code> function contains an inline assembly authorization check intended to verify that the <code>payer</code> field inside the encoded <code>BaseData</code> struct equals <code>msg.sender</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EzCt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EzCt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 424w, https://substackcdn.com/image/fetch/$s_!EzCt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 848w, https://substackcdn.com/image/fetch/$s_!EzCt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 1272w, https://substackcdn.com/image/fetch/$s_!EzCt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EzCt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png" width="1456" height="576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:576,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167754,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/189854596?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EzCt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 424w, https://substackcdn.com/image/fetch/$s_!EzCt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 848w, https://substackcdn.com/image/fetch/$s_!EzCt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 1272w, https://substackcdn.com/image/fetch/$s_!EzCt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6aba882-5601-44fb-b44d-30b486ac3b1b_1740x688.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The comment says it is &#8220;<em>equivalent to </em><code>require(abi.decode(data, (BaseData)).payer == msg.sender, Unauthorized())</code>&#8220; - but it is <strong>not</strong>.</p><h3><strong>Why </strong><code>calldataload(164)</code><strong>?</strong></h3><p>The developer assumed the standard (canonical) ABI encoding layout for <code>swap(bytes,uint256)</code>. Under that assumption, the calldata is structured as:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;markdown&quot;,&quot;nodeId&quot;:&quot;763ad687-b8d5-4273-a873-29ff9d7b2b04&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-markdown">| Byte Offset | Size | Content |
|---|---|---|
| `0&#8211;3` | 4 bytes | Function selector |
| `4&#8211;35` | 32 bytes | Offset to `bytes data` (assumed `0x40` = 64) |
| `36&#8211;67` | 32 bytes | `uint256 deadline` |
| `68&#8211;99` | 32 bytes | Length of `bytes data` |
| `100&#8211;131` | 32 bytes | `BaseData.amount` |
| `132&#8211;163` | 32 bytes | `BaseData.amountLimit` |
| **`164&#8211;195`** | **32 bytes** | **`BaseData.payer`** &#8592; `calldataload(164)` reads here |</code></pre></div><p>So <code>calldataload(164)</code> reads exactly <code>BaseData.payer</code> - but <strong>only</strong> when the <code>bytes data</code> parameter starts at the standard offset of <code>0x40</code> (64).</p><h3><strong>ABI Encoding Permits Non-Standard Offsets</strong></h3><p>According to the <a href="https://docs.soliditylang.org/en/latest/abi-spec.html#formal-specification-of-the-encoding">Solidity ABI Specification</a>, dynamic types like <code>bytes</code> are not encoded in-place. Instead, the head part contains an <strong>offset pointer</strong> to where the data actually begins:</p><blockquote><p><em>&#8220;For dynamic types, head(X(i)) is the offset of the beginning of tail(X(i)) relative to the start of enc(X).&#8221;</em></p></blockquote><p>The Solidity ABI decoder <strong>follows this offset pointer</strong> to locate the data. Critically, the ABI specification does not require the offset to be the minimum possible value. From the <a href="https://docs.soliditylang.org/en/latest/abi-spec.html#strict-encoding-mode">Strict Encoding Mode</a> section:</p><blockquote><p><em>&#8220;Strict encoding mode is the mode that leads to exactly the same encoding as defined in the formal specification above. This means that offsets have to be as small as possible while still not creating overlaps in the data areas, and thus no gaps are allowed.&#8221;</em></p><p><em>&#8220;Usually, ABI decoders are written in a straightforward way by just following offset pointers, but some decoders might enforce strict mode. The Solidity ABI decoder currently does not enforce strict mode, but the encoder always creates data in strict mode.&#8221;</em></p></blockquote><p>This means the Solidity decoder happily accepts calldata where the <code>bytes data</code> parameter starts at <strong>any valid offset</strong> - not just <code>0x40</code>. An attacker can set the offset to a larger value, shifting where the actual <code>BaseData</code> struct is located in the calldata, while placing their own address at the fixed position 164.</p><h3><strong>The Disconnect</strong></h3><p>After the assembly check passes, the function calls <code>_unlockAndDecode(data)</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uLCF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uLCF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 424w, https://substackcdn.com/image/fetch/$s_!uLCF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 848w, https://substackcdn.com/image/fetch/$s_!uLCF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 1272w, https://substackcdn.com/image/fetch/$s_!uLCF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uLCF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png" width="1264" height="384" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:384,&quot;width&quot;:1264,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73538,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/189854596?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uLCF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 424w, https://substackcdn.com/image/fetch/$s_!uLCF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 848w, https://substackcdn.com/image/fetch/$s_!uLCF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 1272w, https://substackcdn.com/image/fetch/$s_!uLCF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8a4248e-cb7e-41d6-aa2f-b559efa53c72_1264x384.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Inside the unlock callback, the data is decoded using Solidity&#8217;s standard <code>abi.decode</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5Mau!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5Mau!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 424w, https://substackcdn.com/image/fetch/$s_!5Mau!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 848w, https://substackcdn.com/image/fetch/$s_!5Mau!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 1272w, https://substackcdn.com/image/fetch/$s_!5Mau!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5Mau!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png" width="1430" height="112" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/edf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:112,&quot;width&quot;:1430,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:42747,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/189854596?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5Mau!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 424w, https://substackcdn.com/image/fetch/$s_!5Mau!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 848w, https://substackcdn.com/image/fetch/$s_!5Mau!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 1272w, https://substackcdn.com/image/fetch/$s_!5Mau!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fedf23439-48ed-4bd7-a678-fa0cd5cfa81b_1430x112.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This <code>abi.decode</code> correctly follows the offset pointer and reads <code>BaseData</code> from wherever <code>data</code> actually points - which, in the attacker&#8217;s crafted calldata, is at a <strong>different location</strong> than position 164.</p><h3><strong>Attack Flow</strong></h3><p>The attacker constructs calldata for <code>swap(bytes,uint256)</code> with a non-standard offset for the <code>bytes data</code> parameter:</p><ol><li><p><strong>Position 164</strong>: Contains the <strong>attacker&#8217;s own address</strong> &#8594; passes the <code>calldataload(164) == caller()</code> assembly check.</p></li><li><p><strong>Actual </strong><code>bytes data</code>: Located at a different offset, contains a <code>BaseData</code> struct with <code>payer</code> set to the <strong>victim&#8217;s address</strong>.</p></li></ol><p>When the swap executes, the victim&#8217;s tokens are used for the input settlement. Since the victim had previously approved the router contract for USDC spending, the router successfully transfers USDC from the victim to complete the swap, sending the output tokens to the attacker&#8217;s chosen receiver. </p><h2><strong>Conclusion</strong></h2><p>This exploit demonstrates the danger of using hardcoded calldata offsets in inline assembly for authorization checks. The EVM&#8217;s ABI encoding is more flexible than developers often assume - dynamic types like <code>bytes</code> can have their data placed at arbitrary offsets, and the Solidity ABI decoder does not enforce strict encoding mode. Any security check that relies on a fixed calldata position will fail when confronted with non-standard but perfectly valid ABI encoding.</p><p>Furthermore, conducting a security audit is strongly recommended for all projects, even though they are smart contracts, backends, wallets, or dapps.</p>]]></content:encoded></item><item><title><![CDATA[SwapNet Exploit Analysis]]></title><description><![CDATA[On January 25, 2026, the SwapNet DEX aggregator was exploited, resulting in a loss of approximately $13.4M across multiple chains (Base, BSC, Arbitrum).]]></description><link>https://blog.verichains.io/p/swapnet-exploit-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/swapnet-exploit-analysis</guid><dc:creator><![CDATA[nt]]></dc:creator><pubDate>Tue, 24 Feb 2026 07:38:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!K0HA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On January 25, 2026, the SwapNet DEX aggregator was exploited, resulting in a loss of approximately $13.4M across multiple chains (Base, BSC, Arbitrum).</p><p>SwapNet is a DEX aggregator designed to find optimal swap routes by aggregating liquidity from multiple on-chain sources, including AMMs and private market makers. The protocol allows users to specify custom routers or pools when executing swaps. Its smart contracts were closed-source and not verified on block explorers.</p><h2><strong>SwapNet Router</strong></h2><p>The SwapNet Router contract is the core contract that executes token swaps. Users approve their tokens to the router, and the router executes swaps through various DEX protocols (Uniswap V2/V3, Curve, etc.). The router supports multi-hop swap routing with user-supplied parameters.</p><p>The normal swap flow works as follows:</p><ol><li><p>Users approve their tokens to the SwapNet Router contract</p></li><li><p>Users call a swap function with parameters specifying the input token, output token, and routing path</p></li><li><p>The router transfers the input tokens from the user, executes the swap through the specified DEXs, and sends the output tokens back to the user</p></li></ol><h2><strong>Key Information</strong></h2><ul><li><p>SwapNet Router: <a href="https://basescan.org/address/0x616000e384Ef1C2B52f5f3A88D57a3B64F23757e">https://basescan.org/address/0x616000e384Ef1C2B52f5f3A88D57a3B64F23757e</a></p></li><li><p>Upgrade Tx: <a href="https://basescan.org/tx/0xdf81a643b03c4364dd2740d3ac177d0184c5b4e432257aaa0c277d4eef88a011">https://basescan.org/tx/0xdf81a643b03c4364dd2740d3ac177d0184c5b4e432257aaa0c277d4eef88a011</a></p></li><li><p>Attack Tx: <a href="https://basescan.org/tx/0xc15df1d131e98d24aa0f107a67e33e66cf2ea27903338cc437a3665b6404dd57">https://basescan.org/tx/0xc15df1d131e98d24aa0f107a67e33e66cf2ea27903338cc437a3665b6404dd57</a></p></li></ul><h2><strong>Exploit Analysis</strong></h2><p>The root cause of the exploit is an <strong>arbitrary-call vulnerability</strong> stemming from <strong>insufficient validation of user-supplied inputs</strong> in the SwapNet Router&#8217;s closed-source smart contracts.</p><p>Based on the decompiled bytecode, the vulnerable function <code>0x87395540()</code> handles the core swap routing logic. For each swap step, the contract determines the DEX type and executes the appropriate swap. The contract supports dozens of DEX types identified by numeric codes in <code>msg.data</code>:</p><p>For certain DEX types (particularly the custom router type), the contract performs a <strong>low-level call</strong> to a <strong>user-supplied address</strong> (<code>v75</code>) with <strong>user-controlled calldata</strong>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K0HA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K0HA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 424w, https://substackcdn.com/image/fetch/$s_!K0HA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 848w, https://substackcdn.com/image/fetch/$s_!K0HA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 1272w, https://substackcdn.com/image/fetch/$s_!K0HA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K0HA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png" width="907" height="702" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/496e28fc-a294-40c2-866e-43ad0e475837_907x702.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:702,&quot;width&quot;:907,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90154,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/188993248?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!K0HA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 424w, https://substackcdn.com/image/fetch/$s_!K0HA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 848w, https://substackcdn.com/image/fetch/$s_!K0HA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 1272w, https://substackcdn.com/image/fetch/$s_!K0HA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F496e28fc-a294-40c2-866e-43ad0e475837_907x702.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The critical issue is that <strong>no validation is performed on </strong><code>v75</code> (the call target address). The attacker exploited this by:</p><ol><li><p>Setting the internal key variable <code>v75</code> to the <strong>USDC token address</strong> instead of a legitimate DEX router, bypassing the intended routing logic.</p></li><li><p>Crafting the calldata to encode <code>transferFrom(SwapNetRouter, attacker, amount)</code>.</p></li><li><p>Since the SwapNet Router contract held user approvals (from users who granted infinite approvals), the <code>USDC.transferFrom()</code> call succeeded, and the attacker drained all approved USDC.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EjSM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EjSM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 424w, https://substackcdn.com/image/fetch/$s_!EjSM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 848w, https://substackcdn.com/image/fetch/$s_!EjSM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 1272w, https://substackcdn.com/image/fetch/$s_!EjSM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EjSM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png" width="1005" height="603" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:603,&quot;width&quot;:1005,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:89929,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/188993248?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EjSM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 424w, https://substackcdn.com/image/fetch/$s_!EjSM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 848w, https://substackcdn.com/image/fetch/$s_!EjSM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 1272w, https://substackcdn.com/image/fetch/$s_!EjSM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2f94ee-0a15-44be-a57c-5ceead1ca62c_1005x603.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The attack involved two main steps:</p><ol><li><p>A key internal variable (e.g., <code>v51</code>) was set to USDC, bypassing intended routing logic.</p></li><li><p>A low-level call was executed using attacker-controlled calldata, resulting in <code>USDC.transferFrom()</code> being invoked, draining all approved USDC from users.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!baVY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!baVY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 424w, https://substackcdn.com/image/fetch/$s_!baVY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 848w, https://substackcdn.com/image/fetch/$s_!baVY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 1272w, https://substackcdn.com/image/fetch/$s_!baVY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!baVY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png" width="1456" height="543" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:543,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:239662,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/188993248?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!baVY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 424w, https://substackcdn.com/image/fetch/$s_!baVY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 848w, https://substackcdn.com/image/fetch/$s_!baVY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 1272w, https://substackcdn.com/image/fetch/$s_!baVY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d04ce52-89f1-440f-be2a-e43a6e0cd545_1485x554.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After the initial exploit on Base, the attacker swapped approximately <strong>$10.5M in USDC</strong> for <strong>~3,655 ETH</strong>, then bridged the stolen funds to the Ethereum mainnet to obscure the transaction trail. The attacker continued to drain 17 additional users across 3 chains before SwapNet paused contracts ~45 minutes later.</p><h2><strong>Conclusion</strong></h2><p>The SwapNet exploit demonstrates the dangers of <strong>closed-source smart contracts</strong> and <strong>arbitrary-call vulnerabilities</strong> in DeFi protocols:</p><ol><li><p><strong>Insufficient Input Validation</strong>: The function lacked proper validation on the call target address. By replacing the expected router/pool address with a token address (e.g., USDC), the attacker tricked the contract into executing <code>transferFrom()</code> with attacker-controlled parameters.</p></li><li><p><strong>Closed-Source Risk</strong>: Because SwapNet&#8217;s contracts were not verified on block explorers, the community could not review the code for vulnerabilities. The arbitrary-call flaw might have been caught through standard code review or audit.</p></li><li><p><strong>Persistent Approval Danger</strong>: Users who granted infinite approvals directly to the SwapNet Router were exposed to maximum risk. The exploit drained the full approved balance, not just the amount from a single swap.</p></li><li><p><strong>Missing Call Target Whitelist</strong>: The contract should have maintained a whitelist of valid DEX router addresses and rejected calls to any other address, especially token contract addresses.</p></li></ol><p>This attack highlights the importance of open-source smart contracts, proper input validation on low-level calls, and the use of per-transaction approval patterns instead of persistent infinite approvals. The <strong>$13.4M loss</strong> could have been prevented through call target whitelisting, function selector validation, and open-source code review.</p>]]></content:encoded></item><item><title><![CDATA[Analyzing the $4M Makina Finance Exploit]]></title><description><![CDATA[Overview]]></description><link>https://blog.verichains.io/p/analyzing-the-4m-makina-finance-exploit</link><guid isPermaLink="false">https://blog.verichains.io/p/analyzing-the-4m-makina-finance-exploit</guid><dc:creator><![CDATA[th13vn]]></dc:creator><pubDate>Mon, 26 Jan 2026 11:20:23 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FhS5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Overview</h2><p>On January 20, 2026, Makina Finance fell victim to a sophisticated oracle manipulation attack, resulting in a loss of approximately <strong>$4.13 million</strong>. The attacker exploited the protocol&#8217;s reliance on spot pricing from a Curve Finance pool to manipulate the value of the <code>MachineShareOracle</code>. By heavily distorting the liquidity in the underlying DUSD/USDC pool via a flash loan, the attacker was able to artificially inflate the share price, deposit assets at this manipulated value, and subsequently exit with a significant profit.</p><ul><li><p><strong>Attack Transaction: </strong><a href="https://etherscan.io/tx/0x569733b8016ef9418f0b6bde8c14224d9e759e79301499908ecbcd956a0651f5">0x569733b8016ef9418f0b6bde8c14224d9e759e79301499908ecbcd956a0651f5</a></p></li><li><p><strong>Attacker Address:</strong> <a href="https://etherscan.io/address/0x935bfb495e33f74d2e9735df1da66ace442ede48">0x935bfb495E33f74d2E9735DF1DA66acE442ede48</a></p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FhS5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FhS5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 424w, https://substackcdn.com/image/fetch/$s_!FhS5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 848w, https://substackcdn.com/image/fetch/$s_!FhS5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 1272w, https://substackcdn.com/image/fetch/$s_!FhS5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FhS5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png" width="560" height="684" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:684,&quot;width&quot;:560,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:255285,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185827588?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FhS5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 424w, https://substackcdn.com/image/fetch/$s_!FhS5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 848w, https://substackcdn.com/image/fetch/$s_!FhS5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 1272w, https://substackcdn.com/image/fetch/$s_!FhS5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa29762ea-47ea-4e0b-9a6f-d7363543ef91_560x684.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Deep Dive</strong></h2><h3><strong>Attack Flow</strong></h3><p>The exploitation followed a classic &#8220;pump-and-dump&#8221; pattern using flash loan liquidity to skew on-chain price feeds.</p><ol><li><p><strong>Flash Loan:</strong> The attacker borrowed a massive amount of liquidity (approximately <strong>280 million USDC</strong>) to secure the capital needed for manipulation.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N7zt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N7zt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 424w, https://substackcdn.com/image/fetch/$s_!N7zt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 848w, https://substackcdn.com/image/fetch/$s_!N7zt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 1272w, https://substackcdn.com/image/fetch/$s_!N7zt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N7zt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png" width="1316" height="140" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:140,&quot;width&quot;:1316,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59488,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185827588?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!N7zt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 424w, https://substackcdn.com/image/fetch/$s_!N7zt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 848w, https://substackcdn.com/image/fetch/$s_!N7zt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 1272w, https://substackcdn.com/image/fetch/$s_!N7zt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F974ecdda-2b31-48f3-b503-b15323c8ef84_1316x140.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p></p></li><li><p><strong>Market Distortion:</strong> The attacker deployed roughly 170 million USDC into the <strong>DUSD/USDC Curve pool</strong>. This unbalanced the pool significantly, distorting the output of <code>calc_withdraw_one_coin</code> and the spot price reported by the pool.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Duhb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Duhb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 424w, https://substackcdn.com/image/fetch/$s_!Duhb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 848w, https://substackcdn.com/image/fetch/$s_!Duhb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 1272w, https://substackcdn.com/image/fetch/$s_!Duhb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Duhb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png" width="1238" height="68" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:68,&quot;width&quot;:1238,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:25216,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185827588?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Duhb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 424w, https://substackcdn.com/image/fetch/$s_!Duhb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 848w, https://substackcdn.com/image/fetch/$s_!Duhb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 1272w, https://substackcdn.com/image/fetch/$s_!Duhb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff10c5bf3-3ab2-4404-893a-2b900d1c73e6_1238x68.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div></li><li><p><strong>Oracle Update:</strong> Makina&#8217;s <code>MachineShareOracle</code> updated its internal price based on this manipulated state. Because the protocol relied on the spot liquidity/balance of the Curve pool without sufficient Time-Weighted Average Price (TWAP) or liquidity cap checks, the <code>sharePrice</code> was artificially inflated.</p></li><li><p><strong>Arbitrage Execution:</strong></p><ul><li><p>With the <code>sharePrice</code> inflated, the attacker interacted with the <strong>Makina Machine</strong>, depositing/swapping the remaining 110 million USDC against the protocol&#8217;s liquidity.</p></li><li><p>Due to the distorted valuation, the protocol credited the attacker with significantly more shares/value than the true market rate.</p></li></ul></li><li><p><strong>Exit &amp; Profit:</strong> The attacker reversed the pool manipulation (or simply withdrew) and paid back the flash loan, pocketing the difference&#8212;roughly <strong>$4.13M</strong> (mostly captured by an MEV builder).</p></li></ol><h3><strong>Root Cause</strong></h3><p>The core vulnerability was the protocol&#8217;s dependency on a <strong>spot price oracle</strong> derived from a manipulatable liquidity pool (Curve). In DeFi, relying on the instantaneous balance or <code>get_dy</code>/<code>calc_withdraw_one_coin</code> of an AMM pool is inherently risky if the pool&#8217;s liquidity is low relative to the potential flash loan size. The <code>MachineShareOracle </code>failed to filter out the extreme volatility introduced by the flash loan.</p><h3>Recommendations</h3><ul><li><p><strong>Implement TWAP Oracles:</strong> Replace spot price feeds with Time-Weighted Average Price (TWAP) oracles (e.g., Chainlink, Uniswap V3 TWAP) to smooth out price spikes within a single block.</p></li><li><p><strong>Flash Loan Protection:</strong> Disallow critical share price updates or deposits/withdrawals in the same transaction as massive liquidity shifts (though this can be bypassed with multi-block attacks, it raises the cost).</p></li><li><p><strong>Liquidity &amp; Slippage Checks:</strong> Implement strict deviation checks. If the on-chain price deviates significantly from an external benchmark (or a secondary oracle), the transaction should revert.</p></li></ul><h2>Conclusion</h2><p>The Makina Finance incident serves as a stark reminder that <strong>oracle design is the bedrock of DeFi security</strong>. Even with complex logic, the external dependency on AMM states requires rigorous threat modeling against flash loans.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.verichains.io/subscribe?"><span>Subscribe now</span></a></p><p>However, internal testing is rarely enough. To avoid becoming another statistic in a post-mortem thread, protocols must prioritize rigorous audits from top-tier firms that specialize in complex attack vectors. </p>]]></content:encoded></item><item><title><![CDATA[MSCST Flash Loan Attack: Price Manipulation Exploit]]></title><description><![CDATA[$130K BSC Drain: Flash Loan Unlocks Unprotected Rewards]]></description><link>https://blog.verichains.io/p/mscst-flash-loan-attack-price-manipulation</link><guid isPermaLink="false">https://blog.verichains.io/p/mscst-flash-loan-attack-price-manipulation</guid><dc:creator><![CDATA[HL]]></dc:creator><pubDate>Tue, 20 Jan 2026 07:16:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!sVNs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Overview</h1><p>On December 29, 2025, the <strong>MSCST</strong> smart contract on <strong>Binance Smart Chain (BSC)</strong> was exploited through a flash loan attack, resulting in the theft of approximately <strong>149 BNB</strong> (~$130,000). The attacker exploited a critical vulnerability in the <code>releaseReward()</code> function to manipulate the GPC/WBNB liquidity pool price on PancakeSwap and extract profit in a single transaction.</p><h1>Technical Analysis of the Exploit</h1><h2>Incident Overview</h2><p><strong>Date:</strong> December 29, 2025</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p><strong>MSCST Smart Contract</strong>: <a href="https://bscscan.com/address/0x91334d03dd9b9de8d48b50fe389337eeb759aeb1">0xccd04073f4bdc4510927ea9ba350875c3c65bf81</a></p><p><strong>Exploiter Address:</strong> <a href="https://bscscan.com/address/0xB0720D8541cD2b6fC35cCC39ec84e84383A7000b">0xB0720D8541cD2b6fC35cCC39ec84e84383A7000b</a></p><p><strong>Attack Transaction:</strong> <a href="https://bscscan.com/tx/0x6c9ed4c2d81b6abfdf297b0cbc13585ed91f2a5e69e3545d3ea4316f50021b56">0x53fe7ef190c34d810c50fb66f0fc65a1ceedc10309cf4b4013d64042a0331156</a></p><h2>Root Cause</h2><p><strong>The MSCST Smart Contract</strong> contains a <code>releaseReward</code> function that accepts an amount parameter. The function swaps half of this amount from MSC tokens to GPC tokens, then transfers the swapped GPC directly to the GPC/WBNB pool. However, the function lacks access control, allowing anyone to call it. The attacker exploited this vulnerability using flash loan techniques to manipulate the GPC/WBNB pool price and extract profit</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!np4p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!np4p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 424w, https://substackcdn.com/image/fetch/$s_!np4p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 848w, https://substackcdn.com/image/fetch/$s_!np4p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 1272w, https://substackcdn.com/image/fetch/$s_!np4p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!np4p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png" width="482" height="136" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:136,&quot;width&quot;:482,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26740,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185145627?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!np4p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 424w, https://substackcdn.com/image/fetch/$s_!np4p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 848w, https://substackcdn.com/image/fetch/$s_!np4p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 1272w, https://substackcdn.com/image/fetch/$s_!np4p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7bf4fa9-3c2b-4be1-aeb0-b16f41ae1379_482x136.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">The releaseReward function</figcaption></figure></div><p>.</p><h2>Attack Flow</h2><p>Below are the detailed steps describing how the attacker exploited the access control vulnerability and flash loan technique for profit.</p><ol><li><p><strong>Flash Loan Liquidity</strong>: Borrowed <strong>46.8M GPC tokens</strong> from a BSC flash loan provider (no collateral needed due to atomic repayment).</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OqY5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OqY5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 424w, https://substackcdn.com/image/fetch/$s_!OqY5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 848w, https://substackcdn.com/image/fetch/$s_!OqY5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 1272w, https://substackcdn.com/image/fetch/$s_!OqY5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OqY5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png" width="1456" height="174" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:174,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:216468,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185145627?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OqY5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 424w, https://substackcdn.com/image/fetch/$s_!OqY5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 848w, https://substackcdn.com/image/fetch/$s_!OqY5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 1272w, https://substackcdn.com/image/fetch/$s_!OqY5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa16c3a2c-0b6a-4418-a6b8-553f201a1bb9_2872x344.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">The attacker borrowed 46.8M GPC tokens via flash loan</figcaption></figure></div></li><li><p><strong>Price Manipulation (Push Down)</strong>: Swapped the entire <strong>46.8M GPC</strong> for <strong>205 BNB</strong> in PancakeSwap pool <strong>0x12dA&#8230;8D64D9</strong>, crashing the GPC price. This maximized profit by artificially depressing the price before calling <code>releaseReward</code> in the next step.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sVNs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sVNs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 424w, https://substackcdn.com/image/fetch/$s_!sVNs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 848w, https://substackcdn.com/image/fetch/$s_!sVNs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 1272w, https://substackcdn.com/image/fetch/$s_!sVNs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sVNs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png" width="1456" height="318" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:318,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:456126,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185145627?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sVNs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 424w, https://substackcdn.com/image/fetch/$s_!sVNs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 848w, https://substackcdn.com/image/fetch/$s_!sVNs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 1272w, https://substackcdn.com/image/fetch/$s_!sVNs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec6c6c40-b530-42bd-9751-c162b5c3980b_3082x674.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Swap borrowed GPC for WBNB</figcaption></figure></div></li><li><p><strong>Exploit </strong><code>releaseReward()</code><strong>:</strong> The attacker invoked the unprotected <code>releaseReward()</code> function, which swapped half the MSC balance for GPC and added it directly to the GPC/WBNB pool. This drove the GPC price down further, amplifying the manipulation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vPUn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vPUn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 424w, https://substackcdn.com/image/fetch/$s_!vPUn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 848w, https://substackcdn.com/image/fetch/$s_!vPUn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 1272w, https://substackcdn.com/image/fetch/$s_!vPUn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vPUn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png" width="1456" height="421" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:421,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:378417,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185145627?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vPUn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 424w, https://substackcdn.com/image/fetch/$s_!vPUn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 848w, https://substackcdn.com/image/fetch/$s_!vPUn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 1272w, https://substackcdn.com/image/fetch/$s_!vPUn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc99f803-a7e1-4692-a310-48af2bc40b31_2378x688.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The attacker triggered the releaseReward() function</figcaption></figure></div></li><li><p><strong>Profit Extraction</strong>: After the steps above, the GPC price in the GPC/WBNB pool was artificially depressed. The attacker used the 205 WBNB obtained in step 2 to buy back GPC and repay the flash loan. Due to the suppressed GPC price, the attacker spent only ~55 BNB on the buyback and pocketed <strong>~149 BNB (~$130K)</strong> in profit.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fbc-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fbc-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 424w, https://substackcdn.com/image/fetch/$s_!fbc-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 848w, https://substackcdn.com/image/fetch/$s_!fbc-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 1272w, https://substackcdn.com/image/fetch/$s_!fbc-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fbc-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png" width="1456" height="198" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:198,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:284211,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/185145627?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fbc-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 424w, https://substackcdn.com/image/fetch/$s_!fbc-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 848w, https://substackcdn.com/image/fetch/$s_!fbc-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 1272w, https://substackcdn.com/image/fetch/$s_!fbc-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab55383f-7dfc-488e-8b50-eb3b6c8a0441_3050x414.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">The attacker extracted profit after buying back GPC and repaying the flash loan</figcaption></figure></div></li></ol><h2>Lessons Learned</h2><ul><li><p><strong>Gate reward functions with ACL</strong>: The public <code>releaseReward()</code> function allowed anyone to trigger payouts during manipulated states. Basic <code>onlyOwner</code>, timelocks, or role-based access control would have blocked flash loan attacks entirely, preventing attackers from abusing internal accounting logic.</p></li><li><p><strong>Replace spot oracles with TWAP</strong>: Direct PancakeSwap reserve reads via <code>sync()</code> created a trivially manipulable price feed. Protocols must use time-weighted average prices (30&#8211;60 min windows) or Chainlink oracles to filter out short-term distortions from flash loan sandwiches. </p></li><li><p><strong>Enforce slippage protection on swaps</strong>: Accepting zero minimum output enabled extreme price impacts without reverts. Every DEX operation needs realistic bounds (0.5&#8211;5% caps based on pool depth) to reject manipulative trades before they cascade into reward exploits. </p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Truebit Hack Analysis]]></title><description><![CDATA[On January 8, 2026, Truebit was exploited, resulting in an estimated loss of approximately $26.6 million. The attacker appears to have minted a large amount of TRU tokens and subsequently swapped them for ETH to realize the profit.]]></description><link>https://blog.verichains.io/p/truebit-hack-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/truebit-hack-analysis</guid><dc:creator><![CDATA[LCD]]></dc:creator><pubDate>Mon, 12 Jan 2026 13:01:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!maMt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On January 8, 2026, Truebit was exploited, resulting in an estimated loss of approximately <strong>$26.6 million</strong>. The attacker appears to have minted a large amount of <code>TRU</code> tokens and subsequently swapped them for <code>ETH</code> to realize the profit.</p><h1>Overview</h1><p><strong>Attacker</strong>: <a href="https://etherscan.io/address/0x6c8ec8f14be7c01672d31cfa5f2cefeab2562b50">0x6C8EC8f14bE7C01672d31CFa5f2CEfeAB2562b50</a></p><p><strong>Attacker&#8217;s contract</strong>: <a href="https://etherscan.io/address/0x1de399967b206e446b4e9aeeb3cb0a0991bf11b8">0x1De399967B206e446B4E9AeEb3Cb0A0991bF11b8</a></p><p><strong>Vulnerable Contracts</strong>: <a href="https://etherscan.io/address/0xc186e6f0163e21be057e95aa135edd52508d14d3">0xC186e6F0163e21be057E95aA135eDD52508D14d3</a></p><p><strong>Attack transaction</strong>: <a href="https://etherscan.io/tx/0xcd4755645595094a8ab984d0db7e3b4aabde72a5c87c4f176a030629c47fb014">0xcd4755645595094a8ab984d0db7e3b4aabde72a5c87c4f176a030629c47fb014</a></p><h1>Analysis</h1><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!maMt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!maMt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 424w, https://substackcdn.com/image/fetch/$s_!maMt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 848w, https://substackcdn.com/image/fetch/$s_!maMt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 1272w, https://substackcdn.com/image/fetch/$s_!maMt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!maMt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png" width="1456" height="442" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:442,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:216810,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!maMt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 424w, https://substackcdn.com/image/fetch/$s_!maMt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 848w, https://substackcdn.com/image/fetch/$s_!maMt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 1272w, https://substackcdn.com/image/fetch/$s_!maMt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F421879be-da70-45bc-b2e4-ea76a32d1acc_1596x484.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Figure 1: The beginning of attack transaction</figcaption></figure></div><p>When examining the transaction, we observed that <code>getPurchasePrice()</code> unexpectedly returned <code>0</code>, allowing the attacker to acquire approximately 240 million <code>TRU</code> tokens at no cost.</p><p>As the implementation source code is not verified, the following is a decompiled representation of the contract:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4xxR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4xxR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 424w, https://substackcdn.com/image/fetch/$s_!4xxR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 848w, https://substackcdn.com/image/fetch/$s_!4xxR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 1272w, https://substackcdn.com/image/fetch/$s_!4xxR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4xxR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png" width="1456" height="867" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:867,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:263326,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4xxR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 424w, https://substackcdn.com/image/fetch/$s_!4xxR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 848w, https://substackcdn.com/image/fetch/$s_!4xxR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 1272w, https://substackcdn.com/image/fetch/$s_!4xxR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44cc9908-f782-4614-904b-14f1e56c4fea_1712x1020.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Figure 2: The decompiled code of implementation</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kkR5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kkR5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 424w, https://substackcdn.com/image/fetch/$s_!kkR5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 848w, https://substackcdn.com/image/fetch/$s_!kkR5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 1272w, https://substackcdn.com/image/fetch/$s_!kkR5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kkR5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png" width="1442" height="1764" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/feb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1764,&quot;width&quot;:1442,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:296352,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kkR5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 424w, https://substackcdn.com/image/fetch/$s_!kkR5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 848w, https://substackcdn.com/image/fetch/$s_!kkR5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 1272w, https://substackcdn.com/image/fetch/$s_!kkR5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeb199b5-0f77-4999-91dd-0fde4f9e7dee_1442x1764.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Figure 3: Helper functions</figcaption></figure></div><p>The helper functions implement multiplication, subtraction, and division, respectively. The function <code>0x1446</code> returns:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;purchasePrice = \\mathrm{amount} \\times \\mathrm{reserve} \\times \\frac{100 \\times \\mathrm{amount} + 200 \\times \\mathrm{totalSupply} }{(100 - setParameters) \\times \\mathrm{totalSupply}^2}&quot;,&quot;id&quot;:&quot;PEHAMVFVFP&quot;}" data-component-name="LatexBlockToDOM"></div><p>Next, we recover the input arguments of the function above from contract&#8217;s storage:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eYTo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eYTo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 424w, https://substackcdn.com/image/fetch/$s_!eYTo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 848w, https://substackcdn.com/image/fetch/$s_!eYTo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 1272w, https://substackcdn.com/image/fetch/$s_!eYTo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eYTo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png" width="700" height="180" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:180,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56054,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eYTo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 424w, https://substackcdn.com/image/fetch/$s_!eYTo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 848w, https://substackcdn.com/image/fetch/$s_!eYTo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 1272w, https://substackcdn.com/image/fetch/$s_!eYTo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab3a7847-419b-43ca-a4a7-e34fd5e234dc_700x180.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 4: Storage layout of implementation</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UYbS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UYbS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 424w, https://substackcdn.com/image/fetch/$s_!UYbS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 848w, https://substackcdn.com/image/fetch/$s_!UYbS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 1272w, https://substackcdn.com/image/fetch/$s_!UYbS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UYbS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png" width="1456" height="257" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69379d04-73a7-4008-9638-34db06a25b83_1680x296.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:257,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:351272,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UYbS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 424w, https://substackcdn.com/image/fetch/$s_!UYbS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 848w, https://substackcdn.com/image/fetch/$s_!UYbS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 1272w, https://substackcdn.com/image/fetch/$s_!UYbS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69379d04-73a7-4008-9638-34db06a25b83_1680x296.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Figure 5: Value of input arguments</figcaption></figure></div><p>Finally, we can trace the entire function 0x1446 in detail:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lrc6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lrc6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 424w, https://substackcdn.com/image/fetch/$s_!Lrc6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 848w, https://substackcdn.com/image/fetch/$s_!Lrc6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 1272w, https://substackcdn.com/image/fetch/$s_!Lrc6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lrc6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png" width="1456" height="598" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d6406560-8585-455f-a2e8-1b88cd872532_1490x612.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:598,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:548090,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Lrc6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 424w, https://substackcdn.com/image/fetch/$s_!Lrc6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 848w, https://substackcdn.com/image/fetch/$s_!Lrc6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 1272w, https://substackcdn.com/image/fetch/$s_!Lrc6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6406560-8585-455f-a2e8-1b88cd872532_1490x612.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The function should return <code>0x257c81b45b8f232c462e</code>, but in reality it returns <code>0</code>. <strong>So the big question is &#8212; why?</strong></p><p>At the end of the function, we have <code>v13 = (v12 + v9) / v6</code>. Since both <code>v12</code> and <code>v9</code> are &#8220;close&#8221; to the maximum value of <code>uint256</code>, their sum overflows, which leads to an incorrect result. This overflow is the root cause of the incident.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MKxH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MKxH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 424w, https://substackcdn.com/image/fetch/$s_!MKxH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 848w, https://substackcdn.com/image/fetch/$s_!MKxH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 1272w, https://substackcdn.com/image/fetch/$s_!MKxH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MKxH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png" width="1321" height="481" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:481,&quot;width&quot;:1321,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:214349,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/184286748?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MKxH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 424w, https://substackcdn.com/image/fetch/$s_!MKxH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 848w, https://substackcdn.com/image/fetch/$s_!MKxH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 1272w, https://substackcdn.com/image/fetch/$s_!MKxH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87a3224c-c4ce-49bd-a9c1-1457f1d8f6a3_1321x481.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In the rest of the attack transaction, the attacker repeatedly executes the same steps to drain the protocol&#8217;s <code>ETH</code>, incurring only minimal costs relative to the profit.</p><h1>Summary</h1><p>This incident highlights a critical vulnerability that was exploited after the protocol had been running for over three years without major issues, which may be partly due to the implementation being closed-source. This shows that longevity alone does not imply security, and that a lack of transparency can allow serious flaws to remain hidden until they are exploited. For this reason, we strongly recommend that projects publish their source code and undergo regular independent security audits to identify and mitigate risks before they result in real losses.</p>]]></content:encoded></item><item><title><![CDATA[JFIN Exploit Analysis]]></title><description><![CDATA[On December 20, 2025, The JFIN LCBridgev2Token was exploited on the Binance Smart Chain, resulting in the loss of approximately $15,000.]]></description><link>https://blog.verichains.io/p/jfin-exploit-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/jfin-exploit-analysis</guid><dc:creator><![CDATA[f4tu]]></dc:creator><pubDate>Tue, 06 Jan 2026 08:02:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Xz6o!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On December 20, 2025, The JFIN LCBridgev2Token was exploited on the Binance Smart Chain, resulting in the loss of approximately $15,000. Let&#8217;s take a closer look at how the attack was carried out.</p><p>Original Attacker : <a href="https://etherscan.io/address/0xb27794423b2fd4492887098166d62de142637751">https://etherscan.io/address/0xb27794423b2fd4492887098166d62de142637751</a></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Vulnerable Contract : <a href="https://etherscan.io/address/0x3EbFd0EFC49a27fb633bd56013E4220EBC2c3C6d#tokentxns">https://etherscan.io/address/0x3EbFd0EFC49a27fb633bd56013E4220EBC2c3C6d#tokentxns</a></p><p>Attack Tx : <a href="https://etherscan.io/tx/0xf867d1d7164ac9178d81696c989f65e817b8cab14850345ab3a1f99bbe547210">https://etherscan.io/tx/0xf867d1d7164ac9178d81696c989f65e817b8cab14850345ab3a1f99bbe547210</a></p><h1><strong>Analysis</strong></h1><p>This contract allows users to stake JFIN into a shared liquidity pool. When users stake, their tokens are transferred into the contract, their staked balance is recorded, and the total pool size (<code>tvl</code>) increases. The contract tracks a &#8220;reward per staked token&#8221; value (<code>rtr</code>) to distribute rewards fairly among all stakers.</p><p>Rewards primarily come from swap fees. When someone uses the bridge swap, the contract collects a small fee. Part of that fee goes to the treasury, and the rest is added to the staker rewards pool. As more fees are collected over time, <code>rtr</code> increases, meaning each staker earns more based on their stake amount and duration.</p><p>Users can claim rewards anytime with <code>claimReward()</code>. The contract calculates how much the user earned since their last update, then transfers the tokens. If the contract lacks sufficient tokens at that moment, it pays what it can and records the unpaid portion as debt (<code>debtReward</code>&#8212;calculated in <code>getReward</code>) for the user to claim later.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xz6o!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xz6o!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 424w, https://substackcdn.com/image/fetch/$s_!Xz6o!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 848w, https://substackcdn.com/image/fetch/$s_!Xz6o!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 1272w, https://substackcdn.com/image/fetch/$s_!Xz6o!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xz6o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png" width="1456" height="1111" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1111,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:303242,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183624360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xz6o!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 424w, https://substackcdn.com/image/fetch/$s_!Xz6o!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 848w, https://substackcdn.com/image/fetch/$s_!Xz6o!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 1272w, https://substackcdn.com/image/fetch/$s_!Xz6o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1c50f6c3-222f-4f9b-a3db-9ffeac2a431c_1682x1284.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The <code>getReward</code> function already returns <code>debtReward</code> plus new earned rewards. The problem lies in <code>stake</code>. Before updating the stake data, it executes: <code>userInfo[account].debtReward += getReward(account);</code> But <code>getReward(account)</code> already includes <code>userInfo[account].debtReward</code>. This means the old <code>debtReward</code> is added again into <code>debtReward</code>. An attacker can call <code>stake</code> multiple times with small amounts to inflate the <code>debtReward</code> amount.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VwOG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VwOG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 424w, https://substackcdn.com/image/fetch/$s_!VwOG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 848w, https://substackcdn.com/image/fetch/$s_!VwOG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 1272w, https://substackcdn.com/image/fetch/$s_!VwOG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VwOG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png" width="1324" height="234" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:234,&quot;width&quot;:1324,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:94527,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183624360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VwOG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 424w, https://substackcdn.com/image/fetch/$s_!VwOG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 848w, https://substackcdn.com/image/fetch/$s_!VwOG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 1272w, https://substackcdn.com/image/fetch/$s_!VwOG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa85bf45-8600-47d0-b9ed-4e650c11379b_1324x234.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In <code>swap</code>, the contract calls <code>_cutFee</code>. This step collects a fee and adds part of it to <code>totalReward</code>. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d3Zl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d3Zl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 424w, https://substackcdn.com/image/fetch/$s_!d3Zl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 848w, https://substackcdn.com/image/fetch/$s_!d3Zl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 1272w, https://substackcdn.com/image/fetch/$s_!d3Zl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d3Zl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png" width="1328" height="564" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:564,&quot;width&quot;:1328,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:116404,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183624360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!d3Zl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 424w, https://substackcdn.com/image/fetch/$s_!d3Zl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 848w, https://substackcdn.com/image/fetch/$s_!d3Zl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 1272w, https://substackcdn.com/image/fetch/$s_!d3Zl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc85dec6e-2cdf-44dd-a356-5d19d3390670_1328x564.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When someone later calls <code>stake</code>, the contract updates <code>rtr</code> with the pending reward using: new <code>rtr</code> = <code>totalReward - prevReward</code>. After this update, <code>prevReward</code> becomes <code>totalReward</code>, and <code>rtr</code> becomes the new baseline. Since the new <code>rtr</code> is always greater than or equal to the current <code>rtr</code>, rewards always increase with <code>rtr</code> (or <code>totalReward</code>).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9L8e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9L8e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 424w, https://substackcdn.com/image/fetch/$s_!9L8e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 848w, https://substackcdn.com/image/fetch/$s_!9L8e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 1272w, https://substackcdn.com/image/fetch/$s_!9L8e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9L8e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png" width="1456" height="723" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:723,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:180916,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183624360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9L8e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 424w, https://substackcdn.com/image/fetch/$s_!9L8e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 848w, https://substackcdn.com/image/fetch/$s_!9L8e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 1272w, https://substackcdn.com/image/fetch/$s_!9L8e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff28a39ba-81e4-4a85-925f-f58b0b1c2f75_1590x790.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The attacker first staked an amount of JFIN, then called swap to increase <code>totalReward</code>. After that, they called <code>stake</code> 20 times with amount <code>1</code> to inflate the reward. Finally, they called <code>claimReward</code> to drain the manipulated reward.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ecO_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ecO_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 424w, https://substackcdn.com/image/fetch/$s_!ecO_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 848w, https://substackcdn.com/image/fetch/$s_!ecO_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 1272w, https://substackcdn.com/image/fetch/$s_!ecO_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ecO_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png" width="1456" height="1019" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1019,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:766300,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183624360?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ecO_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 424w, https://substackcdn.com/image/fetch/$s_!ecO_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 848w, https://substackcdn.com/image/fetch/$s_!ecO_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 1272w, https://substackcdn.com/image/fetch/$s_!ecO_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47d09e54-1d07-444e-92a3-ddb2e06c727c_1980x1386.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1><strong>Conclusion</strong></h1><p>This vulnerability exploits a critical flaw in the reward accounting logic of the staking contract. The double-counting issue in the <code>stake </code>function allows attackers to exponentially inflate their <code>debtReward </code>balance by repeatedly staking minimal amounts. Each call compounds the existing debt into the new calculation, creating artificial rewards without legitimate basis. Furthermore, calculating rewards based on <code>totalReward </code>instead of available funds also enables exploitation.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Post-Mortem: Prism Protocol Liquidity Pool Burn Exploit]]></title><description><![CDATA[On December 11, 2025, at 11:54 AM UTC, Prism Protocol was exploited through improper role management that allowed a malicious contract to burn tokens directly from the PancakeSwap liquidity pair.]]></description><link>https://blog.verichains.io/p/post-mortem-prism-protocol-liquidity</link><guid isPermaLink="false">https://blog.verichains.io/p/post-mortem-prism-protocol-liquidity</guid><dc:creator><![CDATA[lifebow]]></dc:creator><pubDate>Sat, 03 Jan 2026 02:03:15 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XZCb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F20abd958-d8c9-49ef-8c21-44117564e63e_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On <strong>December 11, 2025, at 11:54 AM UTC</strong>, Prism Protocol was exploited through improper role management that allowed a malicious contract to burn tokens directly from the PancakeSwap liquidity pair. By abusing the centralized <strong>SniperManager </strong>permission, the attacker drained liquidity and executed a highly profitable trade within a single transaction.</p><h2>Incident Overview</h2><p><strong>Date:</strong> Dec 11, 2025</p><p><strong>Platform:</strong> Binance Smart Chain (BSC)</p><p><strong>Attacker Address:</strong> 0x24A619dCe92c38d5Fef9733f9A37050742141647</p><p><strong>Attack Contract</strong>: 0x2E857bC277Eb049Fb4f27911e4c3498cEFC1A1dd</p><p><strong>Prism Token Contract:</strong> 0x1284c1f20A7F0322A5E17618f764F0d3CBAcCeE9</p><p><strong>Attack Transaction:</strong> 0xcf7cacfe38dcf090bbfcc91634de364e62ef3715fdc8d6f69e855772b0862237</p><h2>Exploit Mechanics</h2><p>All steps below were executed within a single transaction by the attack contract:</p><ol><li><p>Purchased <strong>67,750 PRISM</strong> from PancakePair using <strong>0.01 BNB</strong>.</p></li><li><p>Invoked <code>BurnSniperTokenBought</code> on the PrismToken contract <strong>four times</strong>, reducing the Prism balance inside <strong>PancakePair</strong> from <strong>485,826,708 PRISM</strong> to <strong>480 PRISM</strong>.</p></li><li><p>Sold the <strong>67,750 PRISM</strong> obtained in step 1 back to the PancakePair, receiving <strong>71.5 BNB</strong>, equivalent to approximately <strong>$62,000 USD</strong> at the time of the attack.</p></li></ol><h3><strong>Root Cause Analysis</strong></h3><p>The core issue lies in how the Prism protocol allows a contract to burn tokens belonging to the PancakePair.</p><p>Specifically, the <code>BurnSniperTokensBought</code> function permits burning tokens from an address flagged as a sniper. While this function is protected by the <code>onlySniperManager</code> modifier&#8212;restricting access to authorized roles&#8212;the attacker was able to exploit role assignment rather than the function logic itself.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!INK9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!INK9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 424w, https://substackcdn.com/image/fetch/$s_!INK9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 848w, https://substackcdn.com/image/fetch/$s_!INK9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 1272w, https://substackcdn.com/image/fetch/$s_!INK9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!INK9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png" width="687" height="378" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:378,&quot;width&quot;:687,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37050,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183035412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!INK9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 424w, https://substackcdn.com/image/fetch/$s_!INK9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 848w, https://substackcdn.com/image/fetch/$s_!INK9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 1272w, https://substackcdn.com/image/fetch/$s_!INK9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75aba72c-fb30-4bfc-b363-ee168d99910e_687x378.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Upon reviewing Prism protocol interaction transactions, we identified transaction</p><p><code>0x23879edbd3366cdc774aaa72a8484b7f7ef641f68f01345764bf44d812d042a6</code> This transaction shows that a <strong>SniperManager role was granted to the attack contract prior to the exploit</strong>. As a result, the attacker gained permission to call <code>BurnSniperTokensBought</code> and burn tokens directly from the PancakePair.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hSSR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hSSR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 424w, https://substackcdn.com/image/fetch/$s_!hSSR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 848w, https://substackcdn.com/image/fetch/$s_!hSSR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 1272w, https://substackcdn.com/image/fetch/$s_!hSSR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hSSR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png" width="705" height="197" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb05a707-49b5-4b34-b4fc-02e283741436_705x197.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:197,&quot;width&quot;:705,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72983,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183035412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hSSR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 424w, https://substackcdn.com/image/fetch/$s_!hSSR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 848w, https://substackcdn.com/image/fetch/$s_!hSSR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 1272w, https://substackcdn.com/image/fetch/$s_!hSSR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb05a707-49b5-4b34-b4fc-02e283741436_705x197.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Conclusion</h2><p>The <code>BurnSniperTokenBought</code> function itself is not inherently vulnerable; it behaves as designed.</p><p>The <strong>true root cause</strong> of the attack was <strong>operational failure by the Prism protocol operator team</strong>, who mistakenly approved a malicious contract as a <code>SniperManager</code>.</p><p>Additionally, <code>BurnSniperTokenBought</code> represents a <strong>highly centralized control mechanism</strong>, which is inappropriate for a decentralized smart contract system. Granting privileged roles that can arbitrarily burn third-party balances&#8212;especially liquidity pool addresses&#8212;introduces significant systemic risk.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Governance Attack: Flashloan Vote Manipulation]]></title><description><![CDATA[FutureSwapX Governance Attack: Flashloan Vote Manipulation]]></description><link>https://blog.verichains.io/p/governance-attack-flashloan-vote</link><guid isPermaLink="false">https://blog.verichains.io/p/governance-attack-flashloan-vote</guid><dc:creator><![CDATA[TK]]></dc:creator><pubDate>Thu, 01 Jan 2026 07:01:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!yrhy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1><strong>FutureSwapX Governance Attack: Flashloan Vote Manipulation</strong></h1><p>On December 14, 2025, a critical vulnerability was exploited in the <strong>FutureSwapX</strong> governance system, resulting in an estimated loss of approximately $500,000. The attacker exploited the snapshot mechanism of the FST token in conjunction with the governance proposal creation flow, allowing them to use flashloaned tokens for voting power.</p><h2><strong>Overview</strong></h2><p><strong>Attacker:</strong> <a href="https://etherscan.io/address/0xcd7c839c6814234601fe7719da21a980c1a8184e">0xcd7c839c6814234601fe7719da21a980c1a8184e</a></p><p><strong>Vulnerable Contracts:</strong></p><ul><li><p>FST Token: <a href="https://etherscan.io/address/0x0e192d382a36de7011f795acc4391cd302003606">0x0e192d382a36de7011f795acc4391cd302003606</a></p></li><li><p>Governance: <a href="https://etherscan.io/address/0x0a7f8161605acc552fa38fdb8ee7d8177c9ac22a">0x0a7f8161605acc552fa38fdb8ee7d8177c9ac22a</a></p></li></ul><p><strong>Exploit TX:</strong> <a href="https://etherscan.io/tx/0x23c6a1e3fa409fcf17b4a6c385924a17546772ce77b314d001cbf0dab9469ba3">0x23c6a1e3fa409fcf17b4a6c385924a17546772ce77b314d001cbf0dab9469ba3</a></p><h2><strong>Exploit Analysis</strong></h2><p>The <strong>FutureSwapX</strong> governance system uses an ERC20 token (FST) with a snapshot mechanism for voting. When a proposal is created, the contract takes a snapshot of token balances to determine voting power. The vulnerability lies in the order of operations during proposal creation.</p><h3><strong>Attack Flow</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yrhy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yrhy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 424w, https://substackcdn.com/image/fetch/$s_!yrhy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 848w, https://substackcdn.com/image/fetch/$s_!yrhy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 1272w, https://substackcdn.com/image/fetch/$s_!yrhy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yrhy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png" width="1456" height="477" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:477,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:368020,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/182936558?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yrhy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 424w, https://substackcdn.com/image/fetch/$s_!yrhy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 848w, https://substackcdn.com/image/fetch/$s_!yrhy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 1272w, https://substackcdn.com/image/fetch/$s_!yrhy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F31a663fa-ffc4-4398-b00e-0e0651f5996e_1879x616.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>The attack was executed in a single atomic transaction:</p><div><hr></div><h4><strong>Step 1: Flashloan FST Tokens</strong></h4><p>The attacker borrowed approximately 3.6 million FST tokens via flashloan. At this point, the attacker&#8217;s balance is inflated but only temporarily.</p><p><strong>State after this step:</strong></p><ul><li><p><code>_balanceOf[attacker]</code> = 3,600,000 FST</p></li><li><p>Global <code>_snapshot</code> = 52</p></li><li><p>Attacker&#8217;s last checkpoint = None or older snapshot</p></li></ul><div><hr></div><h4><strong>Step 2: Create Proposal - Snapshot is Taken</strong></h4><p>The attacker called <code>createProposal()</code> on the governance contract. This function performs two critical operations in sequence. First, it calls <code>snapshot()</code> on the FST token:</p><pre><code><code>require(bool(_votingToken.code.size));
v48, /* uint256 */ v49 = _votingToken.snapshot().gas(msg.gas);
require(bool(v48), 0, RETURNDATASIZE());
require(MEM[64] + RETURNDATASIZE() - MEM[64] &gt;= 32);
_proposals[_proposalCount].field5 = v49;  // Save snapshot ID for this proposal
</code></code></pre><p>The <code>snapshot()</code> function in FST token increments the global snapshot counter:</p><pre><code><code>function snapshot() public payable {
    _snapshot += 1;              // 52 &#8594; 53
    emit Snapshot(_snapshot);
    return _snapshot;
}
</code></code></pre><p><strong>State after snapshot:</strong></p><ul><li><p>Global <code>_snapshot</code> = <strong>53</strong> (just incremented)</p></li><li><p>Attacker&#8217;s last checkpoint = Still at 52 or older</p></li><li><p><code>_balanceOf[attacker]</code> = 3,600,000 FST (unchanged)</p></li></ul><div><hr></div><h4><strong>Step 3: Create Proposal - Fee Collection Triggers the Trap</strong></h4><p>Immediately after the snapshot, the governance contract calls <code>transferFrom()</code> to collect the 100 FST proposal stake:</p><pre><code><code>MEM[MEM[64] + 36] = msg.sender;
MEM[MEM[64] + 68] = address(this);
MEM[MEM[64] + 100] = 10 ** 20;  // 100 FST stake (18 decimals)
0x12d8(132 + MEM[64], 0x23b872dd00000000000000000000000000000000000000000000000000000000, _votingToken);
</code></code></pre><p>The FST token&#8217;s <code>transferFrom</code> calls the internal transfer function:</p><pre><code><code>function transferFrom(address sender, address recipient, uint256 amount) public payable {
    require(msg.data.length - 4 &gt;= 96);
    0xa94(amount, recipient, sender);  // Internal transfer
    v0 = _SafeSub('ERC20: transfer amount exceeds allowance', amount, _allowance[sender][msg.sender]);
    0x9a8(v0, msg.sender, sender);
    return True;
}
</code></code></pre><p>The internal transfer function <code>0xa94</code> triggers checkpointing <strong>before</strong> modifying balances:</p><pre><code><code>function 0xa94(uint256 varg0, uint256 varg1, uint256 varg2) private { 
    0xe45(varg2);  // &#8592; Checkpoint sender BEFORE balance change
    0xe45(varg1);  // &#8592; Checkpoint recipient BEFORE balance change
    require(address(varg2), Error('ERC20: transfer from the zero address'));
    require(address(varg1), Error('ERC20: transfer to the zero address'));
    v0 = _SafeSub('ERC20: transfer amount exceeds balance', varg0, _balanceOf[address(varg2)]);
    _balanceOf[address(varg2)] = v0;
    v1 = _SafeAdd(varg0, _balanceOf[address(varg1)]);
    _balanceOf[address(varg1)] = v1;
    emit Transfer(address(varg2), address(varg1), varg0);
    return ;
}
</code></code></pre><p>The checkpoint function <code>0xe45</code> is where the vulnerability materializes:</p><pre><code><code>function 0xe45(address varg0) private { 
    v0 = varg0;
    if (mapping_68[v0].length) {
        assert(mapping_68[v0].length - 1 &lt; mapping_68[v0].length);
        v1 = v2 = mapping_68[v0].field0[mapping_68[v0].length - 1];  // Get last checkpoint snapshot ID
    } else {
        v1 = 0;
    }
    if (v1 &lt; _snapshot) {  // attacker's last (52) &lt; current (53) = TRUE!
        mapping_68[v0].length = mapping_68[v0].length + 1;
        mapping_68[v0].field0[mapping_68[v0].length] = _snapshot;      // Record snapshot 53
        mapping_68[v0].length = mapping_68[v0].length + 1;
        mapping_68[v0].field1[mapping_68[v0].length] = _balanceOf[varg0];  // Record 3.6M FST!
    }
    return ;
}
</code></code></pre><p><strong>Critical Issue:</strong> The checkpoint records the attacker&#8217;s <strong>current balance (3.6M flashloaned tokens)</strong> as their historical balance for snapshot 53, <strong>before</strong> the 100 FST fee is deducted.</p><p><strong>State after fee collection:</strong></p><ul><li><p>Attacker&#8217;s checkpoint for snapshot 53 = <strong>3,600,000 FST</strong> (permanently recorded!)</p></li><li><p><code>_balanceOf[attacker]</code> = 3,599,900 FST (after 100 FST fee)</p></li></ul><div><hr></div><h4><strong>Step 4: Cast Vote with Inflated Power</strong></h4><p>The attacker immediately calls <code>vote()</code> on the governance contract:</p><pre><code><code>function vote(uint256 proposalId, bool support) public payable {
    require(msg.data.length - 4 &gt;= 64);
    require(proposalId &lt; _proposalCount, Error('Nonexisting proposal'));
    v0 = v1 = block.timestamp &lt;= _proposals[proposalId].field3;
    if (block.timestamp &lt;= _proposals[proposalId].field3) {
        v0 = v2 = !_proposals[proposalId].field9_0_0;
    }
    require(v0, Error('vote is not open'));
    require(!_proposals[proposalId].field8[msg.sender], Error('already voted'));
    _proposals[proposalId].field8[msg.sender] = 1;
    require(bool(_votingToken.code.size));
    v3, /* uint256 */ v4 = _votingToken.balanceOfAt(msg.sender, _proposals[proposalId].field5).gas(msg.gas);
    require(bool(v3), 0, RETURNDATASIZE());
    require(MEM[64] + RETURNDATASIZE() - MEM[64] &gt;= 32);
    if (!support) {
        v5 = _SafeAdd(_proposals[proposalId].field7, v4);
        _proposals[proposalId].field7 = v5;
    } else {
        v6 = _SafeAdd(_proposals[proposalId].field6, v4);  // v4 = 3,600,000 FST!
        _proposals[proposalId].field6 = v6;
    }
    emit VoteCasted(msg.sender, proposalId, v4, support);
}
</code></code></pre><p>The token&#8217;s <code>balanceOfAt</code> returns the recorded checkpoint balance:</p><pre><code><code>function balanceOfAt(address account, uint256 snapshotId) public payable {
    require(msg.data.length - 4 &gt;= 64);
    require(snapshotId &gt; 0, Error('ERC20Snapshot: id is 0'));
    require(snapshotId &lt;= _snapshot, Error('ERC20Snapshot: nonexistent id'));
    if (mapping_68[account].length) {
        // ... binary search logic to find snapshot ...
        v0 = v1 = mapping_68[account].length;
        v2 = v3 = 0;
        while (v2 &lt; v0) {
            // ... search for matching snapshot ID ...
        }
    }
    if (v2 != mapping_68[account].length) {
        v8 = v9 = 1;
        assert(v2 &lt; mapping_68[account].length);
        v8 = v10 = mapping_68[account].field1[v2];  // Returns recorded balance: 3,600,000 FST
    } else {
        v8 = 0;
    }
    if (!v8) {
        v8 = v11 = _balanceOf[account];  // Fallback to current balance
    }
    return v8;
}
</code></code></pre><p><strong>Result:</strong> The attacker&#8217;s vote is counted with <strong>3.6 million FST</strong> voting power.</p><div><hr></div><h4><strong>Step 5: Return Flashloan</strong></h4><p>The attacker returns the flashloaned tokens to the flashloan provider. The snapshot balance remains permanently recorded in the token contract&#8217;s history, and the proposal passes with artificially inflated votes.</p><div><hr></div><h2><strong>Conclusion</strong></h2><p>This attack demonstrates a critical design flaw in governance systems that use same-transaction snapshots. The vulnerability arises because:</p><ol><li><p><strong>Snapshot and fee collection happen atomically</strong>: The attacker can hold flashloaned tokens when the snapshot is taken.</p></li><li><p><strong>Checkpointing on first touch</strong>: The token contract records the current balance as historical data on the first transfer after a new snapshot, capturing the inflated flashloan balance.</p></li></ol><h3><strong>Recommendations</strong></h3><ul><li><p><strong>Use historical snapshots</strong>: Governance proposals should reference a snapshot taken in a previous block (e.g., <code>block.number - 1</code>), not one created in the same transaction.</p></li><li><p><strong>Timelock on voting</strong>: Require a delay between proposal creation and when voting can begin.</p></li><li><p><strong>Minimum hold time</strong>: Implement a mechanism to verify tokens were held before the snapshot, not just at the moment of the snapshot.</p></li></ul><p>Furthermore, conducting a security audit is strongly recommended for all projects, including smart contracts, backends, wallets, and dApps. Governance mechanisms in particular require careful review due to the high-value decisions they control.</p>]]></content:encoded></item><item><title><![CDATA[Trust Wallet Browser Extension Breach]]></title><description><![CDATA[On December 26, 2025, Trust Wallet users were hit by a sophisticated attack targeting the browser extension version 2.68.]]></description><link>https://blog.verichains.io/p/trust-wallet-browser-extension-breach</link><guid isPermaLink="false">https://blog.verichains.io/p/trust-wallet-browser-extension-breach</guid><dc:creator><![CDATA[nt]]></dc:creator><pubDate>Wed, 31 Dec 2025 08:29:14 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b4bd8985-5f72-4371-88e8-30d0b2295fb0_1024x567.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On December 26, 2025, Trust Wallet users were hit by a sophisticated attack targeting the browser extension version 2.68. The incident resulted in approximately $7M in stolen funds, affecting hundreds of users. CZ (Changpeng Zhao) confirmed that Trust Wallet will fully cover the losses.</p><h2><strong>Background</strong></h2><p>Trust Wallet is one of the most popular cryptocurrency wallets, offering both mobile and browser extension versions. The browser extension allows users to interact with decentralized applications (dApps) directly from their browser, storing encrypted mnemonic phrases locally.</p><p>On December 26, reports began surfacing of users having their wallets drained immediately after unlocking their Trust Wallet browser extension or importing seed phrases. Investigation revealed that version 2.68 of the extension contained malicious code that was secretly inserted during the update process.</p><h2><strong>Key Information</strong></h2><ul><li><p>Affected Version: Trust Wallet Browser Extension v2.68 only</p></li><li><p>Safe Version: v2.69 (patched)</p></li><li><p>Mobile users: NOT affected</p></li><li><p>Estimated Loss: ~$7M</p></li><li><p>Attacker&#8217;s Domain: <code>api.metrics-trustwallet[.]com</code></p></li><li><p>Hacker Wallets: <a href="https://intel.arkm.com/explorer/entity/2cd56d11-7f5b-4b00-a2e7-842663509f41">https://intel.arkm.com/explorer/entity/2cd56d11-7f5b-4b00-a2e7-842663509f41</a></p></li></ul><h2><strong>Attack Analysis</strong></h2><p>A diff comparison between v2.67 and v2.68 revealed malicious code secretly inserted into the 2.68 update. The attack flow was as follows:</p><h3><strong>Step 1: Capturing Unlock Credentials</strong></h3><p>When the user unlocks their wallet by entering their password or passkeyPassword, the malicious code intercepts and captures these credentials.</p><h3><strong>Step 2: Extracting Mnemonic Phrases</strong></h3><p>The injected code iterates through all wallets stored in the extension, triggering a <code>GET_SEED_PHRASE</code> request for each wallet. Using the captured password, the encrypted mnemonic is decrypted.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5_lZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5_lZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5_lZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5_lZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5_lZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5_lZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg" width="1292" height="1088" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1088,&quot;width&quot;:1292,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:80305,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183036078?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5_lZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5_lZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5_lZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5_lZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe31b0753-2dd0-42fd-9602-f964f0960a99_1292x1088.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Step 3: Exfiltrating Data via &#8220;Analytics&#8221;</strong></h3><p>The attacker cleverly disguised the data exfiltration as analytics traffic. The decrypted mnemonic phrase is wrapped inside the request body&#8217;s <code>errorMessage</code> field and transmitted to the malicious server at <code>https://api.metrics-trustwallet[.]com</code>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_lV7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_lV7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_lV7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_lV7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_lV7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_lV7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg" width="1400" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99842,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183036078?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_lV7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_lV7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_lV7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_lV7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0780605b-f599-4b69-ac8b-563524a46776_1400x832.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The attacker leveraged PostHog JS, an open-source analytics platform, as the data exfiltration channel. This made the malicious traffic appear as legitimate analytics data, evading basic security detection.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jotl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jotl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 424w, https://substackcdn.com/image/fetch/$s_!jotl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 848w, https://substackcdn.com/image/fetch/$s_!jotl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!jotl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jotl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg" width="1400" height="709" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:709,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:138998,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/183036078?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!jotl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 424w, https://substackcdn.com/image/fetch/$s_!jotl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 848w, https://substackcdn.com/image/fetch/$s_!jotl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!jotl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ffa1455-80d5-4e7e-a885-292b1432a347_1400x709.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2><strong>Conclusion</strong></h2><p>This attack demonstrates a sophisticated APT-level operation with several notable characteristics:</p><ol><li><p><strong>Internal Code Modification</strong>: Unlike typical supply chain attacks that inject malicious npm packages, this backdoor originated from direct modification of Trust Wallet&#8217;s internal codebase (analytics logic).</p></li><li><p><strong>Clever Disguise</strong>: The attacker used the legitimate PostHog analytics library as the data exfiltration channel, making the malicious traffic blend in with normal analytics data.</p></li><li><p><strong>Advanced Persistent Threat</strong>: The timeline suggests the attacker likely gained control of Trust Wallet developer devices or publishing/deployment permissions prior to December 8, indicating a well-planned, long-term operation.</p></li><li><p><strong>Full User Compensation</strong>: CZ confirmed that Trust Wallet will fully cover all user losses, demonstrating the importance of having a responsible incident response policy.</p></li></ol><h2><strong>Mitigation Recommendations</strong></h2><p>If you have ever installed the Trust Wallet browser extension:</p><ol><li><p><strong>Disconnect from Network</strong>: Immediately disconnect your device from the internet before performing any investigation.</p></li><li><p><strong>Export Keys</strong>: Safely export your private key/mnemonic phrase.</p></li><li><p><strong>Uninstall Extension</strong>: Remove the Trust Wallet browser extension completely.</p></li><li><p><strong>Transfer Funds</strong>: After backing up credentials, transfer your funds to a new, secure wallet with a fresh seed phrase.</p></li><li><p><strong>Upgrade if Continuing</strong>: If you must continue using Trust Wallet, ensure you&#8217;re on version 2.69 or later from the official Chrome Web Store.</p></li></ol><div><hr></div><p><em>Technical analysis and investigation credits: <a href="https://x.com/SlowMist_Team/status/2004505097049628846">SlowMist Team</a>, <a href="https://x.com/TrustWallet/status/2004316503701958786">Trust Wallet</a></em></p>]]></content:encoded></item><item><title><![CDATA[The $PORT3 Exploit: How a Missing ecrecover Zero-Check Cost Millions]]></title><description><![CDATA[Port3 Network (PORT3) Security Incident Analysis]]></description><link>https://blog.verichains.io/p/the-port3-exploit-how-a-missing-ecrecover</link><guid isPermaLink="false">https://blog.verichains.io/p/the-port3-exploit-how-a-missing-ecrecover</guid><dc:creator><![CDATA[th13vn]]></dc:creator><pubDate>Mon, 15 Dec 2025 11:18:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!pI8T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Overview</h2><p>The Port3 Network ($PORT3) has crashed from <strong>$0.03720 to ~$0.00644</strong>&#8212;an <strong>83%</strong> drop that decimated liquidity due to a critical oversight in their signature verification logic. A hacker exploited a classic Solidity vulnerability to mint unauthorized tokens. Below are the confirmed on-chain details:</p><ul><li><p><strong>Targeted Protocol:</strong> Port3 Network</p></li><li><p><strong>Vulnerable Contract:</strong> <code>0xb4357054c3da8d46ed642383f03139ac7f090343</code></p></li><li><p><strong>Attacker&#8217;s Wallet:</strong> <code>0xb13a503da5f368e48577c87b5d5aec73d08f812e</code></p></li><li><p><strong>Attacker&#8217;s profit</strong>: Minted 1 billion $PORT3 token worths $13.07 million. Swapped <strong>156M PORT3</strong> for roughly <strong>144.53 BNB ($119.48K)</strong>.</p></li></ul><h2>Technical Deep Dive</h2><p>Looking at the initiated transactions by the attacker,</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pI8T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pI8T!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 424w, https://substackcdn.com/image/fetch/$s_!pI8T!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 848w, https://substackcdn.com/image/fetch/$s_!pI8T!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 1272w, https://substackcdn.com/image/fetch/$s_!pI8T!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pI8T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png" width="1242" height="315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:1242,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88380,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181667378?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pI8T!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 424w, https://substackcdn.com/image/fetch/$s_!pI8T!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 848w, https://substackcdn.com/image/fetch/$s_!pI8T!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 1272w, https://substackcdn.com/image/fetch/$s_!pI8T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc84b0d4d-ec58-4eb3-baee-ef89396f1c1e_1242x315.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The attacker calls first <code>registerChain and registerChains</code>. After that, call <code>bridgeIn</code> again. The free mint of PORT3 token  was completed by utilizing <code>bridgeIn</code>.</p><p>Let&#8217;s take a look at how the <code>registerChains</code> function is implemented in the contract of the PORT3 token&#8217;s contract:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zVri!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zVri!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 424w, https://substackcdn.com/image/fetch/$s_!zVri!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 848w, https://substackcdn.com/image/fetch/$s_!zVri!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 1272w, https://substackcdn.com/image/fetch/$s_!zVri!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zVri!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png" width="716" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:716,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:165325,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181667378?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zVri!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 424w, https://substackcdn.com/image/fetch/$s_!zVri!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 848w, https://substackcdn.com/image/fetch/$s_!zVri!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 1272w, https://substackcdn.com/image/fetch/$s_!zVri!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70708209-4d5c-47d5-b5b8-56c16196d312_716x811.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The<strong> </strong><code>verifySignature</code><strong> Flaw</strong> The core vulnerability lies inside the signature verification logic. Here is the step-by-step failure:</p><ul><li><p>The Port3 team had unset/renounced <code>owner</code>&#8216;s address. This means the <code>owner()</code> function returns default the zero address (<code>0x0000...0000</code>).</p></li><li><p>The attacker calls <code>registerChain</code> with an invalid (fake) signature.</p></li><li><p>Inside <code>verifySignature</code>, the code calls <code>ecrecover</code>. In Solidity, <strong>if </strong><code>ecrecover</code><strong> fails to verify a signature, it does not revert; instead, it returns </strong><code>address(0)</code>.</p></li><li><p>The code then checks <code>if (recovered == authority)</code>.</p><ul><li><p><code>recovered</code> is <code>0x0</code> (due to the invalid signature).</p></li><li><p><code>authority</code> is <code>0x0</code> (due to renounced ownership).</p></li><li><p><strong>Result:</strong> <code>0x0 == 0x0</code> evaluates to <code>TRUE</code>.</p></li></ul></li></ul><p>Because the code failed to explicitly check that <code>recovered != address(0)</code>, the contract accepted the fake signature as valid ownership proof. Therefore, anyone can pass this verification, and the attacker can add the token address to <code>_state.tokenImplementations</code> via <code>registerChains</code>, and then bypass detection in bridgeIn to complete <code>_mint</code> operation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RoGa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RoGa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 424w, https://substackcdn.com/image/fetch/$s_!RoGa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 848w, https://substackcdn.com/image/fetch/$s_!RoGa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 1272w, https://substackcdn.com/image/fetch/$s_!RoGa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RoGa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png" width="748" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:748,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124234,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181667378?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RoGa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 424w, https://substackcdn.com/image/fetch/$s_!RoGa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 848w, https://substackcdn.com/image/fetch/$s_!RoGa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 1272w, https://substackcdn.com/image/fetch/$s_!RoGa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38c3c618-23a9-4a62-9d5c-851f38456123_748x560.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h2>Conclusion</h2><p>This incident is a textbook example of why developer assumptions are dangerous. The developers assumed <code>ecrecover </code>would only return a valid address or fail. They forgot the edge case: it returns <code>0</code> on failure.</p><p>Even if you think the <code>owner</code> will never be <code>0x0</code>, write your code to handle that possibility. Code lives longer than current operational plans.</p><p>Auditors must look for functions that return &#8220;default values&#8221; (like 0, false, or 0x0) instead of reverting, and ensure those default values cannot be exploited.</p><p><em><strong>$PORT3 didn&#8217;t die because of a sophisticated cryptographic break. It died because of a missing zero-check. In Web3, a single missing line of code is the difference between security and a $13 million loss.</strong></em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.verichains.io/subscribe?"><span>Subscribe now</span></a></p><p>Stay safe!</p><p></p>]]></content:encoded></item><item><title><![CDATA[Yearn Finance and the 16-Wei Deposit That Drained $9 Million]]></title><description><![CDATA[A technical breakdown of how 16 wei became 235 septillion tokens&#8212;and the dangers of cached state in DeFi.]]></description><link>https://blog.verichains.io/p/yearn-finance-and-the-16-wei-deposit</link><guid isPermaLink="false">https://blog.verichains.io/p/yearn-finance-and-the-16-wei-deposit</guid><dc:creator><![CDATA[HL]]></dc:creator><pubDate>Mon, 08 Dec 2025 10:02:40 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/fafd0a69-9ffc-4d2b-b084-ffedf75693cf_1460x904.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Overview</h1><p>On <strong>November 30, 2025</strong>, <strong>Yearn Finance&#8217;s yETH pool</strong> on <strong>Ethereum</strong> suffered a <strong>$9 million</strong> exploit&#8212;one of DeFi&#8217;s most capital-efficient attacks. An attacker exploited a cached storage flaw in the pool&#8217;s accounting to mint 235 septillion yETH tokens by depositing just 16 wei. The desynchronization between reset supply counters and lingering virtual balances enabled infinite minting. The attacker then swapped the tokens for LSTs like wstETH and rETH.</p><p>Yearn confirmed the bug was isolated to a custom stableswap contract&#8212;V2/V3 vaults were unaffected. The attacker laundered roughly $3 million in ETH through Tornado Cash, though ~$2.4 million was later recovered. The incident highlights critical risks in gas-optimized storage and &#8220;first deposit&#8221; logic in AMM designs.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h1>Background on Yearn Finance</h1><p><strong>Yearn Finance</strong> is a decentralized finance (DeFi) aggregator on Ethereum. Launched in 2020, it automates and optimizes yield generation. Its flagship product&#8212;Vaults (yVaults)&#8212;lets users deposit assets that the protocol automatically allocates across lending and liquidity strategies like Aave or Compound to maximize returns. In exchange, users receive yield-bearing &#8220;yTokens&#8221; representing their pool share.</p><p>Yearn is widely respected for its robust V2 and V3 vault standards, but it also develops specialized financial products for niche markets. The <strong>yETH</strong> pool&#8212;the target of this exploit&#8212;was one such custom product. Unlike standard vaults, yETH operated as a &#8220;weighted stableswap&#8221; AMM designed to trade Liquid Staking Tokens (LSTs) like wstETH and rETH efficiently. This distinction is critical: the vulnerability existed in this custom stableswap logic, not in the protocol&#8217;s core vaults, which remained completely unaffected.</p><h1>Technical Analysis of the Exploit</h1><h3>Incident Overview</h3><p><strong>Date:</strong> November 30, 2025</p><p><strong>yETH Weighted Stableswap Pool</strong>: <a href="https://etherscan.io/address/0xccd04073f4bdc4510927ea9ba350875c3c65bf81">0xccd04073f4bdc4510927ea9ba350875c3c65bf81</a></p><p><strong>Exploiter Address:</strong> <a href="https://etherscan.io/address/0xFb63aa935Cf0a003335dCE9Cca03c4F9c0fa4779">0xFb63aa935Cf0a003335dCE9Cca03c4F9c0fa4779</a></p><p><strong>Attack Transaction:</strong> <a href="https://etherscan.io/tx/0x53fe7ef190c34d810c50fb66f0fc65a1ceedc10309cf4b4013d64042a0331156">0x53fe7ef190c34d810c50fb66f0fc65a1ceedc10309cf4b4013d64042a0331156</a></p><h2>Understanding the Weighted StableSwap Pool</h2><p>Weighted stableswap pools (WSS) combine stableswap&#8217;s low-slippage mechanics for pegged assets with configurable per-token weights. This allows uneven liquidity allocation (e.g., 60/40 instead of 50/50). Unlike equal-weight stableswap, WSS normalizes balances using weights w<em>i</em> (which sum to 1), targeting specific portfolio ratios for correlated assets like LSTs (wstETH/rETH) or stablecoins with imbalances.</p><p>A standard stableswap uses a symmetric formula that blends &#8220;constant sum&#8221; (for low slippage) and &#8220;constant product&#8221; (for stability), but it enforces equal token quantities. The <strong>weighted variant</strong> modifies this by baking specific weights directly into the pricing curve. By normalizing balances based on their assigned weights, the pool delivers the same tight spreads and low slippage as a stablecoin pool&#8212;even when token quantities differ dramatically.</p><h2>Yearn yETH Exploit: The Core Mechanism</h2><p>The attacker executed three phases that systematically exploited vulnerabilities in the yETH stableswap to achieve unlimited token minting:</p><p><strong>Phase 1&#8212;Collapse the Invariant:</strong> Extreme imbalanced deposits forced the Newton-Raphson solver into an unintended regime. The product term (vb_prod) became so small that iteration divergence caused the supply update to round to zero, collapsing the product accumulator &#928; to 0. This destroyed the weighted-stableswap invariant and caused the solver to return a massively inflated supply D that the protocol accepted without validation.</p><p><strong>Phase 2&#8212;Drain via POL:</strong> With over-minted LP tokens and a broken pool state, the attacker called <code>remove_liquidity(0)</code> to restore a valid &#928; while keeping D inflated. Then <code>update_rates</code> reconciled the discrepancy by burning yETH from the staking contract&#8217;s Protocol-Owned Liquidity (POL)&#8212;not from the attacker. Repeated withdrawals using the oversized LP balance drained nearly all pool assets while offloading costs onto the protocol.</p><p><strong>Phase 3&#8212;Infinite Mint:</strong> With the pool emptied (prev_supply = 0), the attacker re-entered the bootstrap initialization path and deposited a configuration violating <em>A</em>&#8901;&#931;&#8805;<em>D</em>&#8901;&#928;. The solver&#8217;s unsafe arithmetic underflowed, wrapping to the maximum uint256 value and producing approximately <strong>2.35 &#215; 10^56 yETH tokens</strong>.</p><p>Now let&#8217;s examine the attack transaction.</p><h2>Attack Flow</h2><p>The attacker executed a precision attack that exploited state desynchronization to mint tokens from nothing.</p><ol><li><p><strong>Flash Loan Liquidity</strong>: The attacker borrowed large amounts of liquid staking tokens (LSTs)&#8212;wstETH, rETH, and cbETH&#8212;from the yETH pool via flash loan.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vMRQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vMRQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 424w, https://substackcdn.com/image/fetch/$s_!vMRQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 848w, https://substackcdn.com/image/fetch/$s_!vMRQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 1272w, https://substackcdn.com/image/fetch/$s_!vMRQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vMRQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png" width="1456" height="685" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:685,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:753078,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181016787?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!vMRQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 424w, https://substackcdn.com/image/fetch/$s_!vMRQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 848w, https://substackcdn.com/image/fetch/$s_!vMRQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 1272w, https://substackcdn.com/image/fetch/$s_!vMRQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64ae1fcb-3bce-4107-8f66-317b0bec7918_2806x1320.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li><li><p><strong>State Desynchronization (The Setup)</strong>: Using the flash-loaned capital, the attacker executed rapid deposits and withdrawals to manipulate the contract&#8217;s accounting. The target was a gas-saving feature: the <code>packed_vbs</code> (packed virtual balances) variable, which cached balance data to reduce transaction costs. By repeatedly updating this cache while simultaneously withdrawing real assets, the attacker created a <strong>critical state contradiction</strong>: the pool&#8217;s actual liquidity dropped to near zero, but the cached <code>packed_vbs</code> variable still held &#8220;phantom&#8221; values indicating the pool was full. This poisoned cache set the trap for the next step.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sTgE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sTgE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 424w, https://substackcdn.com/image/fetch/$s_!sTgE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 848w, https://substackcdn.com/image/fetch/$s_!sTgE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 1272w, https://substackcdn.com/image/fetch/$s_!sTgE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sTgE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png" width="1456" height="655" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:865760,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181016787?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sTgE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 424w, https://substackcdn.com/image/fetch/$s_!sTgE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 848w, https://substackcdn.com/image/fetch/$s_!sTgE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 1272w, https://substackcdn.com/image/fetch/$s_!sTgE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ad6155b-82f7-48bf-9a00-c7add3042f67_3008x1354.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li><li><p><strong>Resetting Total Supply</strong>: The attacker withdrew all assets, reducing the pool&#8217;s <code>totalSupply</code> to zero. In a healthy state, this should reset the pool. However, the <code>packed_vbs</code> cache was neither cleared nor synchronized&#8212;it retained &#8220;phantom&#8221; values from the previous state.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lMWz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lMWz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 424w, https://substackcdn.com/image/fetch/$s_!lMWz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 848w, https://substackcdn.com/image/fetch/$s_!lMWz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 1272w, https://substackcdn.com/image/fetch/$s_!lMWz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lMWz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png" width="1456" height="293" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:293,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:223796,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181016787?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lMWz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 424w, https://substackcdn.com/image/fetch/$s_!lMWz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 848w, https://substackcdn.com/image/fetch/$s_!lMWz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 1272w, https://substackcdn.com/image/fetch/$s_!lMWz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd8d60d9-4985-4613-8aef-9bfb8db0ea2e_2114x426.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p><strong>The Infinite Mint Trigger:</strong> With the pool&#8217;s <strong>totalSupply</strong> reset to zero, the attacker deposited just 16 wei spread across the tokens. This triggered the contract&#8217;s &#8220;initial deposit&#8221; logic&#8212;a critical initialization phase that sets the pool&#8217;s pricing curve. But due to the desynchronization, the contract calculated the invariant <code>D</code> using stale, inflated values from the poisoned <strong>packed_vbs</strong> cache instead of the actual 16 wei deposit. This mathematical mismatch tricked the protocol into treating the tiny deposit as equivalent to the massive &#8220;phantom&#8221; liquidity, minting 235 septillion yETH shares to the attacker.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hRJ4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hRJ4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 424w, https://substackcdn.com/image/fetch/$s_!hRJ4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 848w, https://substackcdn.com/image/fetch/$s_!hRJ4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 1272w, https://substackcdn.com/image/fetch/$s_!hRJ4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hRJ4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png" width="1456" height="764" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:764,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:810737,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/181016787?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hRJ4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 424w, https://substackcdn.com/image/fetch/$s_!hRJ4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 848w, https://substackcdn.com/image/fetch/$s_!hRJ4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 1272w, https://substackcdn.com/image/fetch/$s_!hRJ4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2949e23-fa69-47e5-8668-e512b734b2b0_2624x1376.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li><li><p><strong>Profit Extraction</strong>: Holding virtually unlimited yETH shares, the attacker then turned to the open market to cash out. They utilized liquidity pools on <strong>Balancer</strong> and <strong>Curve</strong> to swap the newly minted yETH for real underlying assets (like wstETH and rETH), effectively draining approximately <strong>$9 million</strong> from the ecosystem before the exploit was halted.</p></li></ol><h2>Conclusion</h2><p>The exploit resulted from a cascade of logical and numerical failures that let the attacker desynchronize the pool&#8217;s state and trigger a catastrophic underflow.</p><ul><li><p><strong>State Desynchronization via Numerical Instability: </strong>The protocol used internal variables&#8212;specifically the product term <code>&#928;</code> and invariant <code>D</code>&#8212;to track the pool&#8217;s liquidity curve. Under large relative deposits, the solver&#8217;s iteration logic became numerically unstable, causing these variables to diverge. This instability drove the product term <code>&#928;</code> to zero while the invariant <code>D</code> remained inflated, breaking the fundamental mathematical relationship between them.</p></li><li><p><strong> The &#8220;Zero-Supply&#8221; Trap: </strong>The code allowed the pool&#8217;s internal supply counter <code>D</code> to drop to zero while actual token balances (Protocol-Owned Liquidity) still existed. This let the attacker reach the <code>prev_supply == 0</code> state&#8212;a &#8220;bootstrap&#8221; branch intended only for initial deployment&#8212;on a mature, active pool.</p></li><li><p><strong>The Catastrophic Underflow: </strong>The fatal blow occurred in the <code>_calc_supply</code> function when the contract recalculated the new liquidity. The formula <code>val = A * &#931; - D * &#928;</code> assumed that <code>A * &#931;</code> would always exceed <code>D * &#928;</code>. Because the attacker had driven <code>&#928;</code> to zero (step 1), this assumption failed. The contract used <code>unsafe_sub</code> (unchecked subtraction) for this operation. Instead of reverting, the subtraction underflowed, wrapping from a negative result to a near-infinite integer (<code>2^256</code>).</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[WXC Exploit Analysis]]></title><description><![CDATA[On August 11, 2025, a critical vulnerability was exploited in the WXC token contracts, resulting in an estimated loss of approximately 37.5 BNB. The attacker exploited the burn mechanism of the WXC token when there is token selling on the pool.]]></description><link>https://blog.verichains.io/p/wxc-exploit-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/wxc-exploit-analysis</guid><dc:creator><![CDATA[TK]]></dc:creator><pubDate>Fri, 28 Nov 2025 08:11:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!iwwA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On August 11, 2025, a critical vulnerability was exploited in the <strong>WXC </strong>token contracts, resulting in an estimated loss of approximately <strong>37.5 BNB</strong>. The attacker exploited the burn mechanism of the <strong>WXC</strong> token when there is token selling on the pool.</p><h2>Overview</h2><p>Attacker: <a href="https://bscscan.com/address/0x476954c752a6ee04b68382c97f7560040eda7309">https://bscscan.com/address/0x476954c752a6ee04b68382c97f7560040eda7309</a></p><p>Vulnerable Contract: <a href="https://bscscan.com/address/0x4c100d30d9c511b8bb9d1c951bbc1be489a0172f">https://bscscan.com/address/0x4c100d30d9c511b8bb9d1c951bbc1be489a0172f</a></p><p>Exploit TXs: <a href="https://bscscan.com/tx/0x1397bc7f0d284f8e2e30d0a9edd0db1f3eb0dd284c75e30d226b02bf09ad068f">https://bscscan.com/tx/0x1397bc7f0d284f8e2e30d0a9edd0db1f3eb0dd284c75e30d226b02bf09ad068f</a></p><h3><strong>Exploit Analysis</strong></h3><ul><li><p>The <strong>WXC</strong> token contract includes logic to burn <strong>WXC</strong> tokens when someone sells the token into the pool. The problem is that it burns tokens from the <strong>PancakeSwapV2 </strong>pool itself, which decreases the pool&#8217;s <strong>WXC</strong> balance.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iwwA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iwwA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 424w, https://substackcdn.com/image/fetch/$s_!iwwA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 848w, https://substackcdn.com/image/fetch/$s_!iwwA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 1272w, https://substackcdn.com/image/fetch/$s_!iwwA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iwwA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png" width="1456" height="486" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:486,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:495846,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/180087577?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iwwA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 424w, https://substackcdn.com/image/fetch/$s_!iwwA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 848w, https://substackcdn.com/image/fetch/$s_!iwwA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 1272w, https://substackcdn.com/image/fetch/$s_!iwwA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc3711b63-ea5c-44f7-8b6f-e9021573a60e_2794x932.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p></li><li><p>The attacker first flash-loaned <strong>WBNB</strong>, swapped it to <strong>WXC</strong> at the current price, and then swapped back to <strong>WBNB</strong>. This swap back triggered <strong>WXC</strong>&#8217;s logic to burn the pool&#8217;s <strong>WXC</strong> balance in the middle of the swap, pushing <strong>WXC</strong>&#8217;s price higher. Attacker using this to take more <strong>WBNB </strong>from pool than in a normal swap, completing the exploit.</p></li></ul><h3><strong>Conclusion</strong></h3><p>When adding any logic to a token contract, especially fee or burn logic on transfers, always proceed with caution, as it may directly reduce an AMM&#8217;s pool balance during swaps and create vulnerabilities that attackers can exploit.</p><p>Furthermore, conducting a security audit is <strong>strongly recommended</strong> for all projects, even though they are smart contracts, backends, wallets, or dapps.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Verichains! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The DRLVaultV3 Exploit: A Slippage Design Failure]]></title><description><![CDATA[On Nov 10, 2025, DRLVaultV3, a USDC&#8211;WETH rebalance vault, was exploited due to a design flaw.]]></description><link>https://blog.verichains.io/p/the-drlvaultv3-exploit-a-slippage</link><guid isPermaLink="false">https://blog.verichains.io/p/the-drlvaultv3-exploit-a-slippage</guid><dc:creator><![CDATA[lifebow]]></dc:creator><pubDate>Tue, 25 Nov 2025 03:30:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!XZCb!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F20abd958-d8c9-49ef-8c21-44117564e63e_1280x1280.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On <strong>Nov 10, 2025</strong>, <strong>DRLVaultV3</strong>, a <strong>USDC&#8211;WETH rebalance vault</strong>, was exploited due to a design flaw. Fortunately, the attacker is a whitehat-tagged address, and the protocol should recover the funds. In this blog, we analyze the root cause of the vulnerability and outline mitigation strategies.</p><h2>Incident Overview</h2><p><strong>Date:</strong> Nov 10, 2025</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p><strong>Platform:</strong> Ethereum (ETH)</p><p><strong>Attacker Address:</strong> 0xC0ffeEBABE5D496B2DDE509f9fa189C25cF29671 (white hat attacker)</p><p><strong>Vulnerable Contract:</strong> 0x6A06707ab339BEE00C6663db17DdB422301ff5e8 (DRLVaultV3)</p><p><strong>Attack Transaction:</strong> 0xe3eab35b288c086afa9b86a97ab93c7bb61d21b1951a156d2a8f6f5d5715c475</p><h2>Exploit Flow</h2><ol><li><p>The attacker first borrowed approximately <strong>14M USDC</strong> from the <strong>Morpho Blue</strong> vault.</p></li><li><p>They then heavily bought <strong>WETH</strong> using this USDC, causing the WETH price in the pool to <strong>spike sharply</strong>. As a result, the pool began reporting that WETH was extremely expensive, and USDC was worth very little WETH.</p></li><li><p>Next, the attacker triggered the vault&#8217;s <code>swapToWETH</code> function, prompting the vault to buy WETH using its USDC balance&#8212;at the now manipulated price.</p></li><li><p>Finally, the attacker sold the previously purchased WETH back into the pool, capturing a profit from the manipulated price difference.</p></li></ol><h3>Root Cause</h3><p>The fundamental issue lies in how the vault computes <strong>amountOutMinimum</strong> for swaps. Instead of receiving this value <strong>from the user (off-chain)</strong> or deriving it from a <strong>trusted oracle</strong>, the contract calculates it <strong>on-chain</strong> using the current pool quote <strong>within the same transaction</strong>.</p><p>This design makes the vault&#8217;s slippage protection <strong>dependent on a manipulable reference price</strong>.</p><pre><code><code>function swapToWETH(uint256 _amount) public returns (uint256 _amountOut) {
    // ... setup ...

    // FATAL FLAW: Asking the chain for the current price
    uint256 expectedAmountOut = getQuoteForUSDC(fee, _amount);

    // The contract accepts the Quoter&#8217;s price minus 0.5%
    uint256 _amountOutMinimum = (expectedAmountOut * (10000 - slippageBps)) / 10000;

    IV3SwapRouter.ExactInputSingleParams memory params = IV3SwapRouter.ExactInputSingleParams({
        tokenIn: tokenIn,
        tokenOut: WETH,
        fee: fee,
        recipient: address(this),
        amountIn: _amount,
        amountOutMinimum: _amountOutMinimum, // Uses the manipulated minimum
        sqrtPriceLimitX96: 0
    });

    _amountOut = swapRouter.exactInputSingle(params);
}</code></code></pre><p>The problem is not the slippage tolerance (0.5% is normal), but that the <strong>slippage baseline is mutable</strong>. When the attacker shifts the pool price by 10%, the vault&#8217;s computed minimum also shifts by 10%, effectively nullifying all protection.</p><p>This flaw leaves both <code>swapToUsdc</code> and <code>swapAllToWETH</code> vulnerable to classic sandwich and price-manipulation attacks.</p><p></p><h3>Mitigation</h3><p>Effective slippage protection must rely on a price reference that is <strong>independent</strong> of any in-transaction price manipulation.</p><p>The recommended approach is to compute <strong>amountOutMinimum</strong> <strong>off-chain</strong> (on the client or backend) and pass it into the contract as a parameter. This ensures the minimum output is anchored to an external, trusted price source rather than the volatile on-chain state at execution time.</p><p>Alternatively, the contract can use a <strong>trusted oracle price</strong> (e.g., Chainlink or a time-weighted average price) to derive <strong>amountOutMinimum</strong>. By basing calculations on oracle data rather than instantaneous pool prices, the contract becomes resistant to sandwich and price manipulation attacks.<br></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.verichains.io/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[TokenHolder Hack Analysis]]></title><description><![CDATA[On October 7, 2025, the TokenHolder project fell victim to an attack that resulted in the loss of 20 WBNB - approximately $25,000.]]></description><link>https://blog.verichains.io/p/tokenholder-hack-analysis</link><guid isPermaLink="false">https://blog.verichains.io/p/tokenholder-hack-analysis</guid><dc:creator><![CDATA[LCD]]></dc:creator><pubDate>Sat, 22 Nov 2025 13:30:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9xa2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On October 7, 2025, the TokenHolder project fell victim to an attack that resulted in the loss of 20 WBNB - approximately $25,000. What makes this incident particularly striking is that the underlying vulnerability was <strong>so extremely simple</strong> that it&#8217;s hard to believe it ever made its way into production code. In this post, we&#8217;ll break down how the exploit occurred, why such a basic flaw went unnoticed, and what developers can learn from this surprising oversight.</p><h1>Overview</h1><ul><li><p>Attacker address: <a href="https://bscscan.com/address/0x3fee6d8aaea76d06cf1ebeaf6b186af215f14088">0x3feE6d8aaea76D06CF1ebEaF6B186af215F14088</a></p></li><li><p>Attacker&#8217;s contract: <a href="https://bscscan.com/address/0xe82fc275b0e3573115eadca465f85c4f96a6c631">0xe82Fc275B0e3573115eaDCa465f85c4F96A6c631</a></p></li><li><p>Vulnerable contract: <a href="https://bscscan.com/address/0x8c7f34436c0037742aecf047e06fd4b27ad01117">0x8c7f34436C0037742AeCf047e06fD4B27Ad01117</a></p></li><li><p>Attack transaction: <a href="https://bscscan.com/tx/0xc291d70f281dbb6976820fbc4dbb3cfcf56be7bf360f2e823f339af4161f64c6">0xc291d70f281dbb6976820fbc4dbb3cfcf56be7bf360f2e823f339af4161f64c6</a></p></li></ul><h1>Analysis</h1><p>Here is the source code of the vulnerable contract (<code>BorrowerOperationsV6</code>):</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9xa2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9xa2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 424w, https://substackcdn.com/image/fetch/$s_!9xa2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 848w, https://substackcdn.com/image/fetch/$s_!9xa2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 1272w, https://substackcdn.com/image/fetch/$s_!9xa2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9xa2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png" width="748" height="460" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:460,&quot;width&quot;:748,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102620,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179522884?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9xa2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 424w, https://substackcdn.com/image/fetch/$s_!9xa2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 848w, https://substackcdn.com/image/fetch/$s_!9xa2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 1272w, https://substackcdn.com/image/fetch/$s_!9xa2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0e48d7-c154-4548-95aa-200da4e0bc03_748x460.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You can quickly see that many of the require statements had been disabled. These checks are meant to validate the arguments passed into the function, ensuring that only proper inputs are processed. But, as you can tell, every one of them had been turned off - leaving the contract wide open to be attacked.</p><p>From there, the hacker&#8217;s remaining work was surprisingly simple. He created a contract that implemented just enough functions to masquerade as a valid <code>TokenHolder</code> and DEX, then invoked <code>BorrowerOperationsV6.sell()</code> to sell a fake loans - values returned directly from his contract. With all validation checks removed, the exploit executed flawlessly, allowing him to walk away with 20 WBNB ( 19.2 BNB after fees).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HtoX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HtoX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 424w, https://substackcdn.com/image/fetch/$s_!HtoX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 848w, https://substackcdn.com/image/fetch/$s_!HtoX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 1272w, https://substackcdn.com/image/fetch/$s_!HtoX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HtoX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png" width="1264" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&quot;width&quot;:1264,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:258072,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179522884?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HtoX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 424w, https://substackcdn.com/image/fetch/$s_!HtoX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 848w, https://substackcdn.com/image/fetch/$s_!HtoX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 1272w, https://substackcdn.com/image/fetch/$s_!HtoX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5421234c-da97-48c1-978a-dbb4f5e4a77c_1264x624.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Summary</h1><p>This incident highlights how even a small oversight can have serious consequences. Whether due to developer negligence or accidentally deploying test code in production, the result was a real financial loss. While the 20 BNB lost here is relatively small compared to the potential impact of such mistakes, it serves as a stark reminder that no error is too minor to ignore. Careful auditing and thorough testing before deployment are essential - continuing to review your code rigorously can prevent simple mistakes from turning into costly exploits.</p>]]></content:encoded></item><item><title><![CDATA[Balancer Exploit - Small Rounding Errors Lead to Big Losses]]></title><description><![CDATA[Overview]]></description><link>https://blog.verichains.io/p/balancer-exploit-small-rounding-errors</link><guid isPermaLink="false">https://blog.verichains.io/p/balancer-exploit-small-rounding-errors</guid><dc:creator><![CDATA[nt]]></dc:creator><pubDate>Mon, 17 Nov 2025 09:27:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Gxgp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Overview</h2><p>On November 3, 2025, the Balancer V2 protocol was exploited, resulting in a loss of approximately $128 million across multiple pools on various networks including Ethereum, Base, Avalanche, Gnosis, Berachain, Polygon, Sonic, Arbitrum, and Optimism.</p><p>The exploit targeted the Composable Stable Pool contract, which is a type of pool that allows users to trade between different assets with stable exchange rates, such as stablecoins (DAI, USDC, USDT, etc.) or correlated assets like wrapped staked ETH (wstETH), StakeWise staked ETH (osETH), and ETH (WETH).</p><h2>Key Information</h2><ul><li><p>Exploiter Address: <a href="https://etherscan.io/address/0x506d1f9efe24f0d47853adca907eb8d89ae03207">https://etherscan.io/address/0x506d1f9efe24f0d47853adca907eb8d89ae03207</a></p></li><li><p>Attack Transaction (example): <a href="https://etherscan.io/tx/0x6ed07db1a9fe5c0794d44cd36081d6a6df103fab868cdd75d581e3bd23bc9742">https://etherscan.io/tx/0x6ed07db1a9fe5c0794d44cd36081d6a6df103fab868cdd75d581e3bd23bc9742</a></p></li><li><p>Fund Withdrawal Transaction: <a href="https://etherscan.io/tx/0xd155207261712c35fa3d472ed1e51bfcd816e616dd4f517fa5959836f5b48569">https://etherscan.io/tx/0xd155207261712c35fa3d472ed1e51bfcd816e616dd4f517fa5959836f5b48569</a></p></li></ul><h2>Understanding the Composable Stable Pool</h2><p>The ComposableStablePool contract has a liquidity provider token (BPT) that represents the pool&#8217;s liquidity. This token is registered in the pool&#8217;s balances along with other underlying tokens so that users can add or remove liquidity by swapping BPT with underlying tokens just like normal tokens. These operations are called join and exit swaps.</p><p>In order to handle token transfers efficiently, instead of transferring tokens directly for each swap, the pool uses a delta calculation to track the changes in the pool&#8217;s balances. These deltas are then used to update the pool&#8217;s balances after each swap. At the end of the swap, the vault collects all deltas and performs the actual token transfers. Using this feature, the attacker can temporarily use the pool&#8217;s balances and perform a swap to make some profit and pay back to the pool without the need for explicitly doing token flashloans.</p><p>Now, let&#8217;s take a look at the attack transactions.</p><h2>Exploit Analysis</h2><p>Look at the transaction where the attacker withdrew a huge amount of tokens such as WETH, osETH, wstETH, etc. out of the pool. However, this transaction is not the actual attack transaction.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gxgp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gxgp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 424w, https://substackcdn.com/image/fetch/$s_!Gxgp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 848w, https://substackcdn.com/image/fetch/$s_!Gxgp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 1272w, https://substackcdn.com/image/fetch/$s_!Gxgp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gxgp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png" width="1391" height="703" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:703,&quot;width&quot;:1391,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:138893,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gxgp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 424w, https://substackcdn.com/image/fetch/$s_!Gxgp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 848w, https://substackcdn.com/image/fetch/$s_!Gxgp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 1272w, https://substackcdn.com/image/fetch/$s_!Gxgp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a306ec2-f7de-4251-980f-67ff2f256893_1391x703.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Take a deeper look, we can see that these tokens have been recorded as internal balances of the attacker in the vault contract. So, the real attack transaction must have been done prior to this transaction. The attack had been split into multiple transactions to avoid MEV bots front-running the attack.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gcEM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gcEM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 424w, https://substackcdn.com/image/fetch/$s_!gcEM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 848w, https://substackcdn.com/image/fetch/$s_!gcEM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 1272w, https://substackcdn.com/image/fetch/$s_!gcEM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gcEM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png" width="1456" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/380e3744-0860-4216-bffa-32437cdee884_1870x616.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:313141,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gcEM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 424w, https://substackcdn.com/image/fetch/$s_!gcEM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 848w, https://substackcdn.com/image/fetch/$s_!gcEM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 1272w, https://substackcdn.com/image/fetch/$s_!gcEM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F380e3744-0860-4216-bffa-32437cdee884_1870x616.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And the previous transaction, that records the internal balances for the attacker in this pool is the following one:</p><p><a href="https://etherscan.io/tx/0x6ed07db1a9fe5c0794d44cd36081d6a6df103fab868cdd75d581e3bd23bc9742">https://etherscan.io/tx/0x6ed07db1a9fe5c0794d44cd36081d6a6df103fab868cdd75d581e3bd23bc9742</a></p><p>Look at this transaction, we can see a list of calls to the attacker&#8217;s contract <code>0x679B362B9f38BE63FbD4A499413141A997eb381e</code> with the method <code>0x524c9e20</code>. After that, the attacker performed a batch of swaps between tokens inside the pool (including the BPT token).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QdEk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QdEk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 424w, https://substackcdn.com/image/fetch/$s_!QdEk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 848w, https://substackcdn.com/image/fetch/$s_!QdEk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 1272w, https://substackcdn.com/image/fetch/$s_!QdEk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QdEk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png" width="1398" height="765" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:765,&quot;width&quot;:1398,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:359211,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QdEk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 424w, https://substackcdn.com/image/fetch/$s_!QdEk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 848w, https://substackcdn.com/image/fetch/$s_!QdEk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 1272w, https://substackcdn.com/image/fetch/$s_!QdEk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6505e110-93dc-46ed-95c6-3e1b7c2e1ac0_1398x765.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At the end of the <code>batchSwap</code> call, we can see that the internal balances of the attacker have been increased by a large amount for all tokens inside the pool.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A9NU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A9NU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 424w, https://substackcdn.com/image/fetch/$s_!A9NU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 848w, https://substackcdn.com/image/fetch/$s_!A9NU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 1272w, https://substackcdn.com/image/fetch/$s_!A9NU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A9NU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png" width="1456" height="536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:536,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:280146,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A9NU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 424w, https://substackcdn.com/image/fetch/$s_!A9NU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 848w, https://substackcdn.com/image/fetch/$s_!A9NU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 1272w, https://substackcdn.com/image/fetch/$s_!A9NU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b65b0e9-55b1-42c1-be4c-92ac7619c3ad_1478x544.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So now, we need to figure out how the attacker made profit from these swaps. To understand the attack, let&#8217;s trace through the balances of these tokens inside the pool for every swap in the <code>batchSwap</code> call. Before the <code>batchSwap</code> call, the balance of tokens inside the pool were as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eqvP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eqvP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 424w, https://substackcdn.com/image/fetch/$s_!eqvP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 848w, https://substackcdn.com/image/fetch/$s_!eqvP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 1272w, https://substackcdn.com/image/fetch/$s_!eqvP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eqvP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png" width="1070" height="847" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:847,&quot;width&quot;:1070,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176788,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eqvP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 424w, https://substackcdn.com/image/fetch/$s_!eqvP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 848w, https://substackcdn.com/image/fetch/$s_!eqvP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 1272w, https://substackcdn.com/image/fetch/$s_!eqvP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f4daddc-75f2-4c90-90ae-491c662f36e4_1070x847.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As mentioned above, the pool saves the BPT share token of the pool as a normal token in its <code>balances</code> array. So, the attacker can swap the BPT token with other tokens inside the pool just like normal tokens.</p><p>At the beginning of the <code>batchSwap</code> call, we can see a series of swaps from the BPT token to the WETH and osETH tokens. This means the attacker was trying to drain the balance of both underlying tokens of the pool. This is the result at the end of these swaps:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XSLw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XSLw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 424w, https://substackcdn.com/image/fetch/$s_!XSLw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 848w, https://substackcdn.com/image/fetch/$s_!XSLw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 1272w, https://substackcdn.com/image/fetch/$s_!XSLw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XSLw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png" width="1058" height="857" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:857,&quot;width&quot;:1058,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:171061,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!XSLw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 424w, https://substackcdn.com/image/fetch/$s_!XSLw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 848w, https://substackcdn.com/image/fetch/$s_!XSLw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 1272w, https://substackcdn.com/image/fetch/$s_!XSLw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58c9e6f2-0e31-4000-8a89-437db924a655_1058x857.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So, we can clearly see that the attacker was trying to precisely adjust the balance of the osETH tokens, setting it to <code>18</code> and then attempting to swap out <code>17</code> wei of osETH. Why was the number <code>17</code> chosen? To understand this, we need to look at the implementation of the <code>onSwap</code> function.</p><p>Trace through the logic of the <code>onSwap</code> function, we come up with the <code>_swapGivenOut</code> function, this function is responsible for calculating the amount of tokens to be swapped in for a given amount of tokens to be swapped out. In this case, the attacker was trying to swap out <code>17</code> wei of osETH, so the function will calculate the amount of WETH to be swapped in.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!abNV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!abNV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 424w, https://substackcdn.com/image/fetch/$s_!abNV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 848w, https://substackcdn.com/image/fetch/$s_!abNV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 1272w, https://substackcdn.com/image/fetch/$s_!abNV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!abNV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png" width="808" height="344" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:344,&quot;width&quot;:808,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:36549,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!abNV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 424w, https://substackcdn.com/image/fetch/$s_!abNV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 848w, https://substackcdn.com/image/fetch/$s_!abNV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 1272w, https://substackcdn.com/image/fetch/$s_!abNV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83b799f2-314a-4fb8-a6fe-eb4c86051c6b_808x344.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In the <code>_swapGivenOut</code> function, the balances of tokens in the pool are upscaled using the scaling factors of the tokens. These numbers represent the exchange rates of the tokens in the external market.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IaZ9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IaZ9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 424w, https://substackcdn.com/image/fetch/$s_!IaZ9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 848w, https://substackcdn.com/image/fetch/$s_!IaZ9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 1272w, https://substackcdn.com/image/fetch/$s_!IaZ9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IaZ9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png" width="540" height="361" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:361,&quot;width&quot;:540,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14334,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IaZ9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 424w, https://substackcdn.com/image/fetch/$s_!IaZ9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 848w, https://substackcdn.com/image/fetch/$s_!IaZ9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 1272w, https://substackcdn.com/image/fetch/$s_!IaZ9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e444c6e-d4f4-4b50-b7ac-9fe3034de056_540x361.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Both swap amount and balances are upscaled using these scaling factors. After the <code>upscaleArray</code> function call, the balances of the tokens in the pool are updated as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aE-b!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aE-b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 424w, https://substackcdn.com/image/fetch/$s_!aE-b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 848w, https://substackcdn.com/image/fetch/$s_!aE-b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 1272w, https://substackcdn.com/image/fetch/$s_!aE-b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aE-b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png" width="689" height="417" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:417,&quot;width&quot;:689,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18571,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aE-b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 424w, https://substackcdn.com/image/fetch/$s_!aE-b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 848w, https://substackcdn.com/image/fetch/$s_!aE-b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 1272w, https://substackcdn.com/image/fetch/$s_!aE-b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8eedd8-46d4-4697-9de4-e51de8c6a02b_689x417.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>However, the swap amount is unchanged after the <code>_upscale</code> call. This might be the reason why the attacker chose the number of <code>17</code> for the swap amount. We can guess that there is some rounding error here, in the <code>_upscale</code> implementation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G_tv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G_tv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 424w, https://substackcdn.com/image/fetch/$s_!G_tv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 848w, https://substackcdn.com/image/fetch/$s_!G_tv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 1272w, https://substackcdn.com/image/fetch/$s_!G_tv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G_tv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png" width="556" height="326" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df967edf-7079-47c7-baff-93c6e1039ef0_556x326.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:326,&quot;width&quot;:556,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:13276,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!G_tv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 424w, https://substackcdn.com/image/fetch/$s_!G_tv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 848w, https://substackcdn.com/image/fetch/$s_!G_tv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 1272w, https://substackcdn.com/image/fetch/$s_!G_tv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf967edf-7079-47c7-baff-93c6e1039ef0_556x326.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Look at the implementation of the <code>_upscale</code> function, we can see that the amount is rounding down after multiplying by the scaling factor.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m68F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m68F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 424w, https://substackcdn.com/image/fetch/$s_!m68F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 848w, https://substackcdn.com/image/fetch/$s_!m68F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 1272w, https://substackcdn.com/image/fetch/$s_!m68F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m68F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png" width="763" height="276" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:276,&quot;width&quot;:763,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26534,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!m68F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 424w, https://substackcdn.com/image/fetch/$s_!m68F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 848w, https://substackcdn.com/image/fetch/$s_!m68F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 1272w, https://substackcdn.com/image/fetch/$s_!m68F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8aee18e0-cb53-4cc0-8a35-2d70df686446_763x276.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In this case, we have the following calculation:</p><pre><code><code>17 * 1,058,132,408,689,971,699 / 10**18 = 17.98825094772952 // Rounded down to 17
// the loss is approximately 0.98825094772952 / 17 ~= 5.81%
</code></code></pre><p>Because the amount of token in is calculated based on the amount out provided by the attacker as follows:</p><pre><code><code>swapRequest.amount = _upscale(swapRequest.amount, scalingFactors[indexOut]);
uint256 amountIn = _onSwapGivenOut(swapRequest, balances, indexIn, indexOut);
</code></code></pre><p>So, the pool will incorrectly calculate the required amount of token in that favors the attacker for each swap based on the following formula from the <a href="https://docs-v2.balancer.fi/reference/math/stable-math.html#outgivenin">documentation of Balancer</a>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ldwX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ldwX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 424w, https://substackcdn.com/image/fetch/$s_!ldwX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 848w, https://substackcdn.com/image/fetch/$s_!ldwX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 1272w, https://substackcdn.com/image/fetch/$s_!ldwX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ldwX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png" width="731" height="414" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:731,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:30254,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://blog.verichains.io/i/179123661?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ldwX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 424w, https://substackcdn.com/image/fetch/$s_!ldwX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 848w, https://substackcdn.com/image/fetch/$s_!ldwX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 1272w, https://substackcdn.com/image/fetch/$s_!ldwX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a89a976-f9c5-48ce-9ea9-9b22ca252951_731x414.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Solving this equation using the Newton-Raphson method, we can calculate the amount of input token needed to swap out a given amount of output token, amplification parameter (A), balances of the tokens in the pool and the invariant (D) of the pool.</p><p>Using a series of these swaps, the attacker can gradually drain all of the underlying tokens of the pool and make a profit.</p><h2>Conclusion</h2><p>This attack is an interesting example of how small rounding errors can lead to significant losses in DeFi protocols. The <code>_upscale</code> function, instead of rounding up to benefit the pool, rounds down, which favors the attacker. According to the comments in the code, this issue had been acknowledged, but the development team skipped fixing it because they underestimated the impact of the rounding error.</p><p>This incident shows that even a well-established protocol like Balancer, which has been around for a while and has undergone multiple audits, can still be exploited by small rounding errors. It highlights the importance of regular security audits and thorough testing of complex logic and formulas in DeFi protocols.</p>]]></content:encoded></item></channel></rss>