How to fix: Reflected Cross-Site Scripting (XSS)
A form on this page was submitted with a unique canary value, and that value came back in the response unescaped, exactly as submitted, instead of HTML-encoded. This proves the application reflects user input into the page without sanitizing it, the definition of reflected XSS.
Why it matters
An attacker who gets a victim to click a crafted link (or submit a crafted form) can run arbitrary JavaScript in that victim's browser, in the context of this site: stealing session cookies, performing actions as the victim, or redirecting them to a phishing page.
This is a confirmed, active finding, not a pattern match: the scanner actually submitted a test value through the form and observed it reflected unescaped in the live response. The active-probing category that produced it is opt-in and off by default, since submitting real requests to a target is a materially different action than reading its responses.
How to fix it
- 1HTML-encode all user-controlled output at the point it's inserted into a page (encode on output, not just on input).
- 2Use your framework's auto-escaping template engine (React JSX, Vue templates, Django/Jinja2 autoescape, Rails ERB `<%= %>`) instead of building HTML strings by concatenation.
- 3Add a Content-Security-Policy that disallows inline scripts as defense in depth, so even a missed escaping bug can't execute.
- 4Re-run this scan after the fix to confirm the canary no longer reflects unescaped.
Code examples
Encode on output, not just on input
// Bad: string concatenation drops straight into HTML
res.send(`<p>Results for: ${req.query.q}</p>`);
// Good: let the templating engine escape it
res.send(renderTemplate('results', { query: req.query.q }));
// React/JSX, Vue, and most modern template engines escape
// interpolated values by default -- the bug is almost always
// a raw string concatenation or a dangerouslySetInnerHTML-style
// escape hatch bypassing that default.References
Detected automatically by VulnRadar. The check id is reflected-input-xss, stable across every scan so you can filter or diff on it.
More active probing checks
- CriticalSQL Injection (Error-Based)
- CriticalServer-Side Template Injection (SSTI)
- CriticalOS Command Injection
- MediumConfirmed Open Redirect
Questions
- How severe is Reflected Cross-Site Scripting (XSS)?
- VulnRadar rates this critical severity in the active probing category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id reflected-input-xss, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Reflected Cross-Site Scripting (XSS) map to?
- It maps to CWE-79. In the OWASP Top 10 it falls under A03:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.