Reproduced Exploit

Etherspot — a gas-tank user withdraws the balance that should repay sponsored gas

The paymaster checks that a user will pay, executes the sponsored operation, and only then asks an admin to call repaySponsoredTransaction. _postOp adds to sponsored and does not escrow tokens. gasTankWithdraw transfers balances[user] with no look at that debt.

Sep 2025•Other•logic•3 min read

Chain

Other

Category

logic

Date

Sep 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 62850-h-03-users-can-escape-paying-for-the-tx-gas-shieldify-none-e. Standalone Foundry PoC and full write-up: 62850-h-03-users-can-escape-paying-for-the-tx-gas-shieldify-none-e_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/missing-check · vuln/logic/fee-calculation

Reproduction: a self-contained Foundry PoC that compiles and runs offline with only forge-std — no fork and no RPC. Trace: output.txt. PoC: test/62850-h-03-users-can-escape-paying-for-the-tx-gas-shieldify-none-e_exp.sol.


Key info#

ImpactHIGH — the user pulls back 1,000 GAS after a 1,000 GAS sponsorship; the fee receiver is paid 0
ProtocolEtherspot GasTankPaymaster.gasTankWithdraw
Vulnerable codetoken.transfer of the full balance with no read of the unpaid sponsorship
Bug classSponsored gas is recorded after the fact and can be withdrawn first
FindingShieldify H-03 — Etherspot GasTank paymaster · id 62850
ReportShieldify review
SourceAuditVault finding
Compilersolc 0.8.27, cancun, via IR

TL;DR#

The paymaster checks that a user will pay, executes the sponsored operation, and only then asks an admin to call repaySponsoredTransaction. _postOp adds to sponsored and does not escrow tokens. gasTankWithdraw transfers balances[user] with no look at that debt.

The user has 1,000 GAS on deposit. A sponsorship of 1,000 GAS is recorded. The user withdraws 1,000. The owner's repay reverts with insufficient balance. The fee receiver stays at 0, and sponsored is still 1,000.

The fixed tank sets isWithdrawPaused in postOp. The withdraw reverts, and the repay credits the fee receiver with 1,000.

The vulnerable code#

SOLIDITY
function gasTankWithdraw(uint256 amount) external {
    uint256 currentBalance = balances[msg.sender];
    if (currentBalance < amount) revert("GasTankPaymaster_InsufficientBalance");
    token.transfer(msg.sender, amount); // @> VULN: unpaid sponsored gas is ignored
    balances[msg.sender] = currentBalance - amount;
}
DIFF
 function gasTankWithdraw(uint256 amount) external {
+    require(!isWithdrawPaused[msg.sender], "withdraw paused");
     uint256 currentBalance = balances[msg.sender];

postOp sets the pause. repaySponsoredTransaction clears it once sponsored is zero.

Attack walkthrough#

  1. The tank already holds the user's 1,000 GAS deposit. The user's wallet is empty.
  2. postOp records a 1,000 GAS sponsorship. The token balance is not reduced.
  3. gasTankWithdraw(1000) transfers the tokens back. There is no pause and no debt check.
  4. repaySponsoredTransaction reverts. The fee receiver's internal balance stays 0. The debt is still 1,000.

Diagrams#

flowchart TD A["User has 1000 GAS deposited"] --> B["postOp records a 1000 sponsorship and escrows nothing"] B --> C["User calls gasTankWithdraw for 1000"] C --> D["Tokens return to the user"] D --> E["Owner repay reverts and the fee receiver gets 0"]

Impact#

The paymaster has already paid for the user operation. The user leaves with the entire deposit, so the fee receiver cannot be repaid. In this run the sponsored fee equals the deposit, so the escaped amount is 1,000 GAS.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.