User input serves as the basis for print formatting, which may expose sensitive data. Attackers may be able to use this to gain information on how to trigger other attacks, or exploit weaknesses.
1class TaintedFormat < ActionController::Base
2 def unsanitized_input
3 # Noncompliant: untrusted user input is being used directly in format sting.
4 printf(params[:format], arg)
5 end
6end
1class TaintedFormat < ActionController::Base
2 def sanitized_input
3 # Compliant: User-input is not used to format output.
4 printf(params[:format])
5 end
6end