Files
Pumpkin/pumpkin-protocol
catdum200 0d348892e5 fix(protocol): accept BungeeCord-forwarded handshake addresses (#2774)
* fix(protocol): accept BungeeCord-forwarded handshake addresses

`SHandShake::read` bounded `server_address` at 255 characters, the limit a
vanilla client observes. `bungeecord_login`, however, expects that same field
to carry the host, the client's IP, its UUID and its signed profile properties
separated by NUL bytes, exactly as documented on that function. With
`ip_forward` enabled the signed properties alone run past a thousand
characters, so the read failed with "too large: string" before
`handle_handshake` ever ran: the connection state never advanced,
`server_address` stayed empty and the proxy login path could not be reached.

The same struct already writes this field with `write_string`, which bounds it
at `i16::MAX`, so the reader was stricter than the writer. Read it with that
same bound, as Spigot does.

Closes #1293

* test(proxy): cover a BungeeCord login from the wire up

Encodes a handshake the way BungeeCord puts it on the wire with
`ip_forward` enabled, decodes it with the real packet reader, and hands
the resulting address to `bungeecord_login`, asserting the forwarded IP,
the forwarded UUID and the signed skin all survive the trip.

Without the widened bound on `server_address` this fails inside
`SHandShake::read`, so `bungeecord_login` is never reached at all.
2026-08-05 08:59:48 +02:00
..