bug: trust the organizer tag only from a flag, strip chat formatting, gag spectators first - #197
Merged
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_chatshows the organizer tag only when the api's last RCON token is1, 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.[colour]/[teamcolor]/[newline]tags stripped. CSS passes text through as-is, so only the control bytes applied there.MatchUtility.AllChatRoute.GagPlayerand the team-chat relay shareIsGagged, which also catches a gagged steam id hidden behind a placeholder name prefix.Merge/deploy: ship the api change first. The api appends
1/0after 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 a1.Tests: new
ChatRelayTestsfail against main's logic and pass now. Both plugins build clean with--no-incremental. CSS 156/156, Swiftly 195/195.