Skip to content

bug: trust the organizer tag only from a flag, strip chat formatting, gag spectators first - #197

Merged
lukepolo merged 1 commit into
mainfrom
bug/chat-relay-injection
Sep 29, 2026
Merged

lukepolo merged 1 commit into
mainfrom
bug/chat-relay-injection

Conversation

@lukepolo

Copy link
Copy Markdown
Contributor

Web chat relayed into the game could fake the red [organizer] tag through a player's name, or inject colours and fake line breaks. A gagged lineup member sitting on Spectator also got around the gag in all chat.

  • web_chat shows the organizer tag only when the api's last RCON token is 1, never from a line that starts with [organizer]. It reads the last token because SwiftlyS2 also treats U+200B as a quote, which lets a chatter push tokens out of the quoted line.
  • Relayed web text, and the name, clan and message in the spectator all-chat rebroadcast, have control bytes and SwiftlyS2 [colour]/[teamcolor]/[newline] tags stripped. CSS passes text through as-is, so only the control bytes applied there.
  • The gag check now runs before the spectator rebroadcast, via MatchUtility.AllChatRoute.
  • GagPlayer and the team-chat relay share IsGagged, which also catches a gagged steam id hidden behind a placeholder name prefix.

Merge/deploy: ship the api change first. The api appends 1/ 0 after the quoted line, keeps its [organizer] prefix and strips U+200B. Until it ships, organizers get no tag, and on Swiftly an unflagged line can still smuggle a 1.

Tests: new ChatRelayTests fail against main's logic and pass now. Both plugins build clean with --no-incremental. CSS 156/156, Swiftly 195/195.

… gag spectators first

- web_chat renders the organizer tag only when the api's last token is 1,
  never from a line that starts with [organizer]; SwiftlyS2 splits on
  U+200B, so earlier tokens can be smuggled out of the quoted line
- strip control bytes and SwiftlyS2 [colour]/[newline] tags from relayed web
  text and from the spectator all-chat rebroadcast (name, clan, message)
- all chat checks the gag before the spectator rebroadcast, via
  MatchUtility.AllChatRoute; GagPlayer uses the same IsGagged check
@lukepolo
lukepolo merged commit bc98d3a into main Sep 29, 2026
3 checks passed
@lukepolo
lukepolo deleted the bug/chat-relay-injection branch September 29, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant