We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2d4cf55 + ec32bdc commit 35f61d9Copy full SHA for 35f61d9
ruby/ql/src/queries/security/cwe-117/examples/log_injection_good.rb
@@ -5,9 +5,8 @@ def login
5
logger = Logger.new STDOUT
6
username = params[:username]
7
8
- # GOOD: log message constructed with unsanitized user input
9
- sanitized_username = username.gsub("\n", "")
10
- 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", "")
11
12
# ... login logic ...
13
end
0 commit comments