<?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 Lindsey on Medium]]></title>
        <description><![CDATA[Stories by Lindsey on Medium]]></description>
        <link>https://medium.com/@lindseywinder?source=rss-325d70ef13a0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ojJQon0Q_cCoSzfkVcbF_w.jpeg</url>
            <title>Stories by Lindsey on Medium</title>
            <link>https://medium.com/@lindseywinder?source=rss-325d70ef13a0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:25:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lindseywinder/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[Hedgey Exploit Post-Mortem]]></title>
            <link>https://medium.com/hedgey/hedgey-exploit-post-mortem-784e9860fd8d?source=rss-325d70ef13a0------2</link>
            <guid isPermaLink="false">https://medium.com/p/784e9860fd8d</guid>
            <dc:creator><![CDATA[Lindsey]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 16:53:49 GMT</pubDate>
            <atom:updated>2024-04-29T18:50:03.559Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TDLR:</strong></p><p>On Apr 19, 2024 07:06:47 AM UTC, a malicious transaction exploited the Hedgey Finance smart contract, ClaimCampaigns.sol.</p><p>The first exploit is related to this transaction: <a href="https://etherscan.io/tx/0x2606d459a50ca4920722a111745c2eeced1d8a01ff25ee762e22d5d4b1595739">https://etherscan.io/tx/0x2606d459a50ca4920722a111745c2eeced1d8a01ff25ee762e22d5d4b1595739</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*L72gBX9sIe1ptM8tkf1VmA.png" /></figure><p>The attacker exploited the contract on Ethereum Mainnet to remove 1.3m USDC, followed by subsequent attacks on token balances on the contract to remove and swap for 654 ETH.</p><p>An additional hacker performed the same exploit on the Hedgey contract deployed to Arbitrum network, removing ~ $40mm of notional value from one project. <a href="https://arbiscan.io/tx/0x688aaa6f16a6f7bbfd3e0c86c9b79f388967ce849343fc280c47dc792bde0624">https://arbiscan.io/tx/0x688aaa6f16a6f7bbfd3e0c86c9b79f388967ce849343fc280c47dc792bde0624</a></p><p><em>(The project impacted by the removal of $40m TVL acted promptly and was able to successfully freeze deposits to Gate.io and Bybit including a deposit by the hacker to their ByBit account. The project removed Dex liquidity, resulting in no loss of liquidity due to the incident. The team has created a new token contract and is reissuing to all holders.)</em></p><p>An <a href="https://twitter.com/hedgeyfinance/status/1781257581488418862">alert</a> was sent out by Hedgey Finance, a <a href="https://securityalliance.org/">SEAL 911</a> group was created to begin incident response and tracking the exploiters, and the Hedgey team reached out to vulnerable projects using the Token Claims product to cancel claim campaigns. Out of the 60 different active claim campaigns, 23 impacted resulted in the loss of funds and tokens.</p><p>Other exploits occurred on Fantom Chain ($170k), Polygon ($800), Binance Smart Chain ($4,600) and Shimmer Network ($500). In total, approximately $45mm of notional value was taken during the exploits on April 19th.</p><p>Later that day, a message was sent to the original exploiter to attempt to recover funds and begin negotiations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xi-dX9M7-gUTgew6" /></figure><p>The exploit was limited to ClaimCampaigns contract and did not impact active token vesting or lockup contracts.</p><p><strong>Exploit Details</strong></p><p>The exploited contract was ClaimCampaigns.sol. This contract was used for the community token claims product and designed to distribute tokens en masse to users, via a Merkle tree solution, giving authorized users the ability to claim tokens from the contract. The impacted contract was fully audited by Consensys Diligence and has been used by over 100 projects for token distributions.</p><p>The <a href="https://etherscan.io/address/0xbc452fdc8f851d7c5b72e1fe74dfb63bb793d511">contract </a>exploit was made possible because the contract allows for projects to create token claims that have vesting schedules when claimed. To do this, the project would create a “locked claim campaign” that would hold the vesting or lockup details onchain in a storage struct. When used for this purpose, claimers would claim tokens which would be transferred to the Hedgey Vesting or Hedgey Lockup contract. Because the tokens needed to be transferred from the Claims Contract to a Hedgey Vesting contract, when a new Locked ClaimCampaign was created, the contract would approve the spend / increase the allowance of the total amount of tokens in the claim campaign, allowing the Hedgey Vesting or Hedgey Lockup contract to pull the tokens. This opened up the possibility for the hacker to input a malicious contract address as the Vesting contract address, instead of the Hedgey Vesting contract address — thus increasing the allowance spend for the malicious contract. The the malicious contract would be able to pull tokens directly out of the smart contract without triggering the claim function or cancel function. When a ClaimCampaign would be canceled, it would not decrease the allowance, improperly giving the result that an exploiter can increase the allowance by creating a new Locked ClaimCampaign, and then immediately canceling it, whereby that allowance was still in place.</p><p>The first exploit was executed with a flashswap. This allowed the hacker to flash borrow tokens from a DEX and create a Locked Claim Campaign, then immediately Cancel the Campaign and payback the DEX.</p><p>First flash transaction:</p><p><a href="https://etherscan.io/tx/0xa17fdb804728f226fcd10e78eae5247abd984e0f03301312315b89cae25aa517">https://etherscan.io/tx/0xa17fdb804728f226fcd10e78eae5247abd984e0f03301312315b89cae25aa517</a></p><p><strong>Smart Contract Technical Details of the Exploit</strong></p><p>The exploit happened by the hacker entering an malicious contract address in the Claimlockup struct;</p><pre>struct ClaimLockup {<br>address tokenLocker; // this was the address of the malicious contract address 0xC793113F1548B97E37c409f39244EE44241bF2b3<br>uint256 start;<br>uint256 cliff;<br>uint256 period;<br>uint256 periods;<br>}</pre><p>In the function to create a locked campaign, the malicious contract address in the struct increased the allowance of the malicious contract</p><pre>function createLockedCampaign(<br>bytes16 id,<br>Campaign memory campaign,<br>ClaimLockup memory claimLockup,<br>Donation memory donation<br>) external nonReentrant {<br>require(!usedIds[id], &#39;in use&#39;);<br>usedIds[id] = true;<br>require(campaign.token != address(0), &#39;0_address&#39;);<br>require(campaign.manager != address(0), &#39;0_manager&#39;);<br>require(campaign.amount &gt; 0, &#39;0_amount&#39;);<br>require(campaign.end &gt; block.timestamp, &#39;end error&#39;);<br>require(campaign.tokenLockup != TokenLockup.Unlocked, &#39;!locked&#39;);<br>require(claimLockup.tokenLocker != address(0), &#39;invalid locker&#39;); // this did not check that only a hedgey vesting contract could be input ito this param<br>TransferHelper.transferTokens(campaign.token, msg.sender, address(this), campaign.amount) …<br>claimLockups[id] = claimLockup;<br>SafeERC20.safeIncreaseAllowance(IERC20(campaign.token), claimLockup.tokenLocker, campaign.amount); // this increased the spend allowance for the entire campaign amount<br>campaigns[id] = campaign;<br>emit ClaimLockupCreated(id, claimLockup);<br>emit CampaignStarted(id, campaign);<br>}<br>function cancelCampaign(bytes16 campaignId) external nonReentrant {<br>Campaign memory campaign = campaigns[campaignId];<br>require(campaign.manager == msg.sender, &#39;!manager&#39;);<br>delete campaigns[campaignId];<br>delete claimLockups[campaignId];<br>TransferHelper.withdrawTokens(campaign.token, msg.sender, campaign.amount);<br>emit CampaignCancelled(campaignId);<br>}</pre><p>The exploiter would cancel the campaign with the above function, which did not check or decrease the ERC20 spend allowance, the spend allowance remained the same as what it was when initiating the campaign.</p><p><strong>Going Forward</strong></p><p>Because of this exploit we have removed the ability to create additional claims. We are engaging with multiple auditors to add 4 new audits to the Hedgey code base this month, as well as engaging with security experts to increase security of our contracts beyond audits. Additionally, we will be publishing new whitehat bounties and working with the community to build safe and secure systems for our users.</p><p>We continue to track the actors involved in this incident and are working with law enforcement as we pursue the exploiters and make efforts to recover funds. We have made significant progress in tracking the involved actors and will share updates as they come in. Our primary focus is on catching the people involved, recovering stolen funds, and working with impacted users.</p><p><strong>Acknowledgements</strong></p><p>We are thankful to the SEAL 911 team and the dozens of people directly and indirectly invovled with this crew. They have been world class in supporting us from day zero. We are thankful to the friends and colleagues that reached out to assist us and our users at this time, as well as the current and upcoming Hedgey users for their continued support.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=784e9860fd8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hedgey/hedgey-exploit-post-mortem-784e9860fd8d">Hedgey Exploit Post-Mortem</a> was originally published in <a href="https://medium.com/hedgey">Hedgey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>