Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update java/ql/src/experimental/Security/CWE/CWE-117/LogInjection.help
Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
  • Loading branch information
dellalibera and Marcono1234 authored Jul 3, 2020
commit bde715bebfa9e5f311524750915f972d2e5baf33
Original file line number Diff line number Diff line change
Expand Up @@ -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'`.
Comment thread
dellalibera marked this conversation as resolved.
Outdated
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.

splitted in two different lines

"two separate lines" might be more correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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'`.
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.

two different lines

"two separate lines" might be more correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I made the change.

</p>
Expand Down