> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/hacking-tools/exploitation/csp-bypass.md).

# CSP-Bypass

CSP-Bypass ist eine Forschungsressource zur Überprüfung von Schwachstellen in Content Security Policies, riskanten Allowlists und browser-spezifischem Verhalten während autorisierter Tests.

[CSP-Bypass](https://cspbypass.com/) sammelt Recherchen zur Bewertung von Content-Security-Policy-Kontrollen. Verwenden Sie es, um Richtlinien in Systemen zu validieren, die Ihnen gehören oder zu deren Test Sie autorisiert sind.

<figure><img src="https://2955439919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2F9jMcNmkKNQCChy8feUL9%2Fimage.png?alt=media&amp;token=6bce4466-7795-4ce4-8319-d2c1e4b4e8bb" alt=""><figcaption></figcaption></figure>

### Was zu überprüfen ist

* Erfassen Sie jede `Content-Security-Policy` Header und Richtlinie `Meta` Tag.
* Überprüfen `script-src`, `object-src`, `base-uri`, und `frame-ancestors` zuerst.
* Notieren Sie Nonces, Hashes, `strict-dynamic`, Platzhalter und Drittquellen.

### Validierungs-Workflow

1. Erfassen Sie die Richtlinie mithilfe der Browser-Entwicklertools oder eines abfangenden Proxys.
2. Identifizieren Sie den Injektionspunkt und den verfügbaren Ausführungskontext.
3. Vergleichen Sie die erlaubten Quellen mit CSP-Bypass-Recherchen und dem Verhalten des Browsers.
4. Verwenden Sie den kleinsten kontrollierten Nachweis, der die Schwäche der Richtlinie demonstriert.
5. Dokumentieren Sie die Richtlinie, die Browserversion, die Voraussetzung und die beobachtete Auswirkung.

### Richtlinienmuster mit hohem Risiko

| Muster                        | Warum das wichtig ist                                                                                            |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `script-src *`                | Jede HTTPS-Skriptquelle kann ausführbar werden.                                                                  |
| `'unsafe-inline'`             | Das Einschleusen von Inline-Skripten kann die beabsichtigte Beschränkung umgehen.                                |
| Breite Wildcards              | Übernommene Subdomains oder vergessene Hosts können Ausführungspfade schaffen.                                   |
| Veraltete Drittanbieter-Hosts | Ein vertrauenswürdiger Ursprung kann JSONP, Weiterleitungen oder vom Angreifer kontrollierte Inhalte offenlegen. |
| Fehlend `object-src`          | Veraltete Plugin-Inhalte können weiterhin erlaubt sein.                                                          |

### Härtungsgrundlage

Verwenden Sie eine strenge Richtlinie als Ausgangspunkt. Passen Sie die Quelllisten an die Anforderungen der Anwendung an.

```http
Content-Security-Policy: default-src 'none'; script-src 'nonce-<random-per-response>' 'strict-dynamic'; style-src 'self'; img-src 'self' data:; connect-src 'self'; font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'
```

* Generieren Sie für jede Antwort einen eindeutigen Nonce.
* Entfernen Sie ungenutzte Drittanbieter-Skriptquellen.
* Stellen Sie Richtlinienänderungen vor der Durchsetzung im Nur-Bericht-Modus bereit.

### Checkliste für Berichte

Fügen Sie die betroffene URL, die vollständige Richtlinie und die verwundbare Direktive hinzu. Beschreiben Sie die erforderliche Injektionsprimitive und den getesteten Browser. Nennen Sie die minimal reproduzierbare Auswirkung. Empfehlen Sie die engste Richtlinienänderung, die das Problem behebt.

### Quellen

* [CSP-Bypass](https://cspbypass.com/)
* [MDN: Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP)
* [CSP Evaluator](https://csp-evaluator.withgoogle.com/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/de/hacking-tools/exploitation/csp-bypass.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
