Medium severityRubyCross-Site Scripting (XSS)MEDIUM confidence
XSS HTML Safe Interpolation
An interpolated/concatenated string is emitted as raw HTML via raw()/html_safe, a common stored/reflected XSS sink (CWE-79).
Standards mapping
- OWASP Top 10
- A03:2021 - Injection
- OWASP ASVS
- V5.3.3 (L1)
Vulnerable vs. safe
Flagged by this check
raw("<p>#{comment_body}</p>")Passes - the safe pattern
raw("<p>no interpolation here</p>")Why it matters & how to fix it
An interpolated/concatenated string is emitted as raw HTML via raw()/html_safe, a common stored/reflected XSS sink (CWE-79). Do not hand-build HTML with .html_safe; use tag helpers and let Rails escape interpolated values, or sanitize() with an allow-list.
References
Rule ID integsec-ruby-xss-html-safe-interpolation - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Cross-Site Scripting (XSS)DOM XSS Innerhtml Sink
- JavaScript / TypeScript - Cross-Site Scripting (XSS)Reflected XSS Response Tainted Input
- JavaScript / TypeScript - Cross-Site Scripting (XSS)React Dangerously Set Inner HTML
- Go - Cross-Site Scripting (XSS)Text Template For HTML
- Go - Cross-Site Scripting (XSS)XSS Response Write
- Go - Cross-Site Scripting (XSS)XSS Template HTML Bypass