Sanitize every field the channel summary quotes, not just the handle

The endpoint is public and unauthenticated, so the whole uploaded file is
attacker-chosen, not only the part the client copied from Ja2.ini. The build
field sat inside backticks a backtick closes, and the access-violation text
went in raw, so either could carry markdown or a link into the channel.

One clean(): printable ASCII minus what Discord reads as markup or a URL,
length-capped. It replaces the handle's own stripping and absorbs the .trim()
the field getters did, which also drops the CR that "(.+)$" captures off a
CRLF report.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
majcosta
2026-07-28 10:25:47 -03:00
committed by majcosta
co-authored by Claude Opus 5
parent 90f5bff69b
commit 1d0b4beb4c
3 changed files with 24 additions and 9 deletions
+6 -2
View File
@@ -96,6 +96,10 @@ a millisecond of CPU — the time spent waiting on Discord is not metered.
No authentication. The endpoint is public and its URL ships in every player's
`Ja2.ini`, so assume it will eventually be found; the size and `*** CRASH` checks
only keep out drive-by scanners. Report contents are attacker-controlled text, which
is why the summary line strips markdown from the handle and sends
only keep out drive-by scanners. Every field the summary line quotes is therefore
attacker-chosen, not just the handle: all of them go through `clean()`, which keeps
printable ASCII minus Discord's markup and link characters, and the post sends
`allowed_mentions: {parse: []}`. Blast radius of abuse is a message we delete.
The per-IP limiter does nothing against a distributed flood — that would cost
channel noise and the 100k/day request budget, not money.