-
Notifications
You must be signed in to change notification settings - Fork 2k
[Java] CodeQL query to detect Log Injection #3882
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
Changes from 1 commit
47579fd
aa0dc9b
bde715b
e4a5154
5ddb15f
e9c8434
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,11 +31,11 @@ other forms of HTML injection. | |
|
|
||
| <example> | ||
| <p>In the example, a username, provided by the user, is logged using `logger.warn` (from `org.slf4j.Logger`). | ||
| In the first case (`\bad` endpoint), the username is logged without any sanitization. | ||
| In the first case (`/bad` endpoint), the username is logged without any sanitization. | ||
| If a malicious user provides `Guest'%0AUser:'Admin` as a username parameter, | ||
| the log entry will be splitted in two different lines, where the first line will be `User:'Guest', while the second one will be `User:'Admin'`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
"two separate lines" might be more correct
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I made the change. |
||
| </p> | ||
| <p> In the second case (`\good` endpoint), <code>replace</code> is used to ensure no line endings are present in the user input. | ||
| <p> In the second case (`/good` endpoint), <code>replace</code> is used to ensure no line endings are present in the user input. | ||
| If a malicious user provides `Guest'%0AUser:'Admin` as a username parameter, | ||
| the log entry will not be splitted in two different lines, resulting in a single line `User:'Guest'User:'Admin'`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
"two separate lines" might be more correct
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. I made the change. |
||
| </p> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.