Reproduced Exploit
Ludex Labs: one address registers every free username
registerPlayer keys a username only by the string. It never records that msg.sender already registered, and it stores isOldEnough without checking it. One address registers alice, bob, and charlie. The third call passes isOldEnough = false. A second user who then calls registerPlayer("alice") rever…
Loss
alice, bob, and charlie are owned by one address. The legitimate user cannot register alice
Chain
Ethereum
Category
logic
Date
Feb 2025
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
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.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 52922-unrestricted-username-registration-and-sybil-attack-risk-can. Standalone Foundry PoC and full write-up: 52922-unrestricted-username-registration-and-sybil-attack-risk-can_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/missing-validation·vuln/input-validation/missing
Key info#
| Field | Value |
|---|---|
| Loss | alice, bob, and charlie are owned by one address. The legitimate user cannot register alice |
| Vulnerable contract | Riskiit.registerPlayer |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2025-02 |
| Compiler | solc 0.8.27, cancun, via IR |
TL;DR#
registerPlayer keys a username only by the string. It never records that msg.sender already registered, and it stores isOldEnough without checking it. One address registers alice, bob, and charlie. The third call passes isOldEnough = false. A second user who then calls registerPlayer("alice") reverts with taken.
The vulnerable code#
require(ownerOf[username] == address(0), "taken");
lastAgeFlag = isOldEnough;
ownerOf[username] = msg.sender; // @> VULN: no per-sender cap; one address registers every free name
registrationCount[msg.sender] += 1;
The Cantina fix requires one registration per sender and a 65-byte age signature. The control contract reverts the second name from the same sender with one name.
Root cause#
Uniqueness is the username, not the account. The age boolean is an input, not a signature check. The function is public, so the sniping does not need a privileged role.
Preconditions#
- The names alice, bob, and charlie are unregistered.
- No backend signature is required. That is the deployed behavior the report describes, before PR 49.
Attack walkthrough#
- The attacker calls
registerPlayer("alice", true, ""). - The name check passes.
isOldEnoughis stored and ignored. ownerOf["alice"]becomes the attacker.- The same address registers bob, then charlie with
isOldEnoughfalse. - The victim's
registerPlayer("alice")reverts. registrationCountfor the attacker is 3.
Diagrams#
Impact#
A permissionless caller occupies every name they care about, including a call that claims to be under age. The user who should own alice cannot register it. Referral or KYC assumptions that treat one address as one player do not hold.
Remediation#
Reject a second registration from the same msg.sender, and require a backend age signature instead of a caller-supplied bool. That is what the control enforces.
How to reproduce#
cd 52922-unrestricted-username-registration-and-sybil-attack-risk-can_exp
forge test -vv
test_exploit_one_address_snipes_three_names asserts three names on one address and a blocked victim. test_control_one_name_per_sender_and_age_sig asserts the second name from the same sender reverts.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/52922-unrestricted-username-registration-and-sybil-attack-risk-can.md
- Cantina report: https://cdn.cantina.xyz/reports/cantina_riskiit_february2025.pdf
- The finding quotes the PoC. No separate commit was published in the report. The reduction keeps
registerPlayer(string,bool,bytes)as quoted.
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 52922-unrestricted-username-registration-and-sybil-attack-risk-can_exp (evm-hack-registry mirror).
- AuditVault finding: 52922-unrestricted-username-registration-and-sybil-attack-risk-can.
Alerts & third-party analyses
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.