s0sta (@s0sta_) header
s0sta (@s0sta_) profile picture

IT Manager — Linux · Netzwerke · 600 User Web3-Sicherheit: Smart-Contract-Audits · DeFi-Exploits EU Blue Card eligible https://teapawt.net/t.co/THyNtBCwD4

Joined December 2024
Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)Photo by s0sta (@s0sta_)
PLTD — fee-on-transfer + skim manipulation 2022-10 · BSC THE INCIDENT Flashloan 660k USDT across two DODO pools, buy PLTD, donate 2× the pair's PLTD back to the pair, `skim(attacker)` to extract the excess the fee logic credited, send 1 PLTD to `tx.origin`, then sell PLTD at the skewed price and repay. THE LESSON Donation + skim on fee-on-transfer tokens inflates extractable balances — audit token fee paths that credit the pair. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
8
PLTD — fee-on-transfer + skim manipulation 2022-10 · BSC THE INCIDENT Flashloan 660k USDT across two DODO pools, buy PLTD, donate 2× the pair's PLTD back to the pair, `skim(attacker)` to extract the excess the fee logic credited, send 1 PLTD to `tx.origin`, then sell PLTD at the skewed price and repay. THE LESSON Donation + skim on fee-on-transfer tokens inflates extractable balances — audit token fee paths that credit the pair. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
7
DEXRouter — access-control (arbitrary call with contract funds) 2023-09 · BSC THE INCIDENT The victim's functionCallWithValue(target, data, value) was permissionless, so the attacker pointed it at his own contract with value equal to the router's whole BNB balance — the router forwarded its entire balance to the attacker's payable function. A companion update() also let him set the callback target to his own address. THE LESSON Arbitrary call/value-forwarding helpers must be owner-only; letting anyone choose target and value against protocol funds is an instant drain. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #AccessControl #SmartContract #DeFi #Security
47
DAppSocial — access-control (withdrawal without balance check) 2023-09 · Ethereum THE INCIDENT After depositing 2M USDT/USDC, the attacker's helper locks tokens to an "alt account" with length 0, the attacker pulls 1M out via withdrawTokensWithAlt referencing the helper, and the helper then calls withdrawTokens(token, balanceOf(entire contract)) — the withdrawal path never validated the caller's own locked balance and paid out the contract's full holdings. THE LESSON Withdraw functions must settle against the caller's tracked balance, and alt-account paths must verify ownership — caller-supplied amounts are never a substitute for state. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #AccessControl #SmartContract #DeFi #Security
23
CEXISWAP — access-control (uninitialized proxy) 2023-09 · Ethereum THE INCIDENT CEXISWAP's initialize() was never locked after deployment, so the attacker called it to make his own contract the admin and treasury. He then called upgradeToAndCall() to upgrade the proxy to an implementation whose function delegatecalls in proxy context and transfers the proxy's entire USDT balance to him. THE LESSON Proxies must be initialized atomically with deployment or lock the initializer — a forgotten public initializer hands over admin and upgrade rights. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #AccessControl #SmartContract #DeFi #Security
1
10
BFC — price-manipulation (transfer-credits-pair + skim) 2023-09 · BSC THE INCIDENT With 400K BUSDT flash-swapped from the BUSDT/WBNB pair, the attacker buys BFC and loops up to 100 times: transfer BFC into the pair (whose balance the token credits on transfer), skim the surplus, then a zero transfer to re-trigger the credit. After inflating reserves he sells BFC back for more BUSDT than borrowed. THE LESSON The transfer-to-pair-then-skim loop keeps recurring on BSC — before trusting a pair's reserves, check whether the token credits recipients on transfer. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
16
APIG — logic-error (self-transfer reflection doubling) 2023-09 · BSC THE INCIDENT APIG's transfer() credited the recipient a reflection reward computed off the sender's balance, so transferring your entire balance to yourself minted you an equal amount — doubling each iteration. The attacker looped self-transfers until his balance exceeded the threshold, then dumped the exponentially grown APIG into the APIG/BUSD and APIG/BETH pairs, repaying the flash swap with profit. THE LESSON Reflection logic must exclude self-transfers (or the sender's own balance) from the reward base — self-transfer doubling is a classic mint-until-huge bug. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #LogicFlaw #SmartContract #DeFi #Security
13
0x0 DEX (privacy pool) — logic-error (forged ring signature) 2023-09 · Ethereum THE INCIDENT The privacy pool's hand-rolled ring-signature check accepted a forged withdrawal signature (public key set to the curve's generator with matching s values), letting the attacker withdraw arbitrary deposits. He first force-sent ETH so the pool balance became a multiple of 10 (the denomination the math rounds on), deposited 10 ETH and withdrew in Swap mode, then looped small 0.1 ETH deposits with further withdrawals until the pool's ETH was drained. THE LESSON Hand-rolled ZK/ring-signature verification is a minefield — verify the math against a reference implementation and fuzz denomination rounding and key-image reuse. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #SignatureValidation #DeFi #SmartContract #Security
7
Zunami (UZD) — oracle-manipulation (donation + spot reward pricing) 2023-08 · Ethereum THE INCIDENT UZD's balanceOf values its staker's pending SDT rewards through a Sushi getAmountsOut spot quote, so the attacker donates SDT to MIMCurveStakeDao, pumps the SDT price by swapping 10,000 WETH into it, and calls cacheAssetPrice() to rebase — inflating his own UZD balance. He then swaps UZD back into crvFRAX/crvUSD, removes liquidity, and exits through the USDC pools, funded by Uni V3 and Balancer flash loans. THE LESSON Rebasing tokens that price staked rewards via spot router quotes are one-transaction donation+pump targets — use TWAPs and exclude donations from reward valuation. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #OracleManipulation #DeFi #SmartContract #Security
18
Uwerx — price-manipulation (skim + fee-on-transfer) 2023-08 · Ethereum THE INCIDENT After buying WERX with 20,000 WETH, the attacker transfers ~4.4M WERX into the pair (whose fee mechanics credit the pair on transfer), skims the surplus to 0x01 (burn), and syncs — shrinking the pair's WERX side and inflating its price. He then sells his WERX back at the boosted price, repaying the mocked flash loan with ~176 ETH profit. THE LESSON Fee-on-transfer tokens that credit pairs on transfer make skim/sync a reserve-shrinking price pump — treat such pairs as attacker-controllable. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #TokenMechanics #DeFi #SmartContract #Security
6
SVT — logic-error (stale buy price) 2023-08 · BSC THE INCIDENT The SVT pool's buy() did not reprice between consecutive purchases, so the attacker's second buy() got the same low price as the first. Selling the second batch and 62% of the rest back at the current higher price repaid the DODO flash loan with profit, leaving the attacker 38% of the SVT for free. THE LESSON Buy/sell contracts must update their price state after every fill — stale pricing between calls is free arbitrage. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
15
Neutra Finance — price-manipulation (convert rate from live reserves) 2023-08 · Arbitrum THE INCIDENT With a 1,000 WETH Balancer flash loan, the attacker buys NEU and adds liquidity to the NEU/WETH Camelot pair, then swaps 849 WETH for NEU to skew the pair's reserves. Calling convert() prices his NEU LP against the manipulated reserve ratio and hands him NEU1 LP; burning that LP and selling NEU1 for WETH nets more than the flash loan. THE LESSON Conversion functions that price tokens from live pool reserves in the same transaction are manipulable — anchor conversion rates to a TWAP or external oracle. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
6
LeetSwap — access-control (public fee-transfer function) 2023-08 · Base THE INCIDENT LeetSwap's pair exposed _transferFeesSupportingTaxTokens(), which moves the pair's own axlUSDC to the fee recipient and was callable by anyone. After buying axlUSDC with 0.001 ETH, the attacker called it with the pair's nearly entire axlUSDC balance, then sync()ed the pair and sold his axlUSDC back at the drastically inflated WETH price. THE LESSON Underscore-prefixed helper names do not make functions private — audit visibility modifiers on every function that moves protocol funds. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #AccessControl #SmartContract #DeFi #Security
9
GSS — price-manipulation (skim + reward pool) 2023-08 · BSC THE INCIDENT With 30K USDT from DODO, the attacker buys GSS, transfers a huge amount into the GSS/USDT pair (the token credits the pair on transfer), skims the pair's excess into the GSS/GSSDAO pool, syncs the pair, and then skims the GSSDAO pool's own excess to himself. He finally sells his remaining GSS at the inflated price for more USDT than the flash loan. THE LESSON When a token's transfer mechanics credit recipients, skim() between a pair and a reward pool lets an attacker double-harvest and inflate reserves. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #TokenMechanics #DeFi #SmartContract #Security
13
Exactly Protocol — insufficient-validation (permit spoofing) + price-manipulation 2023-08 · Optimism THE INCIDENT DebtManager.leverage() accepted a caller-supplied Permit struct and set its global _msgSender to the permit's account without verifying the permit originated from that account, letting the attacker impersonate 8 victims through 16 attacker-deployed fake markets and invoke crossDeleverage to drain their USDC into fake tokens. The attacker then deposited into exaUSDC and borrowed/ repaid at six maturities to burn the pool's accrued earnings (backupEarnings), lowering the share price until each victim's collateral fell below their debt, after which he liquidated all 8 positions. THE LESSON Periphery contracts that set a "global msg.sender" from a permit must cryptographically verify it, and liquidation thresholds must not depend on share prices that borrow/repay cycles can deflate. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #SignatureValidation #DeFi #SmartContract #Security
4
Earning Farm (ENF_ETHLEV) — reentrancy (transfer before burn) 2023-08 · Ethereum THE INCIDENT The vault's withdraw() sends ETH (via the Controller) before burning the corresponding shares; during that ETH transfer the attacker's receive() moves his shares to a helper contract, so the burn destroys only the dust left behind while the helper still holds shares for the withdrawn assets. The helper then withdraws those assets too, and the loop repeats against Uni V3 flash-loaned WETH until the vault is nearly drained. THE LESSON In vault withdraw flows, burn shares before any external value transfer, or a callback can smuggle the shares away and double-withdraw. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #Reentrancy #SmartContract #DeFi #Security
2
33
EHIVE — logic-error (update-before-reward ordering) 2023-08 · Ethereum THE INCIDENT EHIVE's stake() added stakeAmount to 'staked' BEFORE computing 'earned', so a staker with a 0-value position could wait, then stake any amount and be credited rewards for the whole elapsed period as if the new stake had been earning all along. The attacker opened 28 fresh staker contracts with stake(0), waited 38 days, then chained stake→unstake through all of them to multiply the retroactive rewards and dumped the EHIVE for WETH (Aave flash loan). THE LESSON Always accrue rewards against the pre-update staked amount — updating state before calculating earned turns time into a free mint. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #LogicFlaw #SmartContract #DeFi #Security
11
Curve Finance (CurveBurner sandwich) — MEV (sandwich, no slippage protection) 2023-08 · Ethereum THE INCIDENT CurveBurner.execute() is a permissionless function that adds only-USDT liquidity to 3pool and swaps USDT for DAI/USDC with no slippage protection. The attacker front-runs it with remove_liquidity_imbalance to strip DAI/USDC, lets execute() swap USDT into the skewed pool, then back-runs by adding DAI/USDC and removing USDT, profiting from the imbalance (funded by Balancer/Aave/Compound borrows). THE LESSON Keeper-style swap functions without minimum-return parameters are free sandwich targets — require slippage bounds even for internal maintenance flows. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #AccessControl #SmartContract #DeFi #Security
1
23
Balancer (boosted pools) — rounding (precision loss) 2023-08 · Ethereum THE INCIDENT With a 300K USDC Aave flash loan, the attacker drains all aUSDC from the bb-a-USDC pool, then in one batchSwap borrows almost the entire bb-a-USDC virtual supply and swaps a dust amount back out — the dust swap computes zero USDC output due to precision loss but inflates the bb-a-USDC share price. Using the inflated rate he swaps bb-a-USDC for bb-a-DAI and bb-a-USDT in the bb-a-USD pool, then resets the rate to 1 and repays the batch-swap borrow. THE LESSON Rate = assets/virtualSupply math can be inflated by sub-unit swaps when virtual supply is nearly zero — rounding must always favor the protocol. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
29
BTC20 — logic-error (presale accounting) + flashloan 2023-08 · Ethereum THE INCIDENT Funded by a 300 ETH Balancer flash loan and flash-borrows from the SDEX/BTC20 and BTC20/WETH Uni V3 pools, the attacker buys BTC20 and then calls PresaleV4.buyWithEthDynamic() for maxTokensToSell() - directTotalTokensSold() — the presale's remaining-allocation counter did not track all previously sold tokens, so the attacker bought the leftover allocation with the borrowed ETH at a stale price. He then dumps the BTC20 for WETH and repays the loans. THE LESSON A presale's "remaining tokens" must be computed from one consistent sold-token counter, or the delta can be bought out cheaply in a single transaction. Full analysis: s0sta.com/DeFi-Hacks-Reprodu… #FlashLoan #DeFi #SmartContract #Security
33