github Shadowner/Infrarust v2.0.0-beta.5
v2.0.0-beta.5 - Security audits + ping and data plane perf + architecture cleanup

one hour ago

No headline feature this time. Two security audits went through the proxy core, the auth
plugin, the WASM loader and the admin API, the ping and data paths got faster, and the core
was split into smaller pieces.

Several defaults are stricter now, and a few configs that loaded on beta.4 are refused.
Read Before you upgrade first.

Before you upgrade

What changed What to do
receive_proxy_protocol = true now requires trusted_proxies. With an empty list the proxy refuses to start, and a peer outside the list is closed before its header is read List your load balancers: trusted_proxies = ["10.0.0.5", "10.0.1.0/24"]. ["0.0.0.0/0", "::/0"] brings back the old behaviour, only do that behind a firewall
Rate limiting is on by default: 10 logins and 300 status pings per 10 s per IP. New max_connections_per_ip = 32. max_connections goes from unlimited to 10000 Players behind playit, frp, ngrok, the Docker userland proxy or NAT share one address. Send the real address with PROXY protocol, or raise the limits (0 disables max_connections_per_ip, [rate_limit] enabled = false)
Docker: a container can only claim a domain listed in [docker] allowed_domains. <container>.docker.local still works without an entry Add your domains: allowed_domains = ["*.mc.example.com"]. The warning in the log prints the line to add
Docker: containers no longer inherit the proxy-wide [forwarding] mode inherit_forwarding = true in [docker]. Only client_only and offline containers inherit it
A server on passthrough, zero_copy or server_only that would inherit a proxy-wide bungee_cord or bungee_guard mode is refused: the proxy never verified those players, so any client could claim any identity there Set forwarding_mode = "none" on the server, or write the mode explicitly to accept the risk (logs a warning)
A per-server forwarding_mode = "velocity" or "bungee_guard" is only accepted when [forwarding] mode is the same. There is one secret, and a Velocity secret is never sent as a clear-text BungeeGuard token Align the server with the proxy-wide mode
BungeeCord messaging: ip_other and server_ip are off by default, and a server without a network only sees itself Turn them back on in bungeecord_permissions, give your servers a network
A bans.json that cannot be parsed stops the proxy. It used to be renamed to .bak, which lifted every ban Repair the file, or move it away to start with no bans. A missing or empty file still starts with no bans
A favicon must be a PNG of at most 64 KiB Convert or shrink it
The admin API refuses a local server manager in a server document it writes Write those server files by hand in servers/
Connection spans record client.ip truncated to the /24 (IPv4) or /48 (IPv6) [telemetry.traces] client_ip = "full", or "off"
WASM plugins need a capability to set a custom permission snapshot (permission-provider), force the auth mode or change the game profile (identity-override) Grant it: [plugins.my-plugin] permissions = ["identity-override"]. The WIT contract did not change, so nothing needs a rebuild
Native plugins: the proxy-implemented traits are sealed, CodecSessionInit and TransportContext are non_exhaustive Build those two through new, rebuild against beta.5

Security

Connections

  • Every frame read before login (handshake, login start, status request, ping, encryption
    response, legacy names and hosts) is size-capped before being buffered.
  • Online authentication is bounded in time and in concurrency, and bytes a client sends
    ahead of the encryption switch are refused.
  • Legacy clients (Beta to 1.6) go through the same pipeline as modern ones: rate limit, bans
    and IP filters.
  • Status pings no longer queue behind a backend that stops answering.
  • A client that stops reading loses its session once a write to it has been blocked for 30 s.
  • Control characters are escaped in logs and refused in login names.
  • The first refusal from the rate limiter or the per-IP limit logs one warning that names the
    usual causes. Later ones go to debug.

Identity and bans

When a login arrives with a UUID that already has a session, the older session is now closed
only if the new one can outrank it:

New login Closes an older session that is
Verified (client_only) Verified or unverified
Unverified (offline) Unverified
Forwarded (passthrough, zero_copy, server_only) None

An offline login can no longer kick a verified player by claiming their UUID, and a
passthrough client cannot kick anyone. Name lookups (/ir kick, /ir find, /ir send, the
plugin API) pick the exact spelling first, then the most trusted session.

  • An unverified player cannot be moved to a client_only server, by a command, a plugin or
    a redirect: "This server requires a verified Minecraft account".
  • Name bans are checked before a plugin takes over a claimed login.
  • The ban check fails closed when it has no login data.
  • /ir ban warns when some servers run a mode where a name ban cannot hold (forwarding
    modes, offline) and suggests an IP ban. The bans page now
    has a table of what each proxy mode can enforce.

Backend data

The proxy no longer trusts a backend to stay within reasonable sizes. A command tree over
1 MiB or 32,768 nodes is forwarded unchanged instead of being merged, boss bars are tracked
up to 256 per session, and the commands queued while a player is not in game are bounded.
Backend config frames are no longer replayed to limbo players, frames sent before the client
acknowledged the state change are dropped, and so are transfers the proxy cannot check or
redirect.

Server starts

Anyone who could reach the login could restart a crashing server in a loop. Starts for a
joining player are now throttled per server, whether the proxy wakes it or server-wake does:

  • at most one start every 30 s,
  • a server that fails to start, crashes, or stops on its own within 10 minutes of its start
    waits 30 s before the next one, doubling on each crash up to 10 minutes,
  • a stop the proxy asked for is not a crash.

Starts from the console, the admin API or a plugin calling start are not throttled and clear
the wait. Details: https://infrarust.dev/guide/server-management#start-throttle

Auth plugin

Update if you use it. The limbo login accepted a fixed placeholder, a constant in the
source, as the password of any premium (passwordless) account. The placeholder is now random
at startup. A storage error is no longer read as "no account", and after a failed flush the
next one writes again instead of doing nothing.

Admin API and config files

  • motd.online.favicon read any path whole and served it base64-encoded, so whoever could
    write a server config, an API key holder included, could read any file the proxy can read,
    such as the forwarding secret. It now only reads a PNG of at most 64 KiB.
  • A key holder could write a local server manager, which runs a command on the proxy host.
    The API now refuses it.
  • An edit that kept a panel key redacted while changing the panel URL or type got the stored
    key put back, so it would have been sent to the new address. The key is only restored for
    the panel it was issued for.

WASM

With only the baseline grant, a plugin could make any player admin through a custom
permission snapshot, skip Mojang auth with force-offline, or log a client in under another
identity by rewriting the game profile. These now need permission-provider and the new
identity-override capability. Denying a login stays available to every plugin.

Dependencies

The lockfile update clears the open RustSec advisories on wasmtime, rustls, rustls-webpki,
tokio, zstd and others. rsa 0.10 fixes the Marvin timing attack (RUSTSEC-2023-0071) on the
login key, and serde_yml (RUSTSEC-2025-0068) is replaced by serde_norway for the v1
migration. The PR checks now fail on a dependency advisory.

Performance

  • With no ProxyPingEvent listener, a cached ping is served from a frame encoded once per
    cache entry: about 190 ns per hit, against 7 µs when a listener forces the rebuild.
  • The zlib state is only built when a packet is actually compressed, so status pings and
    pre-auth packets skip it (encoder construction 1.8 µs to 1 ns). A compressed frame is
    reused as-is between connections with different thresholds whenever its bytes are valid
    there: 11.6 µs to 0.25 µs for a 2 KiB frame.
  • The handshake is read in one pass without cloning the buffered bytes.
  • Backend IP literals connect without a resolver call, hostnames go through a 15 s cache
    dropped on any connect failure, and IPv6 literals without brackets now connect.
  • Sockets are configured in place, splice pipes get the size the kernel actually gives, and an
    idle bridge no longer holds its 16 KiB read buffer.
  • The event bus skips its queue when nobody listens, and player counts per server no longer
    scan every session.
  • mimalloc is the allocator on every target, not only musl, and logs go through a writer
    thread instead of a blocking stdout write on a runtime worker.
  • WASM: the epoch ticker starts with the first plugin, and WASI directories open off the
    runtime workers.

Fixes

Minecraft

  • 26.2+: the limbo Join Game carries the online_mode flag, so 26.2 and 26.3 clients no
    longer read every following field one byte off.
  • 26.2+: verified players are told online mode by the limbo, the backend and server
    switches, and their chat session reaches backends that receive the forwarded identity, so
    signed chat works there.
  • 26.1+: limbo chunk sections carry the fluid count.
  • The limbo player gets entity id 1, which 26.x accepts, and stays in place with frozen
    flight instead of falling through the void (1.7.10 to 26.3).

Config and routing

  • version_protocol in MOTD entries. MOTDs built by the proxy (sleeping, starting,
    unreachable, default) now advertise the client's own protocol, so other versions no longer
    show the server as incompatible.
  • unknown_domain_behavior = "drop" only applies to unknown domains. A rate-limited or
    IP-filtered login gets its kick reason again.
  • A connection refused by the global [ip_filter] is closed without a reply. Status clients
    used to read the kick as a MOTD.
  • Configs that still set [motd.offline] or [default_motd.offline] load again, with a
    warning.
  • trusted_proxies accepts a bare address as a single host.
  • The legacy status cache is keyed by ping variant.

Docker

  • Containers already running when Docker was unreachable at startup are picked up once the
    event stream connects, and the provider rescans every poll_interval (#103, #104).
  • The provider connects to the configured endpoint, no longer resolves backends through the
    container name, and resolves fallback addresses from published ports.

Server manager

  • A failed manual start is marked crashed instead of staying Starting for the whole timeout.
  • A requested stop is not counted as an early exit, a crashed server keeps being polled so a
    backend that came back is not locked out, and a panel server that stops right after its
    start backs off.

Transport and plugins

  • The backend PROXY header carries the real client port.
  • The accept loop keeps retrying on descriptor exhaustion on every unix, and its backoff stops
    as soon as shutdown is requested.
  • A codec filter that would create an ordering cycle is refused.
  • When a plugin's config provider unloads, every route it owned goes with it.
  • Limbo teardown callbacks are guarded against hangs and panics.
  • WASM hostname checks answer from the cache while a lookup is in flight.
  • The SDK logs a warning when the proxy refuses a codec filter or a limbo handler.
  • The admin API brackets IPv6 backend addresses.

For plugin developers

  • SchedulerExt schedules closures and futures without boxing them yourself.
  • ServerManager::wake starts a server for a joining player and obeys the start throttle.
    start does not.
  • BoxFuture lives at the crate root (still re-exported from event), and tokio is
    optional in infrarust-api, pulled in by the host and test-util features.
  • The proxy-implemented traits are sealed. Mocks come from infrarust_api::test_util.
  • WASM contract unchanged. identity-override is a host-side capability.

Under the hood

The core was split along its responsibilities: connection handling, session loop, server
switch, login relay and status each run as named steps, the console and /ir commands come
from one table, and a lot of stringly-typed state became enums. The WASM loader and the admin
API got the same pass. The PR checks run lint and tests in parallel jobs.

Thanks

Full changelog: v2.0.0-beta.4...v2.0.0-beta.5

Don't miss a new Infrarust release

NewReleases is sending notifications on new releases.