← Lab /Security & privacy

CSP can be bypassed to steal credentials via self-posting forms even with default-src 'none'

CSP policies that omit or set form-action to 'self' allow credential theft via a self-posting form without any JavaScript.

Security & privacy PortSwigger Research 11 Nov 2026 Attack Prototype evidence

Published as “Blind trust: stealing credentials through CSP”

Why it matters

Even well-configured CSP can still leak credentials via form submissions, highlighting the need to restrict or validate form-action directives.

Summary

The authors built a Burp Suite Attack Toolkit skill that parses CSP headers, checks for known script-source gadgets, and evaluates whether form-action permits a self-posting form. It uses a dataset of over 350 CSP bypass gadgets and can automatically generate a PoC that exfiltrates credentials via the Referer header to a Burp Collaborator server. In a lab page with default-src 'none' and form-action 'self', the skill demonstrated successful credential capture without any JavaScript execution. The evidence consists of a single controlled lab demonstration and the gadget dataset.

What they found 1

  1. The skill leverages a dataset of over 350 known CSP bypass gadgets to automatically identify script-source weaknesses.

    “The skill comes with a dataset of more than 350 known gadgets provided by cspbypass.com”

Caveats 6

  • With strict-dynamic, modern browsers ignore the host allow-list, so host gadgets won't fire.
  • A nonce or hash may gate execution.
  • If unsafe-inline appears without a nonce, hash or strict-dynamic, you don't need a gadget at all.
  • If the only header is Content-Security-Policy-Report-Only, findings are marked informational because the header blocks nothing.
  • Strict-dynamic, nonces, or hashes can prevent host-allow-list gadgets from executing.
  • The analysis does not consider other CSP bypass techniques beyond the provided gadget list.

What’s new here 4

  • Automated detection of CSP bypass gadgets and form-action credential exfiltration within Burp Suite.
  • Identification of form-action 'self' as a viable credential exfiltration vector even when scripts are blocked.
  • Integration with Burp Collaborator to automatically generate PoCs and capture leaked credentials.
  • Inclusion of a curated dataset of more than 350 known CSP bypass gadgets.