Skip to content

Add repr() and %r sanitizers to py/log-injection query to reduce false positives#22026

Open
mrigankpawagi wants to merge 2 commits into
github:mainfrom
mrigankpawagi:mrigankpawagi/py-log-injection-fix
Open

Add repr() and %r sanitizers to py/log-injection query to reduce false positives#22026
mrigankpawagi wants to merge 2 commits into
github:mainfrom
mrigankpawagi:mrigankpawagi/py-log-injection-fix

Conversation

@mrigankpawagi

@mrigankpawagi mrigankpawagi commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This PR improves the py/log-injection query by recognizing repr() and the %r format specifier as sanitizers for log injection. This is a very common false positive pattern for this query.

Note: This PR currently only contains new test cases in order to demonstrate the false positive pattern. Once that is demonstrated from the CI, I will push the fix.

@mrigankpawagi mrigankpawagi requested a review from a team as a code owner June 20, 2026 15:46
Copilot AI review requested due to automatic review settings June 20, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mrigankpawagi mrigankpawagi changed the title Add repr() and %r sanitizers to py/log-injection query Add repr() and %r sanitizers to py/log-injection query to reduce false positives Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants