-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive in go/log-injection
#9016
Comments
Thank you for raising this issue. This is indeed a false positive. It looks like the current version of the query does not recognize an instance of I'll contact the team that maintains the go libraries to see how they can improve the sanitizer recognition. |
@aeisenberg thanks for looking into this! If there is any way I can help implement that change let me know. |
Yes, all of our queries are open source and we welcome external contributions. The query that is giving you the false positive is here: https://github.com/github/codeql-go/blob/main/ql/lib/semmle/go/security/LogInjectionCustomizations.qll#L50-L59 If you get stuck or want some pointers on how to get started, feel free to join the Security Lab Slack channel. Information on an invite is in the link. |
@antoineco Thanks for reporting this! I agree with your assessment. This was quite a small fix, and sanitizers aren't the easiest place to start learning CodeQL, so I whipped up a quick PR. The version of CodeQL used in actions is updated every two weeks, so this should be fixed within two weeks of this PR getting merged. |
@owen-mc thanks! |
@antoineco If you got that far then you were doing well! |
Sorry, that PR got stuck in limbo. I have now opened #11910 to do the same thing. |
#11910 has now been merged. |
Description of the false positive
📄 Code snippet
CodeQL reports (via GitHub integration) that the following log write receives unsanitized user input:
This is untrue.
The user input is explicitly sanitized at the beginning of the switch case (in fact, we fixed it earlier this year thanks to CodeQL! 🙌 ):
The text was updated successfully, but these errors were encountered: