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…

Feb 2025•Ethereum•logic•3 min read

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

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: 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-registry mirror.


Vulnerability classes: vuln/logic/missing-validation · vuln/input-validation/missing

Key info#

FieldValue
Lossalice, bob, and charlie are owned by one address. The legitimate user cannot register alice
Vulnerable contractRiskiit.registerPlayer
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-02
Compilersolc 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#

SOLIDITY
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#

  1. The attacker calls registerPlayer("alice", true, "").
  2. The name check passes. isOldEnough is stored and ignored.
  3. ownerOf["alice"] becomes the attacker.
  4. The same address registers bob, then charlie with isOldEnough false.
  5. The victim's registerPlayer("alice") reverts.
  6. registrationCount for the attacker is 3.

Diagrams#

flowchart TD A["One address calls registerPlayer alice"] --> B["Name is free so the check passes"] B --> C["VULN ownerOf alice is that address"] C --> D["Same address also takes bob and charlie"] D --> E["Victim registerPlayer alice reverts taken"]

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#

BASH
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#


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.