Unsanitized user input detected in response.

Description

Applications should not include unsanitized user input in responses. This can allow cross-site scripting (XSS) attacks.

Remediations

❌ Avoid including user input directly in the response:

render html: "<h1>#{params[:title]}</h1>"

✅ Sanitize user input when including it in a response:

render html: "<h1>#{strip_tags(params[:title])}</h1>"

Resources

Associated CWE

OWASP Top 10