<?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>Fri, 15 May 2026 07:49:36 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[JUDAO HACK ANALYSIC]]></title><description><![CDATA[JUDAO is a decentralized finance (DeFi) project deployed on the BNB Smart Chain (BSC), offering token-based financial services through its on-chain liquidity and trading ecosystem.]]></description><link>https://blog.verichains.io/p/judao-hack-analysic</link><guid isPermaLink="false">https://blog.verichains.io/p/judao-hack-analysic</guid><dc:creator><![CDATA[LCD]]></dc:creator><pubDate>Tue, 12 May 2026 07:01:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!z5V8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>JUDAO</strong> is a decentralized finance (DeFi) project deployed on the <strong>BNB Smart Chain (BSC)</strong>, offering token-based financial services through its on-chain liquidity and trading ecosystem. On April 28, 2026, <strong>JUDAO</strong> on the <strong>BSC chain</strong> was exploited in an attack that resulted in an estimated loss of approximately <strong>$228,000</strong> at the time of the incident. The exploit appears to have involved a <strong>flash loan attack</strong> that manipulated the liquidity pair reserves, allowing the attacker to extract profit through distorted pricing.</p><h1>Overview</h1><p>Attacker: <a href="https://bscscan.com/address/0x5384b34c74024d6563b323351a4bbfa18432161b">0x5384B34C74024d6563B323351a4bBFA18432161B</a></p><p>Attacker&#8217;s contract 1: <a href="https://bscscan.com/address/0x3b9bc53af5012b12b6886a665bb22382211ae432">0x3B9bc53Af5012b12B6886a665Bb22382211aE432</a></p><p>Attacker&#8217;s contract 2: <a href="https://bscscan.com/address/0x3b9bc53af5012b12b6886a665bb22382211ae432">0x3B9bc53Af5012b12B6886a665Bb22382211aE432</a></p><p>JUDAO token: <a href="https://bscscan.com/address/0xf55dff7898930a2d28cdbc39d615b1624ac86888">0xf55DFF7898930a2D28cDbC39D615b1624ac86888</a></p><p>Vulnerable contract: <a href="https://bscscan.com/address/0x5d7b61e91cb59e90f7fae8d0fe2e73976161592f">0x5D7b61e91cB59E90f7fAE8d0FE2e73976161592F</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_!z5V8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z5V8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 424w, https://substackcdn.com/image/fetch/$s_!z5V8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 848w, https://substackcdn.com/image/fetch/$s_!z5V8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 1272w, https://substackcdn.com/image/fetch/$s_!z5V8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z5V8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png" width="1072" height="615" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:615,&quot;width&quot;:1072,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:235034,&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/197298687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.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_!z5V8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 424w, https://substackcdn.com/image/fetch/$s_!z5V8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 848w, https://substackcdn.com/image/fetch/$s_!z5V8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.png 1272w, https://substackcdn.com/image/fetch/$s_!z5V8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6408e360-4047-4a62-b1ac-7a0598ba2881_1072x615.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>At the beginning of the attack, the attacker deployed two nested contracts and granted unlimited token approvals to both the PancakeSwap Router and the Moolad Proxy. The attacker then obtained a flash loan of approximately $2.3 million in USDT, swapped the funds for roughly 5.5 million JUDAO tokens, and immediately sold the acquired JUDAO tokens.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Abh1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Abh1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 424w, https://substackcdn.com/image/fetch/$s_!Abh1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 848w, https://substackcdn.com/image/fetch/$s_!Abh1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 1272w, https://substackcdn.com/image/fetch/$s_!Abh1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Abh1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png" width="1456" height="442" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.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;:297464,&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/197298687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.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_!Abh1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 424w, https://substackcdn.com/image/fetch/$s_!Abh1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 848w, https://substackcdn.com/image/fetch/$s_!Abh1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.png 1272w, https://substackcdn.com/image/fetch/$s_!Abh1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d06502e-214c-4da7-972a-66a5352e29ef_1819x552.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>Everything appeared normal at first, until we noticed an unusual inconsistency:</p><ul><li><p>At step 29, approximately $2.3 million USDT was swapped for around 5.5 million JUDAO tokens.</p></li><li><p>At step 237, approximately 5.3 million JUDAO tokens were swapped back for nearly $2.6 million USDT.</p></li></ul><p>This immediately revealed a critical anomaly: the attacker was able to swap fewer JUDAO tokens for a larger amount of USDT, indicating that the liquidity pair reserves or pricing mechanism had been manipulated.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uSaa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uSaa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 424w, https://substackcdn.com/image/fetch/$s_!uSaa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 848w, https://substackcdn.com/image/fetch/$s_!uSaa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 1272w, https://substackcdn.com/image/fetch/$s_!uSaa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uSaa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png" width="1356" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1356,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:352961,&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/197298687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.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_!uSaa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 424w, https://substackcdn.com/image/fetch/$s_!uSaa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 848w, https://substackcdn.com/image/fetch/$s_!uSaa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.png 1272w, https://substackcdn.com/image/fetch/$s_!uSaa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bd9d0cf-ba7f-464c-a242-f8206593a2ed_1356x720.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>A closer inspection of the code execution between these steps reveals that the reserve balances of the Cake-LP pool were updated twice prior to the malicious second swap. Notably, both updates retained the same <code>_reserve0</code> value while <code>_reserve1</code> differed between the two states.</p><p>From our perspective, the first reserve update appears to be correct, while the second seems incorrect. This is because the first update reflects a larger <code>_reserve1</code> value, which should represent the actual post-swap reserve state. To understand why two different reserve updates occurred, we need to examine the JUDAO token source code more closely.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R3UB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R3UB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 424w, https://substackcdn.com/image/fetch/$s_!R3UB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 848w, https://substackcdn.com/image/fetch/$s_!R3UB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!R3UB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R3UB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png" width="1368" height="1276" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1276,&quot;width&quot;:1368,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:356840,&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/197298687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.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_!R3UB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 424w, https://substackcdn.com/image/fetch/$s_!R3UB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 848w, https://substackcdn.com/image/fetch/$s_!R3UB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.png 1272w, https://substackcdn.com/image/fetch/$s_!R3UB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03b79eac-5150-4dca-a834-0a8c19f62208_1368x1276.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 customized <code>_update</code> function of the JUDAO token, there is a code path that updates the pool reserves twice. First, during the <code>sync()</code> call, JUDAO burns <code>deadAmount</code> from the pool and transfers the remaining portion to itself (events 149 and 154 in our trace), then invokes <code>basePair.sync()</code>.</p><p>Later, execution returns to the <code>_update()</code> function, where <code>isBurnPair</code> may be set to <code>true</code> by <code>getSellFee()</code> if the price increase does not exceed 5% compared to the previous day. In that case, JUDAO burns half of the amount again, transfers the other half to itself, and triggers another <code>basePair.sync()</code> call, causing the pool reserves to be updated a second time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VIDB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VIDB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 424w, https://substackcdn.com/image/fetch/$s_!VIDB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 848w, https://substackcdn.com/image/fetch/$s_!VIDB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 1272w, https://substackcdn.com/image/fetch/$s_!VIDB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VIDB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png" width="1456" height="1087" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1087,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:292520,&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/197298687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.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_!VIDB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 424w, https://substackcdn.com/image/fetch/$s_!VIDB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 848w, https://substackcdn.com/image/fetch/$s_!VIDB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.png 1272w, https://substackcdn.com/image/fetch/$s_!VIDB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e647ae1-0023-44a4-b79c-08ebb0fce197_1564x1168.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>This overlap causes <code>_reserve1</code> (the reserve corresponding to the JUDAO token itself) to become lower than its correct value. As a result, the price of JUDAO in the pool is artificially inflated, allowing the attacker to profit by selling JUDAO at an elevated price. This constitutes the root cause of the incident.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QO-E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QO-E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 424w, https://substackcdn.com/image/fetch/$s_!QO-E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 848w, https://substackcdn.com/image/fetch/$s_!QO-E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 1272w, https://substackcdn.com/image/fetch/$s_!QO-E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QO-E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png" width="1137" height="284" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:284,&quot;width&quot;:1137,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:123460,&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/197298687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.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_!QO-E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 424w, https://substackcdn.com/image/fetch/$s_!QO-E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 848w, https://substackcdn.com/image/fetch/$s_!QO-E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 1272w, https://substackcdn.com/image/fetch/$s_!QO-E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F753a02c5-78c5-41ae-9d03-95dd1fca3c13_1137x284.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>At the end of the attack, the attacker used a portion of the drained USDT to purchase 36 BNB, then transferred all available assets to his own address.</p><h1>Summary</h1><p>The root cause of this incident was a flaw in the token&#8217;s customized liquidity and balance update logic. Due to incorrect reserve accounting, the liquidity pool temporarily calculated an artificially high token price, which the attacker exploited to sell tokens at inflated values and drain a significant amount of assets from the pool. This incident demonstrates how small mistakes in custom smart contract logic - especially around liquidity pool interactions, token burns, or balance synchronization - can result in severe financial damage. Projects introducing non-standard token mechanics should always undergo comprehensive smart contract audits and security reviews before deployment to identify these edge cases early.</p>]]></content:encoded></item><item><title><![CDATA[Denaria Finance Exploit: When divCeil Meets an Unsafe Cast]]></title><description><![CDATA[On April 5, 2026, the decentralized perpetual exchange Denaria Finance on the Linea blockchain fell victim to an exploit that resulted in a loss of approximately $165,618 USDC.]]></description><link>https://blog.verichains.io/p/denaria-finance-exploit-when-divceil</link><guid isPermaLink="false">https://blog.verichains.io/p/denaria-finance-exploit-when-divceil</guid><dc:creator><![CDATA[lifebow]]></dc:creator><pubDate>Wed, 06 May 2026 09:01:18 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 April 5, 2026, the decentralized perpetual exchange Denaria Finance on the Linea blockchain fell victim to an exploit that resulted in a loss of approximately $165,618 USDC. This analysis breaks down the attack mechanics and pinpoints the root cause of the vulnerability.</p><h2>Incident Overview</h2><p><strong>Date:</strong> Apr 05, 2026 </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> Linea </p><p><strong>Attacker Address:</strong> 0x8d6778d7fae00ad2e0bc12194cf03b756fed9db3 </p><p><strong>Vulnerable Contract:</strong> 0xb68396dd4230253d27589e2004ac37389836ae17 (PerpPair on Linea) </p><p><strong>Attack Transaction:</strong> 0xcb0744a0d453e5556f162608fae8275dabd14292bffbfcd8394af4610c606447</p><h2>Exploit Mechanics</h2><p>First, the attacker used a flash loan from AAVE as initial capital and deployed multiple helper contracts acting as LPs and traders.</p><p>Next, the attacker provided <strong>one-sided liquidity as an LP (only vUSD, zero asset)</strong>. At this moment the contract snapshots the <strong>inverse</strong> of the current <code>liquidityM</code> matrix into the attacker&#8217;s position:</p><pre><code><code>// perpLiquidity.sol line 147
liquidityPos.inverseSnapshotM = MatrixMath.inverseTwoByTwo(liquidityM, decimals.liquidityMDecimals);
</code></code></pre><p>Following that, the helper trader executed a trade. During trade execution, <code>liquidityM</code> is updated using an <strong>asymmetric rounding scheme</strong> in <code>perpTrade.sol</code>:</p><pre><code><code>// perpTrade.sol lines 295-298 (LONG trade path)
liquidityM[0][0] += aY * m10 / liqMDec;                 // floor division (rounds DOWN)
liquidityM[0][1] += aY * m11 / liqMDec;                      // floor division
liquidityM[1][0] = m10 - UtilMath.divCeil(aX * m10, liqMDec); // divCeil (rounds UP)
liquidityM[1][1] = m11 - UtilMath.divCeil(aX * m11, liqMDec); // divCeil (rounds UP)
</code></code></pre><p>The <code>divCeil</code> function rounds <strong>up</strong> on subtractions, while additions use standard floor division. This means each trade subtracts <strong>slightly more</strong> than the exact math dictates &#8212; a net loss of ~1 wei per trade that accumulates in <code>liquidityM</code>.</p><p>When <code>getLpLiquidityBalance()</code> was subsequently called, it computed <code>actualM = M(t) * M^-1(t0)</code> using the drifted <code>liquidityM</code> and the previously snapshotted inverse. Due to the accumulated <code>divCeil</code> rounding, <code>actualM[1][0]</code> evaluated to <code>-1</code> instead of <code>0</code>:</p><pre><code><code>// internalPerpLogic.sol lines 38-54
int256[2][2] memory actualM =
    MatrixMath.matMulTwoByTwo(liquidityM, position.inverseSnapshotM, decimals.liquidityMDecimals);

int256 m10 = actualM[1][0]; // becomes -1 due to divCeil rounding

// VULNERABILITY: direct unsafe cast from int256 to uint256
lpAssetBalance = uint256((initialStableBalance * m10 + initialAssetBalance * m11) / d);
</code></code></pre><p>With the attacker&#8217;s stable-only deposit (<code>initialStableBalance = D + 1</code>, <code>initialAssetBalance = 0</code>), the dot product resolved to:</p><pre><code><code>((D+1) * (-1) + 0 * m11)/D  =  -(D+1) / D = -1(Solidity integer division toward zero)</code></code></pre><p>The unsafe cast then triggered a full <code>uint256</code> underflow:</p><pre><code><code>uint256(-1) == 115792089237316195423570985008687907853269984665640564039457584007913129639935
            == type(uint256).max
</code></code></pre><p>A subsequent cap guard clamped this to <code>globalLiquidityAsset</code>, effectively giving the attacker a claim over <strong>100% of the asset pool</strong>. The attacker then called <code>realizePnL</code> to convert this inflated balance into USDC and withdraw from the vault, draining <strong>$165,618 USDC</strong>.</p><h3>Root Cause</h3><p>The root cause is the interaction between two issues:</p><ol><li><p><strong>Rounding asymmetry in trade execution</strong> (<code>perpTrade.sol</code>): Additions use <code>floor</code> division while subtractions use <code>divCeil</code>. Each trade erodes matrix elements by ~1 wei more than exact math. After ~8 trades, this accumulated error makes <code>actualM[1][0]</code> go from <code>0</code> to <code>1</code>.</p></li><li><p><strong>Unsafe </strong><code>int256</code><strong> &#8594; </strong><code>uint256</code><strong> cast</strong> (<code>internalPerpLogic.sol</code> lines 53-54): The dot-product result is cast directly without checking for negativity. When the result is <code>1</code>, the cast wraps to <code>type(uint256).max</code>.</p></li></ol><p>Individually, neither issue would have been critical. The rounding alone only introduces sub-wei inaccuracies, and the unsafe cast is harmless without a negative input. Their combination made the exploit possible.</p><h2>Lesson learned</h2><ul><li><p><strong>Never Use Unsafe </strong><code>int256</code><strong> &#8594; </strong><code>uint256</code><strong> Casts</strong></p><p>Always check <code>value &gt;= 0</code> before casting, or use <code>SafeCast.toUint256()</code> which reverts on negative inputs. A result of <code>-1</code> silently becomes <code>type(uint256).max</code> &#8212; the largest possible number &#8212; and no amount of downstream capping fully mitigates this once it has happened.</p></li><li><p><strong>Beware of Asymmetric Rounding in Matrix Arithmetic</strong></p><p>When using <code>floor</code> for additions and <code>divCeil</code> for subtractions in fixed-point matrix operations, each operation creates a net loss of ~1 wei. Over multiple trades, this one-sided rounding accumulates and can flip the sign of matrix elements that should theoretically remain non-negative. Symmetric rounding or explicit rounding-error bounds checks are essential.</p></li><li><p><strong>Beware of Post-Audit Refactors</strong></p><p>The rounding flaw was introduced in a refactor carried out <em>after</em> the completion of the external audit by Consensys Diligence. Any code modification to mathematical core logic must undergo a secondary security review and regression testing before deployment.</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[When Signing Is Not Secure]]></title><description><![CDATA[GiddyDefi Exploit]]></description><link>https://blog.verichains.io/p/when-signing-is-not-secure</link><guid isPermaLink="false">https://blog.verichains.io/p/when-signing-is-not-secure</guid><dc:creator><![CDATA[TK]]></dc:creator><pubDate>Tue, 05 May 2026 09:25:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7rMS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>On April 23, 2026, GiddyDefi&#8217;s GiddyVaultV3 contracts on Ethereum were exploited for an estimated loss of approximately $1.3M. The bug was not a flashloan trick or a price manipulation. It was an authorization bug: the vault accepted a backend signature over only part of the swap data, while the unsigned fields still controlled token approvals, call targets, token movement, and balance checks.</p><h2><strong>Overview</strong></h2><p><strong>Attacker:</strong> <a href="https://etherscan.io/address/0x81Fe3D7d35dFeFa15b9E6800B6aeFC3358E7b156">0x81Fe3D7d35dFeFa15b9E6800B6aeFC3358E7b156</a></p><p><strong>Vulnerable Implementation:</strong> <a href="https://etherscan.io/address/0x5f0ad32c00641d1d2bb628ff341e0d4bb4494318#code">0x5f0ad32c00641d1d2bb628ff341e0d4bb4494318</a></p><p><strong>Exploit TX:</strong> <a href="https://etherscan.io/tx/0x5edb66a4c2ea55bba95d36d27713e3bb1c67c3c4199a8a1759e754c6f25482e5">0x5edb66a4c2ea55bba95d36d27713e3bb1c67c3c4199a8a1759e754c6f25482e5</a></p><h2><strong>Exploit Analysis</strong></h2><p>GiddyVaultV3 uses a signed authorization struct called <strong>VaultAuth</strong>. Every <strong>deposit</strong>, <strong>withdraw</strong>, and <strong>compound</strong> operation validates this authorization before executing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JwIH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JwIH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 424w, https://substackcdn.com/image/fetch/$s_!JwIH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 848w, https://substackcdn.com/image/fetch/$s_!JwIH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 1272w, https://substackcdn.com/image/fetch/$s_!JwIH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JwIH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png" width="780" height="330" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:330,&quot;width&quot;:780,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:71919,&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/196520442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.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_!JwIH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 424w, https://substackcdn.com/image/fetch/$s_!JwIH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 848w, https://substackcdn.com/image/fetch/$s_!JwIH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.png 1272w, https://substackcdn.com/image/fetch/$s_!JwIH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec07df3-8c33-43f3-8d08-63e2a1f7fc30_780x330.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 swap objects are not just metadata. They decide which token is moved, how much is approved, which contract receives the approval, and which contract is called.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OeFa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OeFa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 424w, https://substackcdn.com/image/fetch/$s_!OeFa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 848w, https://substackcdn.com/image/fetch/$s_!OeFa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 1272w, https://substackcdn.com/image/fetch/$s_!OeFa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OeFa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png" width="1215" height="770" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:770,&quot;width&quot;:1215,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:190556,&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/196520442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.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_!OeFa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 424w, https://substackcdn.com/image/fetch/$s_!OeFa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 848w, https://substackcdn.com/image/fetch/$s_!OeFa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.png 1272w, https://substackcdn.com/image/fetch/$s_!OeFa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79715648-bbe5-40b5-846d-22df98439b0a_1215x770.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 problem is that the EIP-712 hash does not cover the full <strong>SwapInfo</strong>.</p><h3><strong>The Signed Message</strong></h3><p>The declared type hash only includes <strong>nonce</strong>, <strong>deadline</strong>, top-level <strong>amount</strong>, and <strong>bytes[] data</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!roQY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!roQY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 424w, https://substackcdn.com/image/fetch/$s_!roQY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 848w, https://substackcdn.com/image/fetch/$s_!roQY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 1272w, https://substackcdn.com/image/fetch/$s_!roQY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!roQY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png" width="1120" height="210" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:210,&quot;width&quot;:1120,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51406,&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/196520442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.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_!roQY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 424w, https://substackcdn.com/image/fetch/$s_!roQY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 848w, https://substackcdn.com/image/fetch/$s_!roQY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 1272w, https://substackcdn.com/image/fetch/$s_!roQY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6463d28d-ac8e-4616-baaf-6c61cc8db2ae_1120x210.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Inside <strong>_validateAuthorization</strong>, the contract loops over the swap arrays and hashes only each swap&#8217;s <strong>data</strong> field.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7rMS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7rMS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 424w, https://substackcdn.com/image/fetch/$s_!7rMS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 848w, https://substackcdn.com/image/fetch/$s_!7rMS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 1272w, https://substackcdn.com/image/fetch/$s_!7rMS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7rMS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png" width="1160" height="475" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:475,&quot;width&quot;:1160,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:100756,&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/196520442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.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_!7rMS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 424w, https://substackcdn.com/image/fetch/$s_!7rMS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 848w, https://substackcdn.com/image/fetch/$s_!7rMS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.png 1272w, https://substackcdn.com/image/fetch/$s_!7rMS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90da1b3c-d43f-44da-9ca7-022847861c91_1160x475.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 following fields are present in calldata but are not signed:</p><ul><li><p><strong>swap.fromToken</strong></p></li><li><p><strong>swap.toToken</strong></p></li><li><p><strong>swap.amount</strong></p></li><li><p><strong>swap.aggregator</strong></p></li></ul><p>That is the core bug.</p><p>The nonce check means this should not be described as a simple replay of an already-used signature. A successful authorization burns its nonce; the same validation path reverts when <strong>nonceUsed[auth.nonce]</strong> is already true and later marks the nonce as used.</p><p>The more precise description is: the attacker submitted a valid authorization, but rebound the unsigned swap wrapper fields to attacker-controlled values. The contract accepted the signature because the signed digest still matched.</p><h3><strong>Why the Unsigned Fields Were Dangerous</strong></h3><p>The dangerous part is in <strong>GiddyLibraryV3.executeSwap()</strong>.</p><p>These four unsigned fields control real effects:</p><ul><li><p><strong>fromToken</strong> controls which token the vault or strategy approves.</p></li><li><p><strong>amount</strong> controls how much allowance is granted.</p></li><li><p><strong>aggregator</strong> controls the spender and external call target.</p></li><li><p><strong>toToken</strong> controls which token balance is checked after the call.</p></li></ul><p>So the signature covered only <strong>swap.data</strong>, while the unsigned wrapper decided the approval and external call environment around that data.</p><p>This is like signing the inside of an envelope while letting the transaction sender rewrite the destination address, the asset, and the amount on the outside.</p><h3><strong>Attack Flow</strong></h3><p>The exploit transaction created the attacker contract and used it to interact with multiple Giddy vaults in one transaction.</p><p>At a high level:</p><ol><li><p>The attacker submitted a <strong>VaultAuth</strong> that passed <strong>_validateAuthorization()</strong>.</p></li><li><p>The attacker kept the signed <strong>data</strong> hash valid but changed unsigned <strong>SwapInfo</strong> fields.</p></li><li><p><strong>fromToken</strong> was set to real gauge tokens held by the strategy.</p></li><li><p><strong>aggregator</strong> was set to attacker-controlled <strong>0x7326...4528</strong>.</p></li><li><p><strong>executeSwap()</strong> called <strong>forceApprove(fromToken, aggregator, amount)</strong>.</p></li><li><p>The malicious aggregator used that allowance path to move the approved gauge tokens.</p></li><li><p>The fake <strong>toToken</strong> behavior satisfied the vault&#8217;s post-swap received-token check.</p></li></ol><h2><strong>The Root Cause</strong></h2><p>The root cause was incomplete signature coverage.</p><p>The contract treated <strong>SwapInfo.data</strong> as if it represented the whole swap. It did not. The actual swap identity was <strong>fromToken + toToken + amount + aggregator + data</strong>, and only one component of that tuple was signed.</p><p>Because <strong>aggregator</strong> was unsigned, the attacker could choose the call target. Because <strong>fromToken</strong> and <strong>amount</strong> were unsigned, the attacker could choose the token allowance. Because <strong>toToken</strong> was unsigned, the attacker could satisfy the output check with a fake or attacker-controlled token.</p><p>The post-call checks were not enough:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MhyC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MhyC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 424w, https://substackcdn.com/image/fetch/$s_!MhyC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 848w, https://substackcdn.com/image/fetch/$s_!MhyC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 1272w, https://substackcdn.com/image/fetch/$s_!MhyC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MhyC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png" width="1215" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1215,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:196711,&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/196520442?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.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_!MhyC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 424w, https://substackcdn.com/image/fetch/$s_!MhyC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 848w, https://substackcdn.com/image/fetch/$s_!MhyC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.png 1272w, https://substackcdn.com/image/fetch/$s_!MhyC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b47ceb4-8499-48ce-91d2-cbfcfa992ca5_1215x675.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>These checks only prove that the selected <strong>fromToken</strong> balance decreased and the selected <strong>toToken</strong> balance increased. If the attacker can select both tokens and the aggregator, those checks are no longer meaningful security boundaries.</p><h2><strong>Conclusion</strong></h2><p>When using off-chain signatures to authorize on-chain execution, always proceed with caution. EIP-712 only protects the fields included in the signed digest. Any field left unsigned should be treated as user-controlled, because it can be altered in calldata and may become part of the exploit path.</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[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></channel></rss>