Skip to content

Commit

Permalink
Merge pull request #16107 from erik-krogh/fix-log-injection-typo
Browse files Browse the repository at this point in the history
RB: Tiny fixes to log-injection QHelp
  • Loading branch information
erik-krogh authored Apr 3, 2024
2 parents 2d4cf55 + ec32bdc commit 35f61d9
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ def login
logger = Logger.new STDOUT
username = params[:username]

# GOOD: log message constructed with unsanitized user input
sanitized_username = username.gsub("\n", "")
logger.info "attempting to login user: " + sanitized_username
# GOOD: log message constructed with sanitized user input
logger.info "attempting to login user: " + sanitized_username.gsub("\n", "")

# ... login logic ...
end
Expand Down

0 comments on commit 35f61d9

Please sign in to comment.