User Interface (UI) redress vulnerability (clickjacking) detected.

  • Rule ID: javascript_express_ui_redress
  • Languages: javascript
  • Source: ui_redress.yml


Using unsanitized user input to set X-Frame-Options or Content-Security-Policy HTTP headers puts your application at risk for UI redress attacks (clickjacking).


✅ Prefer the most secure values when setting these headers

res.set('X-Frame-Options', 'DENY')
res.set('Content-Security-Policy', "frame-ancestors 'none'")

✅ Avoid using user input directly to set the headers, or use a safelist to guard against clickjacking

if (req.query.options === 'same') {
res.set('X-Frame-Options', 'SAME')

// safelist
if (['deny', 'sameorigin'].includes(req.query.options.toLowerCase)) {
res.set('X-Frame-Options', req.query.options)


Associated CWE

OWASP Top 10