Skip to main content

Glossary C

Glossary · E-commerce

Content Security Policy

Area
E-commerce

A Content Security Policy (CSP) is a mechanism that developers can use to lock down their web applications in various ways and so reduce the risk of content injection.

A website usually delivers the policy in an HTTP response header. The mechanism is set out in the W3C specification Content Security Policy Level 3, a Working Draft of 27 October 2026 and not a finished Recommendation. The specification names cross-site scripting as an example of the content injection vulnerabilities it addresses. It presents CSP not as the first line of defence but as an additional layer that does not replace careful input validation and output encoding.

Europol lists CSP among the protections against web skimming, because it makes injecting malicious code into a shop harder. OWASP's CSP cheat sheet adds that a CSP can be used to enforce Subresource Integrity, which can help when a third party serving JavaScript files is compromised.

For organisations that follow IT-Grundschutz, the Compendium, Edition 2023 (in German), has a Standard Requirement on developing web applications under which, among other headers, the Content-Security-Policy header should be set. In its recommendation BSI-CS 120 (version 3.0, 2021, in German), the BSI advises keeping JavaScript in separate files and not using eval(). Only then, it says, can a CSP be set without the security-critical settings unsafe-inline and unsafe-eval.

The specification provides the Content-Security-Policy-Report-Only header for trying out a policy. The browser then reports violations without enforcing the policy, so its effect can be observed first.

Sources

  1. Content Security Policy Level 3, W3C Working Draft, 27 October 2026 (opens in a new tab)

    W3C Web Application Security Working Group accessed

  2. Digital Skimming (Public awareness and prevention guide, deutsche Fassung) (opens in a new tab)

    Europol (European Cybercrime Centre, EC3) accessed

  3. Content Security Policy Cheat Sheet (opens in a new tab)

    OWASP Foundation (OWASP Cheat Sheet Series) accessed

  4. IT-Grundschutz-Kompendium Edition 2023 (Gesamt-PDF), Baustein CON.10 Entwicklung von Webanwendungen (opens in a new tab)

    Bundesamt für Sicherheit in der Informationstechnik (BSI) accessed

  5. BSI-CS 120: Sicherheitsmaßnahmen beim Einsatz aktiver Inhalte, Version 3.0 vom 01.02.2021 (opens in a new tab)

    Bundesamt für Sicherheit in der Informationstechnik (BSI) accessed

Share on LinkedIn

Let's talk about your project.

If this term is on your desk right now, a conversation usually helps faster than any definition.

Search the website

Popular topics

All results