$ cat writeup.md…
$ cat writeup.md…
sekai2026
Task: a Solidity ATM tracks donated PP as withdrawable ETH and is pre-funded with 10 ether. Solution: exploit withdrawPP reentrancy because it sends ETH before zeroing the caller score, draining the contract to zero.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
I found a new way to PP farm, surely nothing could go wrong!
English summary: the artifact contained a small Solidity contract, PerformancePointATM, deployed with 10 ether. The goal was to make isSolved() return true, which required draining the contract balance to zero.
The important functions were short:
function withdrawPP() public { uint256 score = scores[msg.sender]; require(score > 0, "Nothing to withdraw"); (bool result, ) = msg.sender.call{value: score}(""); require(result, "Transfer failed"); scores[msg.sender] = 0; } function isSolved() view public returns (bool) { return address(this).balance == 0; }
donatePP(address _to) credits scores[_to] with msg.value. The deploy script created the ATM with 10 ether, so the contract had a large balance before any player action.
The bug is a classic checks-effects-interactions violation. withdrawPP() performs an external call to msg.sender before setting scores[msg.sender] = 0. If msg.sender is a contract, its receive() function can call withdrawPP() again while the same nonzero score is still recorded. Repeating this withdraws the same score multiple times until the ATM is empty.
PerformancePointATM.attack() with a nonzero ETH value, e.g. 1 ether.attack(), donate that value to the attacker contract itself with donatePP(address(this)).withdrawPP() once.receive(), re-enter withdrawPP() while the ATM still has at least one withdrawal chunk left.isSolved() returns true and the ATM balance is 0 wei.Full exploit contract:
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; interface IPerformancePointATM { function donatePP(address _to) external payable; function withdrawPP() external; function isSolved() external view returns (bool); } contract AttackPPFarming { IPerformancePointATM public immutable atm; uint256 public chunk; ...
$ grep --similar