A trial user's serial was alternating between the built-in trial
passcode (authorized) and a forged 50-year/1000-host passcode (rejected)
on every heartbeat. ShouldLogAuth keyed its throttle on the serial alone
and logged every status flip, so the rate limit was defeated and the
master log filled with alternating success/failure lines.
ShouldLogAuth now tracks the success and failure states independently
per serial and source IP: each logs on first sight and then at most once
per hour, with a bounded cache. Keying only by serial would collapse the
many normal trial users that share one serial into a single line.
AutoRevokeForgedAuth handles the offending connection itself. Integrity
failures (V1 codes 2/3, V2 code 4) are counted per connection context,
and three within 60 seconds send the same days=0 CMD_AUTHORIZATION as
the manual "revoke authorization" menu, with a 10-minute cooldown. It
acts only when the same serial also had a successful auth in the last
two minutes, which is the observed abuse pattern; a batch of failures
after a password rotation or a client pointed at another master has no
success event and is left alone. Expired and already-revoked licences
never trigger it. Without a configured super password it only warns.
Translations added. Debug x64 server builds; not runtime-tested.
Co-Authored-By: deepseek-flash