Repository navigation
Conversation
…log lines The game name and the cover's game name are logged when an upload fails; they now go through _plain, which drops carriage returns and newlines, so a request can't fake another log entry.
Fix the two CodeQL log-injection alerts
Merge dev into main: CodeQL log-injection fixes
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.
Fixes the two open CodeQL alerts in this repo's Security tab (py/log-injection, app/routers/games.py, lines 118 and 517).
The game name from a request was written to the log as it came. It now goes through
_plain, which drops carriage returns and newlines, so a request can't fake another log entry. Game names are already limited to letters, numbers and hyphens, so nothing was exploitable.One file changed, plus a test. It went through a PR into the fork's dev (#142) and dev into main (#143) with pytest, malware-scan, CodeQL and the dependency checks green; 0 open alerts on the PR.
Checks run locally: pytest 1004 passed, 2 skipped.
If
pytestshows a failure that ran for about 15 minutes, it's a hung GitHub runner (the job is cancelled, not failed): re-run it. The same job passed on the fork after a re-run.