<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Immunefi Editor on Medium]]></title>
        <description><![CDATA[Stories by Immunefi Editor on Medium]]></description>
        <link>https://medium.com/@ImmunefiEditor?source=rss-583086651f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Uu1sDIGbVHV1XmW6HEStDQ.jpeg</url>
            <title>Stories by Immunefi Editor on Medium</title>
            <link>https://medium.com/@ImmunefiEditor?source=rss-583086651f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 05:21:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ImmunefiEditor/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Top 3 Bugs from the ThunderNFT Invite Only Program]]></title>
            <link>https://medium.com/immunefi/top-3-bugs-from-the-thundernft-invite-only-program-373da9824cc9?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/373da9824cc9</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Wed, 18 Dec 2024 07:06:05 GMT</pubDate>
            <atom:updated>2026-07-20T09:26:40.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lRYzUxm-RNgcxVhBK1W0-A.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/top-3-bugs-from-the-thundernft-invite-only-program/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>From 12th August to 2nd September 2024, the ThunderNFT protocol hosted an Invite-Only Program (IOP) on the Immunefi platform for researchers to hunt on code for their unique NFT marketplace on Fuel, an L2 on Ethereum that utilizes Fuel VM.</p><p>An IOP is a form of Audit Competition which is exclusively accessible to a select group of security researchers, and in this case, they consist of researchers who have submitted at least 1 valid report during the Fuel Attackathon event.</p><p>A total of 12 researchers were invited to compete, and 41 valid reports were rewarded from a pool of $65,000 USDC.</p><p>Here are the top three findings from the Shardeum Ancillaries audit competition, as identified by the Immunefi team. As of this publication, all vulnerabilities have been FIXED.</p><h3>1. Insufficient validation in order modifications leading to the theft of NFTs — 34980</h3><ul><li><strong>Finder:</strong> <a href="https://immunefi.com/profile/Solosync6/">Solosync6</a></li><li><strong>Severity:</strong> Critical</li><li><strong>Asset:</strong> <a href="https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/thunder_exchange/src/main.sw">https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/thunder_exchange/src/main.sw</a></li></ul><p>The contract includes a functionality that allows users to update their orders from the buying side to the selling side using the <a href="https://github.com/ThunderFuel/smart-contracts/blob/260c9859e2cd28c188e8f6283469bcf57c9347de/contracts-v1/thunder_exchange/src/main.sw#L113">update_order(…)</a> function. However, a vulnerability exists in the <a href="https://github.com/ThunderFuel/smart-contracts/blob/260c9859e2cd28c188e8f6283469bcf57c9347de/contracts-v1/thunder_exchange/src/main.sw#L113">update_order(…)</a> function due to insufficient validation of NFT ownership.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/029d8b59e4e3cb732aa7df7361c7e4ed/href">https://medium.com/media/029d8b59e4e3cb732aa7df7361c7e4ed/href</a></iframe><p>It is important to note that switching sides is permitted within <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L310">_validate_maker_order_input</a>.</p><p>However, critically, there is no validation to ensure that the attacker actually owns the NFT when the order side is changed. This flaw enables a user to set a sell order for an arbitrary NFT without properly verifying ownership.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba2257284fe9ba7e980cdb4fb8071973/href">https://medium.com/media/ba2257284fe9ba7e980cdb4fb8071973/href</a></iframe><p>On cancellation, the NFT asset is transferred back to the maker, only this time, the maker was never the original owner of the NFT.</p><p>An attacker can exploit this by calling the <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L146">cancel_order(…)</a> function. During the cancellation process, the contract relies on the strategy contract to return the correct order information without performing additional ownership verification. This allows the attacker to transfer an arbitrary NFT to themselves, resulting in the theft of the NFT.</p><h4>PoC and Exploit Steps:</h4><ol><li>Create buy orders for valuable NFTs they do not own.</li><li>Convert these buy orders into sell orders without actually owning the NFTs.</li><li>Cancel these “sell” orders, potentially gaining possession of NFTs they never owned.</li></ol><p>Here is a test case that showcases the above exploit.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6e2c5ee5c630006c4b952c08f2c2cab2/href">https://medium.com/media/6e2c5ee5c630006c4b952c08f2c2cab2/href</a></iframe><h3>2. Hardcoded Logic in Execution Result Library Leads to Maker Losses — 34534</h3><ul><li><strong>Finder: </strong><a href="https://immunefi.com/profile/Ninetyninecrits/">NinetyNineCrits</a></li><li><strong>Severity:</strong> Critical</li><li><strong>Asset: </strong><a href="https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/libraries/src/execution_result.sw">https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/libraries/src/execution_result.sw</a></li></ul><p>The project allows makers to specify the desired quantity of an assetId through the <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/libraries/src/order_types.sw#L43">MakerOrder</a> struct as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/345dc4a8c2b03cb6a736ad02a0ad5cad/href">https://medium.com/media/345dc4a8c2b03cb6a736ad02a0ad5cad/href</a></iframe><p>However, when an order is fulfilled, the maker receives only a single unit of the assetId regardless of the specified quantity. Despite this, they are charged the full price for the order due to a hardcoded value in the contract.</p><p>When a taker fulfills a maker’s order, the <a href="https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/libraries/src/execution_result.sw#L14">_execute_sell_taker_order</a> function verifies that the taker has sent the required amount of tokens as part of the transaction call:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9b242cf1c970d1929db8d3a130369198/href">https://medium.com/media/9b242cf1c970d1929db8d3a130369198/href</a></iframe><p>Currently, <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L377">execution_result.amount</a> is hardcoded to 1, meaning the maker always receives only 1 unit of the specified tokenId, regardless of the quantity requested. This mismatch results in unexpected losses for the maker.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d812e6e3bc31159d07d0420468e3af1/href">https://medium.com/media/0d812e6e3bc31159d07d0420468e3af1/href</a></iframe><p>For ERC1155 tokens, the maker always receives only 1 unit of the specified tokenId, regardless of the requested quantity, resulting in unexpected losses.</p><h4>PoC and Exploit steps:</h4><ol><li>Deploy and initialize all project contracts, ensuring proper references between them.</li><li>Deploy a simple ERC1155 contract that allows arbitrary token minting.</li><li>The taker (seller) mints 10 tokens for themselves.</li><li>The maker (buyer) places an order for 10 units of the same AssetId minted by the taker.</li><li>The taker fills the order but transfers only 1 unit (the transaction fails if more units are transferred).</li><li>Verify that the maker received only 1 unit of the ERC1155 token instead of the requested 10 units.</li></ol><p>Here is a test case that showcases the above exploit.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1368647d21c5143ac72f70c69a1819e5/href">https://medium.com/media/1368647d21c5143ac72f70c69a1819e5/href</a></iframe><h3>3. Flawed Logic in ThunderExchange: NFT Owners with Sell Order Blocked from Accepting Bids — 34714</h3><ul><li><strong>Finder:</strong> <a href="https://immunefi.com/profile/zerok/">zeroK</a></li><li><strong>Severity:</strong> Medium</li><li><strong>Asset: </strong><a href="https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/thunder_exchange/src/main.sw">https://github.com/ThunderFuel/smart-contracts/blob/main/contracts-v1/thunder_exchange/src/main.sw</a></li></ul><p>The <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L377">_execute_sell_taker_order</a> function validates msg_asset() when the user calls the <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L192">execute_order</a> function, making it impossible for the NFT seller to accept any bids.</p><p>This is because the <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L75">place_order</a> function requires the seller to transfer the NFT to the Thunder Exchange, leaving the seller without the asset_id (the NFT).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8cbddc2d31291c8f213ea3b97edafe0d/href">https://medium.com/media/8cbddc2d31291c8f213ea3b97edafe0d/href</a></iframe><p>To list an NFT, the owner must call the place_order function with Side == Sell.</p><p>When the seller decides to accept a bid, they need to call the execute_order function with Side == Sell.</p><p>However, the call to <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L192">execute_order</a> fails because the user is required to use the transfer function in Sway. This built-in function includes critical checks enforced by the <a href="https://docs.fuel.network/docs/specs/fuel-vm/instruction-set/#tr-transfer-coins-to-contract">FuelVM</a>, one of which ensures that the caller possesses the specified asset_id and the required amount.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/10d72b62807d7563ddab1be955da50bc/href">https://medium.com/media/10d72b62807d7563ddab1be955da50bc/href</a></iframe><p>This makes it impossible for the seller to accept any bids; they must either wait for someone to buy the NFT directly or cancel the order.</p><p>As a result, sellers are unable to accept bid offers due to incorrect logic in the <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L377">_execute_sell_taker_order</a> function, which causes the transaction to revert when a bid is accepted.</p><h4>PoC and Exploit Steps:</h4><ol><li>Initialize all necessary contracts and configure them, including adding strategies and assets.</li><li>The NFT owner places a sell order, transferring their NFT to the ThunderExchange contract.</li><li>A bidder places a buy order targeting the same NFT but at a lower price.</li><li>The NFT owner attempts to accept the buy order, but the <a href="https://github.com/ThunderFuel/smart-contracts/blob/9da308e6b70c43b5e7564c8ac1254a2fe29a7da8/contracts-v1/thunder_exchange/src/main.sw#L192">execute_order</a> function fails as the NFT is no longer in their possession.</li><li>The PoC highlights a logic flaw that prevents NFT owners from accepting bids while their NFT is listed for sale.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fccdb5db7802ee34de21f1488fc290d5/href">https://medium.com/media/fccdb5db7802ee34de21f1488fc290d5/href</a></iframe><p>For more interesting bugs and writeups about web3 security, do check out our <a href="https://immunefi.medium.com/">Medium</a> as well as follow our <a href="https://x.com/immunefi">X/Twitter</a> to get daily updates!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=373da9824cc9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/top-3-bugs-from-the-thundernft-invite-only-program-373da9824cc9">Top 3 Bugs from the ThunderNFT Invite Only Program</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 3 Bugs from the Shardeum Ancillaries Audit Competition]]></title>
            <link>https://medium.com/immunefi/top-3-bugs-from-the-shardeum-ancillaries-audit-competition-6219eb236e54?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6219eb236e54</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Tue, 12 Nov 2024 11:31:59 GMT</pubDate>
            <atom:updated>2026-07-20T09:31:50.700Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4lVMbCX-XfIPX-YLHZ17g.jpeg" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/top-3-bugs-from-the-shardeum-ancillaries-audit-competition/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>From <em>July 8 to August 14, 2024</em>, the Shardeum protocol hosted two simultaneous audit competitions on the Immunefi platform, Shardeum Core and Shardeum Ancillaries, welcoming top whitehat talents to find vulnerabilities within their unique EVM-based network infrastructure.</p><p>52 of the very best submissions of various severities from participating whitehats were rewarded from a pool of up to $500,000 USDC.</p><p>Here are the top three findings from the Shardeum Ancillaries audit competition, as identified by the Immunefi team.</p><p>Throughout the event, an active development phase was in progress, allowing for real-time fixes of the identified issues. As of this publication, all vulnerabilities have been FIXED.</p><h3>1. Malicious Archiver can overwrite account data on any active archiver — 34508</h3><p><strong>Finder: </strong><a href="https://immunefi.com/profile/periniondon630/">periniondon630</a></p><p><strong>Severity</strong>: Critical</p><p><strong>Asset</strong>: <a href="https://github.com/shardeum/archive-server">https://github.com/shardeum/archive-server</a></p><p>Archive servers are responsible for maintaining transaction receipts and sharing them across the network using the gossip endpoint. When an archive server receives a receipt, it invokes the <a href="https://github.com/shardeum/archive-server/blob/dev/src/Data/Collector.ts#L1410">collectMissingReceipts</a> function to check whether the receipt is unique.</p><p>If the receipt is unique, collectMissingReceipts forwards the receipt data to the <a href="https://github.com/shardeum/archive-server/blob/dev/src/Data/Collector.ts#L765">storeReceiptData</a> function to log the transaction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b638d64e7b34e8df2ffa316b2edddae/href">https://medium.com/media/1b638d64e7b34e8df2ffa316b2edddae/href</a></iframe><p>As we can see, the collectMissingReceipts function only validates if the supplied receipt data contains txId and txTimestamp and doesn’t filter or strip out any extra data from the receipt object before forwarding it to the storeReceiptData function, which allows a malicious actor to attach extra fields related to account settings in the receipt.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12994a9124a0d75fa538518c2f00bfb7/href">https://medium.com/media/12994a9124a0d75fa538518c2f00bfb7/href</a></iframe><p>When storeReceiptData processes the attacker-crafted receipt containing global account config fields, it interprets those fields as instructions to update the account settings.</p><p><strong>The exploit steps are as follows:</strong></p><ol><li>A malicious archiver initiates a gossip request to the victim archiver.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad2575dbdb8855dd8aae59f7c3fe7391/href">https://medium.com/media/ad2575dbdb8855dd8aae59f7c3fe7391/href</a></iframe><p>2. The victim archiver requests details about the receipt.</p><p>3. The malicious archiver sends crafted receipt data that replaces the global network account.</p><p>4. The victim archiver stores the data, resulting in changes to the global network account settings.</p><h3>2. Bypassing Same-Site Through XSS to Shutdown Node — 33692</h3><p><strong>Finder: </strong><a href="https://immunefi.com/profile/neplox/">neplox</a>, <a href="https://x.com/neploxaudit">@neploxaudit</a></p><p><strong>Severity</strong>: Low</p><p><strong>Asset</strong>: <a href="https://github.com/shardeum/validator-gui">https://github.com/shardeum/validator-gui</a></p><p>Before delving into the technical details of the vulnerability, let’s look at the SameSite=Strict attribute, a browser security mechanism used in the validator-gui for Cross-Site Request Forgery (CSRF) protection.</p><p>CSRF attacks occur when an attacker tricks a victim into performing unintended actions on a website where they are already logged in. For instance, the attacker might lure the user into submitting a form on a malicious site, which then sends a request to vulnerable.com/account/settings to make unauthorized changes.</p><p>When cookies are set to SameSite=Strict, however, the browser is restricted from including cookies in cross-site requests. While this reduces the risk of CSRF attacks, it doesn’t provide complete protection. Cookies are still included in same-site requests from different subdomains or ports within the same top-level domain (e.g., app.vulnerable.com or vulnerable.com:1337).</p><p>If you are interested in learning more about SameSite cookies, check out this amazing article: <a href="https://jub0bs.com/posts/2021-01-29-great-samesite-confusion/">The great SameSite confusion</a></p><p>In this case, validator-gui relied solely on SameSite=Strict to protect against CSRF, without associating unguessable and random tokens with HTTP requests. A whitehat exploited the lack of a CSRF token at &lt;validator-gui&gt;/api/node/stop by chaining an XSS vulnerability in shardus-core, as these applications are likely to be hosted on the same server.</p><p>The validatorListRoute function of shardus-core, located in <a href="https://github.com/shardeum/shardus-core/blob/dev/src/p2p/SyncV2/routes.ts#L68">/src/p2p/SyncV2/routes.ts</a> , retrieves a list of validators based on a hash in a GET request. If the hash doesn’t match any records, the function returns a 404 error with the user-supplied hash unsanitized:</p><pre>res.status(404).json({ error: `validator list with hash &#39;${expectedHash}&#39; not found` })</pre><p>This means an attacker could execute malicious JavaScript code by crafting a URL like this:</p><pre>https://shardus-core.example.com/validator-list?hash=&lt;img src=x onerror=fetch(&quot;https://validator-gui.example.com/api/node/stop&quot;)&gt;</pre><p><strong>The exploit steps are as follows:</strong></p><p>1. The victim authenticates to <strong>validator-gui.example.com</strong>.</p><p>2. The malicious actor tricks the victim into visiting following URL to trigger the XSS:</p><pre>https://shardus-core.example.com/validator-list?hash=&lt;img src=x onerror=fetch(&quot;https://validator-gui.example.com/api/node/stop&quot;, {&quot;credentials&quot;:&quot;include&quot;,&quot;method&quot;:&quot;post&quot;})&gt;</pre><p>3. The browser sends a request to <a href="https://validator-gui.example.com/api/node/stop">https://validator-gui.example.com/api/node/stop</a> using the victim’s session, due to “credentials”: “include”.</p><p>4. The node is shut down without the victim’s knowledge</p><h3>3. Archive-Server can be killed by connected shardus-instance — 34298</h3><p><strong>Finder:</strong> <a href="https://immunefi.com/profile/riproprip/">riproprip</a>, <a href="https://x.com/riproprip">@riproprip</a></p><p><strong>Severity</strong>: Medium</p><p><strong>Asset</strong>: <a href="https://github.com/shardeum/archive-server">https://github.com/shardeum/archive-server</a></p><p>The Archive Server uses an outdated version of Socket.IO that is vulnerable to <a href="https://rafa.hashnode.dev/cve-2023-32695">CVE-2023–32695</a>, allowing a connected shardus-instance to crash the Archive Server by sending a malformed packet.</p><p>A typical Socket.IO packet looks like this:</p><pre>42[&quot;eventName&quot;, &quot;String Value&quot;, {&quot;Object&quot;: &quot;value&quot;}]</pre><p>However, a malicious shardus-instance can send a packet like:</p><pre>42[{&quot;toString&quot;:&quot;1337&quot;}, &quot;1337&quot;]</pre><p>When the Socket.IO parser in the Archive Server processes this packet, JavaScript tries to convert the object to a string by calling the toString() method. If toString is defined as a property instead of a function, it will cause an error because it cannot be invoked as a method.</p><p><strong>Proof of concept:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/116ddafb8ebcf10ce8916f8e28c58c22/href">https://medium.com/media/116ddafb8ebcf10ce8916f8e28c58c22/href</a></iframe><p>Install packages and replace encoder with evil encoder:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da85a8a2830b6b1a068a687d22e3778e/href">https://medium.com/media/da85a8a2830b6b1a068a687d22e3778e/href</a></iframe><p>Run evil shardus instance:</p><pre>node evil-shardus.js</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6219eb236e54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/top-3-bugs-from-the-shardeum-ancillaries-audit-competition-6219eb236e54">Top 3 Bugs from the Shardeum Ancillaries Audit Competition</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 3 Bugs from the Shardeum Core Audit Competition]]></title>
            <link>https://medium.com/immunefi/top-3-bugs-from-the-shardeum-core-audit-competition-a13aee55b20f?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a13aee55b20f</guid>
            <category><![CDATA[whitehat]]></category>
            <category><![CDATA[immunefi]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web3]]></category>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Tue, 29 Oct 2024 10:57:39 GMT</pubDate>
            <atom:updated>2026-07-20T09:34:02.862Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sRukzTvJGj95TPMur53IdA.jpeg" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/top-3-bugs-from-the-shardeum-core-audit-competition/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>From <em>July 8 to August 14, 2024</em>, the Shardeum protocol hosted two simultaneous audit competitions on the Immunefi platform, Shardeum Core and Shardeum Ancillaries, welcoming top whitehat talents to find vulnerabilities within their unique EVM-based network infrastructure.</p><p>52 of the very best submissions of various severities from participating whitehats were rewarded from a pool of up to $500,000 USDC.</p><p>Here are the top three findings from the Shardeum Core audit competition, as identified by the Immunefi team.</p><p>Throughout the event, an active development phase was in progress, allowing for real-time fixes of the identified issues. As of this publication, all vulnerabilities have been FIXED.</p><h3>1. Account balance can be manipulated due to broken signature verification — Report 34456</h3><p><strong>Finder: </strong><a href="https://immunefi.com/profile/neplox/">neplox</a>, <a href="https://x.com/neploxaudit">@neploxaudit</a></p><p><strong>Severity:</strong> Critical</p><p><strong>Impact:</strong> Direct loss of funds</p><p><strong>Asset:</strong> <a href="https://github.com/shardeum/shardus-core/tree/dev">https://github.com/shardeum/shardus-core/tree/dev</a></p><p>It was possible to overwrite the account data of any address in the network on all validator nodes at once, effectively changing the state of the account in the whole network.</p><p>There are two internal protocol endpoints called repair_oos_accounts that are legitimately used by Shardeum validator nodes to restore broken accounts after consensus is reached.</p><p>However, the “repaired” account information is simply passed as an argument and its signatures are not verified. This fact allows to forge and send a request to “restore” any account to any value, breaking the intended AccountPatcher trie hash consensus mechanism.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c728ab9acd486dd12ad60b1b1f90775c/href">https://medium.com/media/c728ab9acd486dd12ad60b1b1f90775c/href</a></iframe><h3>2. Taking over the network with Golden Ticket — Report 33696</h3><p><strong>Finder: </strong><a href="https://immunefi.com/profile/zhouWu/">ZhouWu</a></p><p><strong>Severity:</strong> Critical</p><p><strong>Impact:</strong> Network not being able to confirm new transactions (total network shutdown</p><p><strong>Asset:</strong> <a href="https://github.com/shardeum/shardus-core/tree/dev">https://github.com/shardeum/shardus-core/tree/dev</a></p><p>An attacker could become part of the validator network without fulfilling the necessary conditions. This was made possible by the Golden Ticket system built into the protocol. This mechanism is intended for protocol operators, but insufficient ticket validation allows anyone to use it.</p><p>By gaining the majority of seats in the validator network, the attacker will gain control of the consensus and through this will be able to control the data in the network and the availability of the network.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5b0ee7446115bbd9951f2f0d4d4890a/href">https://medium.com/media/f5b0ee7446115bbd9951f2f0d4d4890a/href</a></iframe><h3>3. Decentralized operations could be performed without necessary consensus — Report 33632</h3><p><strong>Finder: </strong><a href="https://immunefi.com/profile/neplox/">neplox</a>, <a href="https://x.com/neploxaudit">@neploxaudit</a></p><p><strong>Severity:</strong> Critical</p><p><strong>Impact:</strong> Network not being able to confirm new transactions (total network shutdown)</p><p><strong>Asset:</strong> <a href="https://github.com/shardeum/shardeum/tree/dev">https://github.com/shardeum/shardeum/tree/dev</a></p><p>A malicious validator can mislead other nodes to sign data using unexpected fields in signAppData.</p><p>Due to lack of input validation in signAppData malicious validator can make network nodes to sign arbitrary data. The signAppData checks if appData has required fields: nominator, nominee, stake, certExp, but doesn’t check the presence of unexpected extra fields.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/88838ae541516bdd2d7e0684d7e3768e/href">https://medium.com/media/88838ae541516bdd2d7e0684d7e3768e/href</a></iframe><p>By obtaining the necessary signatures, an attacker can perform extensive reconfiguration of the Shardeum network up to full control of the network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a13aee55b20f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/top-3-bugs-from-the-shardeum-core-audit-competition-a13aee55b20f">Top 3 Bugs from the Shardeum Core Audit Competition</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 Bugs from the Fuel Attackathon]]></title>
            <link>https://medium.com/immunefi/top-5-bugs-from-the-fuel-attackathon-80eda8920505?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/80eda8920505</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 11:02:30 GMT</pubDate>
            <atom:updated>2026-07-20T09:40:34.702Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ZvXdqRw3JOorK3wfxr6ww.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/top-5-bugs-from-the-fuel-attackathon/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>From June 17th to July 22, 2024, Fuel protocol ran a month-long Attackathon on the Immunefi platform, welcoming top whitehat talents to find vulnerabilities within Fuel’s Layer 2 infrastructure. With a reward pool of up to <strong>$1 million USDC</strong>, participants were successful in uncovering interesting bugs with various severities.</p><p>These vulnerabilities are now FIXED, as of publication.</p><p>Here are the <strong>top five findings</strong>, as identified by Immunefi’s triagers, that showcased critical vulnerabilities and enhanced the security of the Fuel Network.</p><h3>1.Messages to L1 included during reverts allows theft from bridge — Report 32965</h3><p><strong>Severity: </strong>Critical</p><p><strong>Impact: </strong>Direct loss of funds</p><p><strong>Asset: </strong><a href="https://github.com/FuelLabs/fuel-core/tree/v0.31.0"><strong>https://github.com/FuelLabs/fuel-core/tree/v0.31.0</strong></a></p><p>The function <a href="https://github.com/FuelLabs/fuel-core/blob/c5b425e2b3e05899e83bed0090865a7f4ec30c78/crates/services/executor/src/executor.rs#L1349-L1386">executor/src/executor.rs::update_execution_data</a> adds all message_ids from the MessageOut receipts of the current tx to the execution data even if the tx itself has reverted.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/87786b2b848620f678f42e27c9e4fb21/href">https://medium.com/media/87786b2b848620f678f42e27c9e4fb21/href</a></iframe><p>This means it’s possible to send out messages to the L1 but revert the tx, which un-does the burn of the bridged tokens. This fake withdrawal can be repeated over and over, with the messages still being relayed on the L1, potentially allowing the theft of all tokens from the bridge.</p><p>The exploit steps are as follows:</p><ol><li>The attacker and victim both deposit the same amount of the same token</li><li>The attacker withdraws 2 times. For the first time, he reverts his transaction at the end, and the second time follows the regular flow. He can relay this twice, which will result in the attacker having double the amount of tokens he originally deposited.</li><li>As the victim withdraws, the process on the L2 side will be successful and his tokens will be burned. The relay process on L1 will fail, due to underflow (no tokens left)</li></ol><h3>2.ABI Supertraits are available externally — Report 33351</h3><p><strong>Severity: </strong>Critical<strong><br>Impact:</strong> Direct loss of funds</p><p><strong>Asset: </strong><a href="https://github.com/FuelLabs/sway/tree/v0.61.2"><strong>https://github.com/FuelLabs/sway/tree/v0.61.2</strong></a></p><p>ABI supertraits are, as the docs say, intended to make contract implementations compositional. As such they allow defining methods that can be inherited by the contract implementing the trait. However, what is essential is that these methods shouldn’t be available externally as contract methods. However, this is not the case, and the methods are available externally.</p><p>As we can see in <a href="https://github.com/FuelLabs/sway/blob/7f8f31843bed8459c53196bd6b689c0b05b05f61/sway-core/src/language/ty/program.rs#L131-L130">sway-core/src/language/ty/program.rs::validate_root</a>, ABI supertraits should not expose their methods to the user.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dd146e00a25db4406541baf7fff04fca/href">https://medium.com/media/dd146e00a25db4406541baf7fff04fca/href</a></iframe><p>The following example demonstrates how the renounce_ownership function is available externally when inheriting the Ownable traits. An attacker would have access to any supertraits of a contract.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eda3ec207ab3d688d569a927cd28ae16/href">https://medium.com/media/eda3ec207ab3d688d569a927cd28ae16/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72056eaaabc68e5b26d002dd28433575/href">https://medium.com/media/72056eaaabc68e5b26d002dd28433575/href</a></iframe><h3>3.Sway compiler wrongly modeled register usage of WQAM instruction — Report 32269</h3><p><strong>Severity: </strong>High</p><p><strong>Impact: </strong>Incorrect sway optimization leading to incorrect bytecode</p><p><strong>Asset: </strong><a href="https://github.com/FuelLabs/sway/tree/7b56ec734d4a4fda550313d448f7f20dba818b59">https://github.com/FuelLabs/sway/tree/7b56ec734d4a4fda550313d448f7f20dba818b59</a></p><p>The <a href="https://github.com/FuelLabs/sway/blob/7b56ec734d4a4fda550313d448f7f20dba818b59/sway-core/src/asm_lang/virtual_ops.rs#L658">sway/sway-core/src/asm_lang /virtual_ops.rs::def_registers</a> function and <a href="https://github.com/FuelLabs/sway/blob/7b56ec734d4a4fda550313d448f7f20dba818b59/sway-core/src/asm_lang/virtual_ops.rs#L541">sway/sway-core/src/asm_lang /virtual_ops.rs::use_registers</a> function are used to define which registers in the argument will be written to or read from by the given instruction. This information is used in DCE <a href="https://github.com/FuelLabs/sway/blob/7b56ec734d4a4fda550313d448f7f20dba818b59/sway-core/src/asm_generation/fuel/optimizations.rs#L212">optimization</a> to decide which instructions only write to “dead” registers and could be removed.</p><p>DCE is an optimization pass most compilers make which eliminates dead code (code that does not affect the program results). This decreases program size and increases program efficiency by eliminating unused instructions. However, the Sway DCE optimization step incorrectly labeled instructions which had results which were used as dead code, which were then removed from the output bytecode of the compiler.</p><p>In the function <a href="https://github.com/FuelLabs/sway/blob/7b56ec734d4a4fda550313d448f7f20dba818b59/sway-core/src/asm_lang/virtual_ops.rs#L580">sway/sway-core/src/asm_lang /virtual_ops.rs::use_registers</a>, we can see that WQAM is incorrectly thought to modify r1 while not relying on its value, while the actual behavior of the WQAM instruction uses r1 as a memory pointer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c2fbb74384eb313f0cc393306a1d3d7/href">https://medium.com/media/1c2fbb74384eb313f0cc393306a1d3d7/href</a></iframe><h3>4. Lack of Overflow Protection in pow Function for Unsigned Integers in standard libraries — Report 33227</h3><p><strong>Severity: </strong>Medium</p><p><strong>Impact: </strong>Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield</p><p><strong>Asset: </strong><a href="https://github.com/FuelLabs/sway/blob/ebc2ee6bf5d488e0ff693bfc8680707d66cd5392/sway-lib-std/src/math.sw">https://github.com/FuelLabs/sway/blob/ebc2ee6bf5d488e0ff693bfc8680707d66cd5392/sway-lib-std/src/math.sw</a></p><p>The pow function implementations for the u8, u16, and u32 types in the <a href="https://github.com/FuelLabs/sway/blob/ebc2ee6bf5d488e0ff693bfc8680707d66cd5392/sway-lib-std/src/math.sw#L114-L139">Sway standard math library</a> lack overflow protection. Overflow for larger data types like u64 and u256 is handled by the Fuel Virtual Machine (VM), but the VM does not handle overflow for the smaller types (u8, u16, u32). Consequently, when the result of the pow function exceeds the maximum value of the data type, the result wraps around without raising any errors. This can lead to incorrect calculations on the integration side of the contracts.</p><p>As we can see the issue is in the following Power function implementation for the types u8, u16, and u32 in the<a href="https://github.com/FuelLabs/sway/blob/ebc2ee6bf5d488e0ff693bfc8680707d66cd5392/sway-lib-std/src/math.sw#L114-L139"> Sway standard library</a> that it doesn’t handle the overflows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f827dfd4f1251d5eb70242c01d316be/href">https://medium.com/media/8f827dfd4f1251d5eb70242c01d316be/href</a></iframe><p>Here’s the PoC that demonstrates the overflow vulnerability for the data types u8 and u32.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6da6bcbf08c91072c6fffe88bb6bff0/href">https://medium.com/media/f6da6bcbf08c91072c6fffe88bb6bff0/href</a></iframe><p>The following test case demonstrates how the value of u8 and u32 exceeds the maximum limit of their respective types, resulting in an overflow and producing an incorrect, wrapped-around value.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/adcee311c51e44d73fd7b398b9b1da5c/href">https://medium.com/media/adcee311c51e44d73fd7b398b9b1da5c/href</a></iframe><h3>5.Exploiting CCP Instruction for Low-Cost Memory Clearing via Code Copy with Zero-Fill — Report 32465</h3><p><strong>Severity: </strong>High</p><p><strong>Impact: </strong>Modification of transaction fees outside of design parameters</p><p><strong>Asset: </strong><a href="https://github.com/FuelLabs/fuel-vm/blob/c21af9c8eafff020ddf468b51d9bcb58a0bb2295/fuel-vm/src/interpreter/blockchain.rs#L887">https://github.com/FuelLabs/fuel-vm/blob/c21af9c8eazfff020ddf468b51d9bcb58a0bb2295/fuel-vm/src/interpreter/blockchain.rs#L887</a></p><p>The CCP (Code Copy) instruction copies code from a specified contract into memory, charging gas based on the contract’s total size rather than the actual number of bytes copied.</p><p>By manipulating the offset and length parameters, users can trigger a scenario where the function zero-fills large memory areas without incurring the appropriate costs, effectively performing a cheap memory clear operation.</p><p>This exploit allows users to perform expensive memory clearing operations at a significantly reduced gas cost. By underpaying for resource usage, it can lead to network resource exhaustion and potential denial-of-service attacks, compromising the stability and security of the system.</p><p>The <a href="https://github.com/FuelLabs/fuel-vm/blob/c21af9c8eafff020ddf468b51d9bcb58a0bb2295/fuel-vm/src/interpreter/blockchain.rs#L887">code_copy</a> function invoked by the CCP instruction loads the target contract’s bytecode, charges gas based on its length, and then copies data with zero-fill using a different length parameter. Here’s how it works:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c84a3997e34ac331b5639ca9fdb24de3/href">https://medium.com/media/c84a3997e34ac331b5639ca9fdb24de3/href</a></iframe><p>The <a href="https://github.com/FuelLabs/fuel-vm/blob/c21af9c8eafff020ddf468b51d9bcb58a0bb2295/fuel-vm/src/interpreter/blockchain.rs#L921">copy_from_slice_zero_fill</a> function handles copying and zero-filling: By choosing a large offset that exceeds the length of the contract’s bytecode, the data slice becomes empty (unwrap_or_default() returns an empty slice). The copy_from_slice operation does nothing, and the entire memory range specified by len is filled with zeros:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f625ae385033891ab953b8a87394fa34/href">https://medium.com/media/f625ae385033891ab953b8a87394fa34/href</a></iframe><p>Users can clear large memory areas cheaply, bypassing the proper gas charges for memory operations.</p><p>Here’s the PoC test case demonstrates how the CCP instruction can be exploited to clear memory cheaply:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69bef9b03aa77d521a802811a2fb8afd/href">https://medium.com/media/69bef9b03aa77d521a802811a2fb8afd/href</a></iframe><p>*Changes: Report #5 was misidentified as 33519, it was corrected to 32465. The gist will also be updated shortly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80eda8920505" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/top-5-bugs-from-the-fuel-attackathon-80eda8920505">Top 5 Bugs from the Fuel Attackathon</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threshold Transaction Malleability Bugfix Review]]></title>
            <link>https://medium.com/immunefi/threshold-transaction-malleability-bugfix-review-cf0d2aa5437e?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf0d2aa5437e</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 11:09:12 GMT</pubDate>
            <atom:updated>2026-07-20T09:42:05.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B9VJkE-FU0Htoj5GuOhInA.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/threshold-transaction-malleability/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><h3>Summary</h3><p>On August 20th, 2023, one of our top 50 whitehats, Kayaba, identified a vulnerability in Threshold Network’s tBTC. This vulnerability was concerned with the inherent malleability of Bitcoin transactions, which, in combination with the Threshold Network’s SPV proof verifier, allowed arbitrary transactions to be included using feasible brute force.</p><p>In recognition of Kayaba’s discovery, he was rewarded with $50,000 worth of Threshold’s T tokens.</p><h3>What is the Threshold network?</h3><p>The Threshold Network is a collection of related decentralized services based on “threshold cryptography”, which is a type of consensus encryption/decryption protocol relying on the cooperation of multiple secret-keepers to decrypt or access a secret, similar to how <a href="https://www.investopedia.com/multi-signature-wallets-definition-5271193#:~:text=Multi%2Dsignature%2C%20or%20%22multi,technical%20requirements%20to%20set%20up.">multi-signature wallets</a> work.</p><p>The “threshold” is a minimum number of signers or network participants who are needed to sign a transaction or approve a network action. This is an oversimplification of course, but it’ll work for understanding this vulnerability.</p><p>For the full exploration of threshold cryptography, it’s highly recommended that you check out this <a href="https://toc.csail.mit.edu/node/217">article</a> by the Massachusetts Institute of Technology.</p><p>One of these services is tBTC, which provides an asset bridge from the Bitcoin blockchain to the Ethereum mainnet, allowing users to use their Bitcoin to access DeFi and other tools in the Ethereum ecosystem.</p><p>Bitcoin nodes participating in the Threshold Network use SPV, a more lightweight method that is popular with node operators as it is a less resource intensive way to verify Bitcoin transactions. However, the way that the Bitcoin Merkle root is constructed has some weaknesses, one of which allows for the inclusion of arbitrary transactions when verified by SPV clients.</p><h3>How is the Merkle tree constructed?</h3><p>Here’s a visualization of the Merkle tree:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BEu8LCOWoty-2PFf" /></figure><p>Image source: <a href="https://iq.opengenus.org/merkle-trees-and-spvs-in-bitcoin/">https://iq.opengenus.org/merkle-trees-and-spvs-in-bitcoin/</a></p><p>Suppose we have four transactions A, B, C &amp; D:</p><p>1. Initial Hashing (Leaves of the Tree)</p><ul><li>HashA = SHA256(SHA256(TxA))</li><li>HashB = SHA256(SHA256(TxB))</li><li>HashC = SHA256(SHA256(TxC))</li><li>HashD = SHA256(SHA256(TxD))</li></ul><p>2. Pairing and Hashing (Intermediate Nodes)</p><p>Pair and hash the hashes obtained in step 1:</p><ul><li>HashAB = SHA256(HashA + HashB)</li><li>HashCD = SHA256(HashC + HashD)</li></ul><p>3. Pairing and Hashing Again (Root of the Tree)</p><p>Pair and hash the intermediate hashes:</p><ul><li>MerkleRoot(HashABCD) = SHA256(HashAB + HashCD)</li></ul><p>The resulting MerkleRoot is then included in the block header.</p><p>This structure allows any participant in the network to efficiently verify the inclusion of a transaction in the block without needing to download the entire block. They can validate the authenticity of a transaction by following the path from the transaction’s hash up to the Merkle root.</p><h3>What is SPV?</h3><p>SPV, or Simplified Payment Verification, is a method used by light Bitcoin clients to verify transactions without downloading the entire blockchain. Instead of storing the entire blockchain, SPV clients only download block headers, which contain essential information like the Merkle root and block hash.</p><p>When an SPV client needs to verify a transaction, it requests relevant information from full nodes in the Bitcoin network. These nodes provide the SPV client with a Merkle proof, a cryptographic method used to confirm the inclusion of a specific transaction within a block.</p><p>The proof is crafted by collecting every node along the path connecting the Merkle root to the transaction in question, bundling them together to form the proof.</p><p>The hash path is then checked against the Merkle root included in the block header. If the hashes match, it confirms that the transaction is indeed included in the block.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZBVMAHs4GOxpM9Qc" /></figure><p>Image source: <a href="https://iq.opengenus.org/merkle-trees-and-spvs-in-bitcoin/">https://iq.opengenus.org/merkle-trees-and-spvs-in-bitcoin/</a></p><p>For example, to confirm the inclusion of transaction K in a block, a node can provide a path composed of four hashes: HL, HIJ, HMNOP, HABCDEFGH. Utilizing this path, an SPV can calculate four hashes, HKL, HIJKL, HIJKLMNOP and validate K’s presence in the block by comparing the Merkle root.</p><h3>Vulnerability Analysis:</h3><p>As mentioned above, SPV is a lightweight method of verifying transactions on the Bitcoin network using information from the block header and merkle proof.</p><p>However, since the block header does not contain the number of transactions, SPV clients are not initially aware of the total transactions within the block, and consequently, lack knowledge of the accurate tree depth.</p><p>In the merkle tree, the <em>H</em>( ) values consist of 32 bytes, while the <em>T</em> values, representing transactions or leaves of the Merkle tree, are 64 bytes long. To fit the transaction into our merkle tree which only accepts 32 byte values, we must hash the <em>T</em> value resulting in <em>H</em>(<em>T</em>). Now to get the parent node of two leaf nodes we simply concatenate them and hash them <em>H</em>( <em>H</em>(<em>T</em>) . <em>H</em>(<em>T</em>) ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9RtLwmbUJHaic7Rd" /></figure><p>The hashing of two values within the merkle tree, <em>H</em>( <em>H</em>(<em>T</em>) . <em>H</em>(<em>T</em>) ), looks very similar to the hashing of a valid transaction to be included. If we take our 64 byte transaction and split it into two sides of 32 bytes, <em>T</em>₁ and <em>T</em>₂, we see the parent of <em>T</em>, <em>H</em>(<em>T</em>), can also be described as <em>H</em>( <em>T</em>₁ . <em>T</em>₂ ).</p><p>Within this transaction, the last 32 bytes, <em>T</em>₂, are less constrained compared to the first 32 bytes, <em>T</em>₁. This is because the last 32 bytes contain multiple values which are controllable by a transaction creator. This creates the possibility that in a valid 64-byte transaction, the last 32 bytes are intentionally manipulated to collide with the hash of an invalid transaction, <em>F</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/0*0wmJqKzpBRI_128z" /></figure><p>If this happens, a node could deceive an SPV client into believing that a non-existent transaction, <em>F</em>, exists in the block by offering a path leading to <em>T</em>, then considering <em>T</em> as a node within the tree structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_COUtmVcKYTL3FL8" /></figure><p>This weakness of Bitcoin’s SPV clients is further discussed in section <a href="https://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20190225/a27d8837/attachment-0001.pdf">3.2 at this linked article</a>. The article also discusses other weaknesses of Bitcoin’s Merkle Root construction, which is a valuable read for any Blockchain/DLT bug hunters. Note that work must still be done to mine for a valid transaction T which collides with the invalid transaction by finding the correct combination of unconstrained values.</p><p>The Threshold Network was utilizing the <a href="https://github.com/keep-network/bitcoin-spv/blob/8f4c751cc1fdd3e1f0c7ad40f6e4d2024a65d19f/contracts/ValidateSPV.sol#L26-L46">ValidateSPV library</a>, where the prove function first validated the transaction’s inclusion by checking its presence in the proof on line 37. Subsequently, it called the verifyHash256Merkle function, which iteratively computed the Merkle path using the provided proof hashes. It then compared the computed root hash with the expected root hash to ascertain the proof’s validity. However, this logic was vulnerable to explained malleability, where arbitrary transaction inclusion wasn’t effectively detected.</p><p>While the Threshold team was already aware of the issue before the report, their initial mitigation strategy did not fully resolve the issue.</p><p>The primary concern lies in the inclusion of 64-byte transactions. However, within the tBTC system, transactions deemed valid are consistently longer than 64 bytes. Additionally starting in Bitcoin Core 0.16.1, 64-byte transactions will no longer be accepted to the mempool. This invalidates the attack, since we cannot convince the system the leaf node, or the real transaction, is an intermediary node in the merkle tree since it cannot be split into equal 32 byte parts. Therefore, the vulnerability stemming from the Bitcoin Merkle Tree weakness cannot be exploited within the tBTC bridge contract.</p><p>However, there is still a way where an SPV proof can be forged through the use of a coinbase transaction.</p><p>The coinbase transaction is the first transaction in a block. It is a special type of transaction that creates new bitcoins and collects the transaction fees paid by users sending transactions. Miners include a coinbase transaction in the blocks they mine. The size of a coinbase transaction can vary but is generally limited to 100 bytes.</p><p>A malicious miner could produce a valid 64-byte coinbase transaction that would be accepted by the network. They would then need to prepare a fake transaction whose 32-byte ID fulfills the constraints of the second half of the coinbase transaction.</p><p>This inclusion of a valid 64-byte coinbase transaction contradicts the project’s assumptions and was highlighted in the report by the whitehat.</p><h3>Vulnerability Fix:</h3><p>Threshold team deployed the fix at this <a href="https://github.com/keep-network/tbtc-v2/commit/cfdd0b98a029c6dc3ac72a5b6867388fff06b24b">commit</a> to also check for the coinbase transaction.</p><p>The fix had two aspects.</p><p>1. Length check of coinbase proof and merkle proof:</p><ul><li>As described above, in the Merkle tree, each level halves the number of hashes, forming parent nodes from pairs of hashes. And each transaction in a block is a leaf node. When proving a transaction’s inclusion, a series of hashes connects it to the root. The length of this proof matches the tree’s height, determined by the block’s transaction count.</li><li>The length check ensures that the Merkle proof of the coinbase transaction (the first transaction in the block) has the same length as the proof of the transaction of interest. Since all transactions in a block are on the same level of the Merkle tree, their proofs should have the same length.</li><li>So, by comparing the length on line 195, the code ensures that both transactions are on the same level of the Merkle tree and that no tampering has been done.</li></ul><p>2. Validating the coinbase proof on line 222 ultimately ensures that the provided coinbase proof is valid.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7af4b6a46fd6d559d5e1a8df80abbf5/href">https://medium.com/media/d7af4b6a46fd6d559d5e1a8df80abbf5/href</a></iframe><h3>Acknowledgments</h3><p>We extend our gratitude to our elite whitehat, Kayaba, for their exceptional contribution in responsibly disclosing a vulnerability to the Threshold network. Special acknowledgments go to the Threshold network team for addressing the insufficiencies in mitigation, and effectively resolving the reported issue.</p><p>If you’re a developer or a whitehat considering a lucrative bug-hunting career in web3 — this message is for you. With 10–100x the rewards commonly found in web2, your efforts will pay off exponentially by switching to web3.</p><p>Check out the <a href="https://github.com/immunefi-team/Web3-Security-Library?utm_source=immunefi">Web3 Security Library</a>, and start earning rewards on Immunefi — the leading bug bounty platform for web3 with the world’s biggest payouts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf0d2aa5437e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/threshold-transaction-malleability-bugfix-review-cf0d2aa5437e">Threshold Transaction Malleability Bugfix Review</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Alchemix Access Control Issue Bugfix Review]]></title>
            <link>https://medium.com/immunefi/alchemix-access-control-issue-bugfix-review-2a8fbcddf588?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a8fbcddf588</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 03:37:29 GMT</pubDate>
            <atom:updated>2026-07-20T09:51:52.880Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x4h5EE_-d7fsnTKt0wQZYA.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/alchemix-access-control-issue-bugfix-review/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><h3>Summary</h3><p>On September 23, 2023, the security researcher Koiush submitted a high vulnerability to Alchemix via Immunefi, which consisted of improper configuration of access control for harvesting of yield.</p><p>At the time of the submission, the vulnerability would have allowed an attacker to steal yield generated during harvesting in rETH, stETH, and FraxETH pools.</p><p>After receiving Koiush’s report, the bug was quickly neutralized by Alchemix’s team with no impact to user funds. Alchemix promptly awarded a bounty of 1,000 ALCX ($28,730) to Koiush for this finding.</p><p>Immunefi is pleased to have facilitated this responsible disclosure with our platform. Our goal is to make web3 safer by incentivizing hackers to responsibly disclose bugs and receive clean money and reputation in exchange.</p><h3>Introduction to Alchemix</h3><p>Let’s break it down. Alchemix Finance is primarily a synthetic asset protocol that centers around the idea of tokenizing “future yield”.</p><p>To achieve this, it has a family of synthetic assets with the prefix “al-” (alETH, alUSD) which allow users to borrow against their yield-accruing deposits in lending/borrow protocols, accessing some portion of this “future” yield upfront.</p><p>How it works is, users deposit yield-bearing variants of ETH and DAI, USDC, etc. and then borrow alETH or alUSD against their value. The al-assets can be redeemed for the underlying collateral at any time with some time delay (transmuting), or exchanged instantly at the market rate for any token of value (swap). This system of exchange forms the basis of value, and the main utility of the protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_7utW1l-UzwAuJ3W" /></figure><p>The Alchemix protocol features “Alchemists”, which are the central smart contracts powered by AlchemistV2.sol. This allows users to deposit yield-bearing or underlying assets as collateral in the protocol. Multiple yield strategies are supported in this format, but each “Alchemist” is dedicated to issuing a specific alAsset, such as alUSD.</p><p>Alchemix smart contracts allows users to borrow only up to 50% of their collateral’s value, ensuring that all borrowing across the protocol is collateralized by at least 200% in valuable yield-bearing assets. The accrued yield is periodically harvested from these assets, which is then put to work reducing the user’s debt or increasing the user’s borrowing limit if no debt is taken.</p><p>To accrue yield, the harvest() function must be periodically called on the Harvester contract. Alchemix utilized <a href="https://www.gelato.network/">Gelato</a>, a smart contract automation service, to manage calls to the harvest() function automatically, ensuring that users can passively earn yield without needing to manually interact with the protocol.</p><h4>Gelato</h4><p>Gelato is a Web3 serverless cloud platform that provides roll ups as a service and offers a suite of Web3 Services, such as Functions, Account Abstraction Infrastructure, VRF, and more. Alchemix utilized Gelato’s Web3 Functions system designed to manage and automate smart contract tasks.</p><p>The Web3 Functions <a href="https://etherscan.io/address/0x1064d40bad88574d1bd6c844d1e6bd4c84506172#code">Automate</a> contract allows projects to create tasks which are analyzed and executed automatically by Gelato’s off-chain cloud services. When a task is created, the following parameters must be specified:</p><ul><li>_execAddress, which is the target of the call</li><li>_execDataOrSelector, which is the function to be called by the automated keeper</li><li><a href="https://docs.gelato.network/web3-services/web3-functions/understanding-web3-functions/create-a-web3-function-task/using-a-smart-contract#moduledata">_moduleData</a> which are any conditions / specifications about the task</li><li>feeToken, which is the optional fee token.</li></ul><p>Calling the createTask function in the Automate contract emits the TaskCreated event, which is registered by Gelato’s off-chain services to later be executed by the Automate contract through exec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*BorMviB09s_SBrLO" /></figure><p>Optionally, task’s creators have the ability to specify the created task to be executed through a dynamically generated proxy contract by setting the proxy module to PROXY type. This allows target contracts to whitelist the generated proxy contract and limit access to the automated function through <a href="https://docs.gelato.network/web3-services/automate-legacy/guides/dedicated-msg.sender">onlyDedicatedMsgSender</a>, instead of the call originating from the generic Automate contract which allows <strong>any</strong> user to create and execute tasks to trigger functionality of a target contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*dfCj9nPwXQ0a_6oH" /></figure><h4>Alchemix Harvester</h4><p>The <a href="https://etherscan.io/address/0x7879A9c464af7805712404Cf4A8366c475034F91#code">AlchemixHarvester</a> contract enables the Alchemix contracts to collect outstanding yield from underlying assets and distribute it to token holders.​​ The harvest function in AlchemixHarvester is a proxy for the call to <a href="https://etherscan.io/address/0x062Bf725dC4cDF947aa79Ca2aaCCD4F385b13b5c/advanced#code">AlchemixV2</a> contract’s harvest function, where the majority of the logic exists. Within the harvest function, yield tokens are unwrapped for their underlying asset and sent to the <a href="https://alchemix-finance.gitbook.io/user-docs/components/transmuter">Transmuter</a>. The _unwrap function is a critical component that makes a call to the specified yield token’s TokenAdapter contract, which handles the actual unwrapping of the yield-bearing collateral token to the underlying token of a Vault.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d83f7cafad58a25126e45e56a4d3c131/href">https://medium.com/media/d83f7cafad58a25126e45e56a4d3c131/href</a></iframe><p>Due to some token adapters utilizing <a href="https://medium.com/balancer-protocol/what-is-balancer-the-complete-guide-762ee230a9d4">Balancer swaps</a> (Balancer is an exchange protocol) to unwrap yield-bearing tokens to collect on accrued yield, the harvest function can be susceptible to <a href="https://medium.com/immunefi/how-to-reproduce-a-simple-mev-attack-b38151616cb4">MEV attacks</a> (Miner or Maximal Extractable Value, also known as sandwich attacks) which manipulate the price of the asset before and after the unwrapping occurs. Normally, this isn’t an issue, since the harvest function provides a parameter to specify the `minimumAmountOut` for unwrapping.</p><p>However, since the AlchemixHarvester contract restricts access to the harvest function by only specifying the caller to be the generic Automate contract address, anyone could create a Gelato task which calls the harvest function with arbitrary parameters.</p><h3>Vulnerability Analysis</h3><p>Access control, or the lack of it, is at the heart of this vulnerability. Having proper checks is crucial for limiting access to important assets and functions, ensuring the security and continued safe operation of your smart contracts. Due to its ubiquity, it was found as #4 of the top 10 most common <a href="https://immunefi.com/immunefi-top-10/">smart contract vulnerabilities</a> identified by Immunefi in 2023.</p><p>Alchemix’s Gelato task was not created as a PROXY, meaning the Automate contract would directly call the target contract. This means the harvester contract had to whitelist the Automate contract for the harvest function execution to succeed. However, since Gelato task creation through the Automate contract is permissionless and the same contract will be used for execution unless the task is specified to use a dedicated msg.sender, anyone could create a task which would call the AlchemixHarvester contract and trigger a harvest with arbitrarily specified parameters. An attacker could create a Gelato task that targets the AlchemixHarvester and specify 1 for the minimumAmountOut, which would make the harvest call vulnerable to sandwich attacks.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19a83283a48a9a6d81db30651699e569/href">https://medium.com/media/19a83283a48a9a6d81db30651699e569/href</a></iframe><p>The attack could be further escalated by specifying a custom contract as the alchemist parameter, causing the resolver to record a harvest, but not actually harvest any yield. This would prevent the Gelato keeper from calling the harvest function, since it utilizes the checker function of the resolver to determine if the conditions for calling harvest have arrived. Blocking the harvest of yield would allow an attacker to accumulate higher unharvested amounts in the vault so the final attack can be more profitably sandwiched.</p><p><em>Editor’s note: the ability to look for ways to maximize profit such as blocking the harvest is an essential skill to learn for whitehats wanting to demonstrate the maximum impact for their vulnerability. Take note of this if you would like to improve your bug-hunting experience!</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9661ee989f11f92a16b626819173aa95/href">https://medium.com/media/9661ee989f11f92a16b626819173aa95/href</a></iframe><p>Of the six ETH-type assets that could be targeted by this attack, there were only three token adapters that had unwrap functions which were vulnerable to sandwiching. And of the three, only the rETH adapter was vulnerable to profitable sandwiching at the time of submission due its configuration best matching the requirements for the attack.</p><h3>Proof of Concept (PoC):</h3><p>The Immunefi team prepared the following PoC to demonstrate the vulnerability. You are encouraged to follow along by using Foundry to produce the results and examine them on your own.</p><p>The attack first creates a Gelato task to call the AlchemixHarvester contract with a minAmountOut of 1. The attacker would then trigger their automation for the Gelato keeper to call the harvest function, and sandwich the vulnerable swap. The attacker front runs the harvest transaction and manipulates the Balancer pool which is utilized for the unwrapping of rETH in the Alchemix adapter. The attacker can now manipulate the balancer rate back down to recover the collateral deposited for each account in the same block, and is now left with a portion of the accrued WETH.</p><p>In the following PoC, an arbitrary <a href="https://etherscan.io/tx/0xad98a7f2b1bdece002fa0acea3177439f3a00062be72126f4c3d67e06222659f">harvest</a> transaction call was utilized as a baseline for the amount of yield that would have been accrued in the transmuter and treasury during normal operation operation. The PoC then demonstrates the impact of the attack if the vulnerable harvest call was triggered and subsequently sandwiched by the attacker.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a306c83193a7714b845bd3b5618a13e3/href">https://medium.com/media/a306c83193a7714b845bd3b5618a13e3/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qrhf0HUkdyGQbPuy" /></figure><p>As we can see, after running the PoC, our test scenario resulted in a profit of 4.975 rETH for the exploiter.</p><h3>Vulnerability Fix</h3><p>Since AlchemixHarvesters are immutable, and the gelato poker address is set during contract creation, Alchemix would need to migrate Harvesters and update the contracts to utilize a dedicated msg.sender instead of the generic Automate contract address. The contracts were redeployed with an EOA set as the _gelatoPoker.</p><p>This remediated the access control issue by replacing the gelato poker address with an Alchemix-controlled EOA.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2e14a6c4a92c010e0e34f78c3623de3/href">https://medium.com/media/e2e14a6c4a92c010e0e34f78c3623de3/href</a></iframe><h4>Acknowledgements</h4><p>We would like to thank Koiush for doing an amazing job and responsibly disclosing such an important bug. Big props also to the Alchemix team who responded quickly to the report and patched the bug.</p><p>This bugfix review was written by Immunefi triager, <a href="https://twitter.com/unsafe_call">Alejandro Muñoz-McDonald</a>.</p><p>If you’d like to start bug hunting, we got you. Check out the Web3 Security Library, and start earning rewards on Immunefi — the leading bug bounty platform for web3 with the world’s biggest payouts.</p><p>If you’re feeling good about your skillset and want to see if you will find bugs in the code, check out the bug bounty program from <a href="https://immunefi.com/bounty/alchemix/">Alchemix</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a8fbcddf588" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/alchemix-access-control-issue-bugfix-review-2a8fbcddf588">Alchemix Access Control Issue Bugfix Review</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Floki Ecosystem Has Launched a $50,000 Bug Bounty Program on Immunefi]]></title>
            <link>https://medium.com/immunefi/floki-ecosystem-has-launched-a-50-000-bug-bounty-program-on-immunefi-f211288a97de?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f211288a97de</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Wed, 29 May 2024 07:47:16 GMT</pubDate>
            <atom:updated>2026-07-20T09:55:46.681Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hNoRdp-tKaileA-H24ye4A.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/customers/floki-ecosystem-has-launched-a-50-000-bug-bounty-program-on-immunefi/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>Exciting news! The Floki Ecosystem recently launched a bug bounty program on Immunefi, and they’re offering up to $50,000 for critical bugs!</p><p>The Floki Ecosystem is an innovative protocol offering a 3D NFT Metaverse, DeFi utilities, a crypto education platform, NFTs, a merchandise store, and more. The token linked to the project, FLOKI, is designed to work across multiple blockchains, including Ethereum and BNB Chain, as it meets the requirements of both ERC-20 and BEP-20 standards. FLOKI tokens are capable of being transferred between these chains, allowing FLOKI holders the flexibility to use either blockchain for managing and conducting transactions with their tokens.</p><p>And now, the Floki Ecosystem has wisely opted to leverage the security expertise of Immunefi. This comes after Web3 saw $53 million lost to hackers in the month of April, bringing total losses to more than $401 million in 2024 so far. This demonstrates that proactive measures are needed to enhance on-chain security and protect users’ funds.</p><p>Immunefi boasts the largest and highest-quality pool of security researchers in Web3, comprising over 45,000 experts who’ve prevented more than $25 billion in potential losses. Our talent is unmatched, with more than 1,000 researchers having identified bugs that could have resulted in losses of mainnet funds.</p><p>The Floki Ecosystem’s bug bounty program offers between $20,000 and $50,000 for critical threat level bugs, between $2,000 and $5,000 for high, $2,000 for medium, and $1,000 for low-impact bugs. For more information, please check <a href="https://immunefi.com/bug-bounty/floki/"><strong>Floki Ecosystem’s bug bounty page on Immunefi</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f211288a97de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/floki-ecosystem-has-launched-a-50-000-bug-bounty-program-on-immunefi-f211288a97de">Floki Ecosystem Has Launched a $50,000 Bug Bounty Program on Immunefi</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Graph Rounding Error Bugfix Review]]></title>
            <link>https://medium.com/immunefi/the-graph-rounding-error-bugfix-review-c946ff470f65?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c946ff470f65</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Wed, 15 May 2024 23:43:36 GMT</pubDate>
            <atom:updated>2026-07-20T09:56:32.464Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mRQagmOzAY2ZeCINFgidSQ.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/bug-fix-reviews/the-graph-rounding-error-bugfix-review/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>On January 7 and January 24th, 2024, whitehat <a href="https://twitter.com/Gregadeth">@GregadETH</a> submitted High and Critical vulnerabilities in the Graph ecosystem, which consisted of 2 rounding errors that had the potential to result in the loss of user funds or unclaimed yield.</p><p>The Graph quickly patched the issue, and paid out a bounty total of $290,497 to the whitehat.</p><h3>The Graph overview</h3><p><a href="https://twitter.com/graphprotocol">The Graph</a> considers itself a “decentralized indexing protocol”. What does this mean? It enables mainly developers to access and query data across different blockchains using its “subgraphs”, which are APIs. As with other decentralized protocols, it relies on the coordination of multiple parties, i.e. indexers, curators, and delegators, to provide its services, and thereby generate value.</p><p>Although blockchain data is by default, public, the process of collecting it is not as straightforward. Assuming you have the technical knowhow and the right setup to download and interpret the raw block data from a node, you’d still have to hunt the needle in the haystack of transactions, and do it efficiently.</p><p>By using The Graph, users can more easily access data from the blockchain via its GraphQL API, paying only for the specific information they need with GRT, the protocol’s native token. This token is also used by indexers (node operators of the network) to stake and index data based on specific curated subgraphs (APIs).</p><p>The part of The Graph that we will be discussing in this vulnerability analysis mainly concerns this staking functionality.</p><h3>Vulnerability Analysis</h3><p>The root cause of the vulnerability are two rounding errors, occurring in two separate assets and causing discrete impacts on each. Ensuring the precision or proper handling of floating-point arithmetic is crucial to avoiding financial discrepancies or exploitation of contract logic. Its versatility and frequency of finding makes it <a href="https://immunefi.com/immunefi-top-10/#v062023-rounding-error">#6</a> of the Top 10 common smart contract vulnerabilities identified by Immunefi in 2023.</p><h3>Locating the first issue</h3><p>When a new subgraph API is created, the “curator”, or creator of the subgraph, stakes a certain amount of GRT tokens to do so, and pays a curation tax of 1% of the staked amount to the platform. This amount is variable, as a higher amount increases the likelihood that they will be indexed and earn fees. From this part onwards, the curator will be referred to as “user”.</p><p>The first rounding issue occurred in `Curation.sol` and `L2Curation.sol`, precisely in the `mint` function. The expected behavior of this function is that a user passes an amount of tokens to mint and then pays the `curationTax` amount of tokens to the called contract.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FmzuhuCPf4dk30Cm" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47547100e3b93848a6343e981c4aff22/href">https://medium.com/media/47547100e3b93848a6343e981c4aff22/href</a></iframe><p>Here, the `curationTax` calculation implemented in the body of the `tokensToSignal` is working incorrectly when the amount of minted tokens is below 100.</p><p>Let’s take a closer look at the rounding implementation in the calculation in the `tokensToSignal` function presented below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EBnHkqBZlI2eYCQr" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d19f3d06d9b7dab812b54599f35307f6/href">https://medium.com/media/d19f3d06d9b7dab812b54599f35307f6/href</a></iframe><p>On the moment of the submission of the bug report the curation tax percentage was capped at 1% (variable equal to `uint256(10000)`), and the constant `MAX_PPM` was capped at 100% (variable equal to `uint256(1000000)`). That means that if an attacker is passing `uint256(99)` as a `tokensIn` variable, he will need to pay 990000/1000000 of the `curationTax`, which is rounded down to 0.</p><p>Normally, high gas costs on mainnet would prevent this from becoming a lucrative attack. But because this target contract is also deployed on Arbitrum, an L2 with much cheaper gas, the attacker could successfully avoid paying the `curationTax` completely by minting needed amount of tokens in batches of 99 tokens per call as presented in the PoC created by @GregadETH.</p><p>This could essentially rob the protocol of owed revenue and cause loss of user funds or yield owed to protocol participants.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/566be1a60c361cc9b225e9465a950184/href">https://medium.com/media/566be1a60c361cc9b225e9465a950184/href</a></iframe><h3>Deploying the fix</h3><p>In order to fix this vulnerability The Graph dev team presented a new way of calculating the tax, where code calculates tokens after tax first, subtracting that from the tokensIn in order to get the curation tax to avoid rounding down to zero.</p><p><a href="https://github.com/graphprotocol/contracts/commit/6a87193f809d403a835ab188bdd90beeb77d6c2b">https://github.com/graphprotocol/contracts/commit/6a87193f809d403a835ab188bdd90beeb77d6c2b</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3a4a16b0775087d0e2fd0a9b9fcb511c/href">https://medium.com/media/3a4a16b0775087d0e2fd0a9b9fcb511c/href</a></iframe><h3>Locating the second issue</h3><p>The second rounding issue @GregadETH uncovered was in another asset, `L2Staking.sol`.</p><p>When an indexer (node operator or hardware provider to the network) wants to provide services to the network in order to earn rewards and fees, they need to stake GRT tokens, which will stay locked for a period of time.</p><p>The Graph <a href="https://thegraph.com/docs/en/network/indexing/">documentation</a> states: “GRT that is staked in the protocol is subject to a thawing period and can be slashed if Indexers are malicious and serve incorrect data to applications or if they index incorrectly.”</p><p>However, this second rounding error results in a calculation error, which allows a malicious user to bypass the proper lock duration, unstaking tokens earlier than they should.</p><p>Let’s take a look.</p><p>In the `unstake` function, a call to the vulnerable `lockTokens` function was made. This function was responsible for adding unstaked tokens to a thawing (locked) pool and calculating the duration of the lock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GA7tzkMQXh5tZZ1z" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ffa2085018857e1a707be43769817fd5/href">https://medium.com/media/ffa2085018857e1a707be43769817fd5/href</a></iframe><p>The `lockTokens` function adds the unstaked tokens to an existing pool containing previously unstaked and locked tokens. This then calculates the new duration of lock to a value between the current lock duration and the maximum locked duration, which was capped at 28 days at the time of submission.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FQRqGksz8NLdcrVJ" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83db1efff7877e2deacee858d2bdb086/href">https://medium.com/media/83db1efff7877e2deacee858d2bdb086/href</a></iframe><p>If there are some tokens already unstaked and sitting in the locked pool, the calculation of a new lock time will be done like this:</p><p>newLockedUntil = ((currentLockedUntil * currentlyUnstakedTokens) + (201600 * newUnstakedTokens)) / (currentUnstakedTokens + newUnstakedTokens)</p><p>If `currentUnstakedTokens` is roughly 201600 times larger than `newUnstakedTokens`, `newLockedUntil` will evaluate to `currentLockedUntil`. Thus, the attacker can pass a small enough value to the `unstake` function to withdraw small portions of the staked tokens without any additional lock applied. After that, he could proceed with the same attack plan as in the first bug described in the article: unstake small batches of tokens to avoid adding any value to the lock period.</p><p>The process of unstaking — calling unstake() and then waiting until the tokens will be unlocked — is now broken. The described attack can be used by a malicious user to avoid the lock period for unstaked tokens, enabling an attacker to immediately withdraw them without any penalty.</p><p>The impact of this varies, from an individual indexer making unfair gains and being able to unstake tokens faster than other indexers, to the possibility of multiple indexers being able to remove their stake entirely without penalty, adversely affecting the security of the network overnight.</p><h3>Deploying the Fix</h3><p>To fix the problem in the calculation process the separate library contract, `MathUtils.sol` was changed: where the vulnerable `weightedAverage` was changed to `weightedAverageRoundingUp`to ensure that the result is always greater than the lesser of the two input values.</p><p>This <a href="https://github.com/graphprotocol/contracts/commit/25d07528b1107682674bfe0bed56523238fcacb1">commit</a> solves the problem of allowing users to unstake before they should.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y8OxHoXpnhM0y66z" /></figure><p><strong>Old Function</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d926d08b663a61ca247bc9718f8a724/href">https://medium.com/media/8d926d08b663a61ca247bc9718f8a724/href</a></iframe><p><strong>New Function:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/946ae5ae75e233c1a59b9268ac5f1845/href">https://medium.com/media/946ae5ae75e233c1a59b9268ac5f1845/href</a></iframe><h3>Closing Acknowledgements</h3><p>We would like to thank the whitehat <a href="https://twitter.com/Gregadeth">@GregadETH</a> for doing an amazing job in responsibly disclosing such an important bug. Big props also to the team at The Graph who quickly responded to the report and patched the issue.</p><p>If you’re a developer or a whitehat considering a lucrative bug-hunting career in web3 — this message is for you. With 10–100x the rewards commonly found in web2, your efforts will pay off exponentially by switching to web3.</p><p>Check out the <a href="https://github.com/immunefi-team/Web3-Security-Library?utm_source=immunefi">Web3 Security Library</a>, and start earning rewards on Immunefi — the leading bug bounty platform for web3 with the world’s biggest payouts.</p><p>To read more bugfix reviews, visit the Immunefi Blog. Or check out the <a href="https://immunefi.com/immunefi-top-10/">Immunefi Top 10 Bugs</a> page for more information on common vulnerabilities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c946ff470f65" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/the-graph-rounding-error-bugfix-review-c946ff470f65">The Graph Rounding Error Bugfix Review</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immunefi Joins Forces with Three Sigma to Redefine Blockchain Security]]></title>
            <link>https://medium.com/immunefi/blog-post-immunefi-joins-forces-with-three-sigma-to-redefine-blockchain-security-c58c521eb0ad?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c58c521eb0ad</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Wed, 01 May 2024 20:34:16 GMT</pubDate>
            <atom:updated>2026-07-20T09:58:30.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWV0bD5yeH8BfUuGuA1Zyg.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/company-announcement/immunefi-joins-forces-with-three-sigma-to-redefine-blockchain-security/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>We’re excited to unveil a new collaboration between Immunefi and Three Sigma, marking a significant milestone in fortifying the blockchain landscape!</p><p>The imperative for enhanced security measures has never been more pressing, with the crypto industry experiencing significant losses totaling $333 million to hacks in the first quarter of 2024 alone. In response to this challenge, Immunefi and Three Sigma are committed to raising the bar for security standards within the blockchain ecosystem.</p><p>Three Sigma, a distinguished blockchain engineering and research consulting firm, is a leader driving blockchain technology’s adoption and fostering the growth of the crypto/web3 space. Their comprehensive suite of services, including code audits, economic modeling, and blockchain engineering, has consistently delivered value to clients seeking to navigate the complexities of decentralized ecosystems.</p><p>The services offered by Three Sigma are a perfect complement to Immunefi’s mission of safeguarding blockchain projects by harnessing the collective expertise of the largest and most proficient community of elite security researchers in the industry. With over 45,000 security researchers, including over 1,000 who have successfully identified critical vulnerabilities, Immunefi has successfully prevented a staggering $25 billion in potential crypto theft and fraud.</p><p>By synergizing Immunefi’s unrivaled security expertise with Three Sigma’s blockchain engineering prowess, we are empowering our shared customers with exclusive offerings designed to mitigate security risks and fortify their blockchain ecosystems.</p><p>“This partnership represents a significant step forward in our mission to advance the adoption of blockchain technology while ensuring the utmost security for our clients,” remarked Sajjad Rehman, VP of Revenue at Immunefi. “We are well-positioned to redefine industry standards and create a safer, more resilient Web3.”</p><p>In an era defined by rapid innovation and transformative change, the partnership between Immunefi and Three Sigma stands as a beacon of collaboration, innovation, and unwavering commitment to security excellence!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c58c521eb0ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/blog-post-immunefi-joins-forces-with-three-sigma-to-redefine-blockchain-security-c58c521eb0ad">Immunefi Joins Forces with Three Sigma to Redefine Blockchain Security</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenZeppelin Partnership Announcement]]></title>
            <link>https://medium.com/immunefi/openzeppelin-partnership-announcement-4b18fc7225fc?source=rss-583086651f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b18fc7225fc</guid>
            <dc:creator><![CDATA[Immunefi Editor]]></dc:creator>
            <pubDate>Wed, 03 Apr 2024 20:30:45 GMT</pubDate>
            <atom:updated>2026-07-20T09:59:33.335Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10teUa8MRcQBrGIzo6ztRQ.png" /></figure><h3>⚠️ THIS ARTICLE HAS MOVED</h3><p><strong>This Medium version is archived and is no longer being updated.</strong></p><p><a href="https://immunefi.com/blog/company-announcement/openzeppelin-partnership-announcement/"><strong>Read the current and maintained version on the Immunefi Blog.</strong></a></p><p>We’re thrilled to announce a groundbreaking partnership between Immunefi and OpenZeppelin!</p><p>OpenZeppelin, an industry leader in securing blockchain ecosystems, has been at the forefront of innovation since its inception in 2015. Renowned for its bedrock open-source Contract Libraries, OpenZeppelin helped to set the standard for smart contract development by ensuring robust security measures are in place. With a comprehensive suite of professional services and the cutting-edge Defender developer security platform, OpenZeppelin seamlessly integrates security throughout the development lifecycle.</p><p>By joining forces, OpenZeppelin and Immunefi are empowering our shared customers with unparalleled protection against security threats. Sajjad Rehman, Immunefi’s VP of Revenue, aptly captures the essence of this partnership, stating, “OpenZeppelin’s commitment to security excellence aligns perfectly with Immunefi’s mission to fortify the Web3 landscape.”</p><p>Recent data underscores the critical need for enhanced security measures that this partnership will foster. In the first quarter of 2024 alone, the cryptocurrency ecosystem experienced staggering losses totaling $336.3 million due to theft and fraud. These figures serve as a stark reminder of the persistent threat posed by malicious actors seeking to exploit vulnerabilities within blockchain networks.</p><p>In response to this challenge, Immunefi leverages the most skilled and prolific security researchers in the industry. In total, we have successfully prevented the loss of an astounding $25 billion in potential crypto theft and fraud — a testament to our unwavering commitment to safeguarding the assets of our clients.</p><p>The synergy between Immunefi and OpenZeppelin heralds a new era of security excellence. By combining OpenZeppelin’s expertise in securing blockchain ecosystems with Immunefi’s unparalleled track record in vulnerability mitigation, we are uniquely positioned to offer our shared customers unparalleled protection and exclusive offerings.</p><p>Together, Immunefi and OpenZeppelin are creating a more secure and resilient Web3 — one bug at a time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b18fc7225fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/immunefi/openzeppelin-partnership-announcement-4b18fc7225fc">OpenZeppelin Partnership Announcement</a> was originally published in <a href="https://medium.com/immunefi">Immunefi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>