Skip to content

fix: guard IPv6 login bucket parse so one login can't crash the world#114

Closed
ejtriple wants to merge 1 commit into
LostCityRS:274from
ejtriple:fix/ipv6-login-crash
Closed

fix: guard IPv6 login bucket parse so one login can't crash the world#114
ejtriple wants to merge 1 commit into
LostCityRS:274from
ejtriple:fix/ipv6-login-crash

Conversation

@ejtriple

@ejtriple ejtriple commented Jul 17, 2026

Copy link
Copy Markdown

A single IPv6 login crashes the whole world.

World.processLogins() buckets players by address; the IPv6 branch does parseInt(hextets[2], 16) % 256. With :: zero-compression that group is usually empty (2001:db8::1['2001','db8','','1']), so parseInt is NaN and BigInt(NaN) throws. The login loop is unguarded, so it unwinds to the cycle() catch, which removes every player and process.exit(1)s. That path also never notifies the friends server, so those players stay "already logged in" until their sessions expire.

Fix: fall back to bucket 0 for an empty/non-hex group. Valid addresses are unchanged (2001:4860:4860::8888 → 96, fe80::1 → 1).

@ejtriple
ejtriple force-pushed the fix/ipv6-login-crash branch from 5eea759 to 4ada9ff Compare July 17, 2026 17:01
`::` zero-compression can leave hextets[2] empty, so parseInt returns NaN and
BigInt(NaN) throws in the unguarded processLogins() loop, unwinding to the
cycle() catch that drops all players and exits. Fall back to bucket 0; valid
addresses unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ejtriple
ejtriple force-pushed the fix/ipv6-login-crash branch from 4ada9ff to 2c98428 Compare July 17, 2026 17:02
@ejtriple ejtriple closed this by deleting the head repository Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant