Commit graph

2 commits

Author SHA1 Message Date
WaterBoss11
ed2e1b24c5 Add packet crash guard to the protector
Drop incoming play packets carrying malformed (NaN/Infinity) or absurdly
large positions/velocities before the game applies them and overflows its
own section/collision math and crashes.

Some servers send such values deliberately to crash connected clients
(observed per-axis values around 1.8e38/2.8e38/2.1e38, reproducible with
optimisation mods disabled, so it is a vanilla-math overflow). A single
AutismProtectorNumericSanity check guards five vectors on
ClientPacketListener: explosion, player teleport, entity teleport, entity
position sync and entity spawn.

- AutismProtectorNumericSanity: pure, unit-tested sanity predicates.
- AutismProtectorPacketCrashGuardMixin: drops a packet whose position or
  velocity is out of range; require = 0 so a mapping rename degrades to
  "that packet unguarded" rather than failing the required mixin config.
- Gated by AutismProtector.shouldGuardCrashPackets() / config field
  protectorCrashGuard (default on); inherits the security package's
  opsec/external-protector deferral.

Adapted from BossCrashGuard (github.com/WaterBoss11/BossCrashGuard).
2026-07-21 15:34:34 -07:00
simeonvartik
9e00f40996 Release the tag update 2026-07-13 02:37:05 +02:00