Content Security Policy (CSP) is a security feature that helps prevent cross-site scripting (XSS) attacks on web pages. It allows website owners to specify which sources of content are allowed to be loaded on their pages.
CSP protects from cross-site scripting (XSS) attacks, which are a common type of web vulnerability. XSS attacks occur when an attacker injects malicious code into a web page, which can steal user data or perform unauthorized actions on behalf of the user.
This page demonstrates how to define a Content Security Policy for your website. The following CSP header only allows resources to be loaded from the same origin as the website:
Content-Security-Policy: default-src 'self'
You can customize this header to meet the specific needs of your website. For example, you can allow resources to be loaded from multiple sources:
Content-Security-Policy: default-src 'self' https://example.com https://cdn.example.com;
In this case, resources can be loaded from the same origin as the website, as well as from https://example.com
and https://cdn.example.com
.
CSP is used to help protect websites from XSS attacks. By specifying which sources of content are allowed to be loaded on a page, website owners can prevent malicious code from being injected into their pages. This can help improve the overall security of a website and protect user data.
Name | Type | Size | Last Modified |
. | Directory | - | 2024-08-28 12:31:11 |
.. | Directory | - | 2024-08-28 12:31:13 |
00.php | File | 1730 | 2024-04-12 19:22:52 |
10.php | File | 1415 | 2024-04-12 19:22:52 |
11.php | File | 1460 | 2024-04-12 19:22:52 |
12.php | File | 1461 | 2024-04-12 19:22:52 |
13.php | File | 1387 | 2024-04-12 19:22:52 |
14.php | File | 1350 | 2024-04-12 19:22:52 |
15.php | File | 1367 | 2024-04-12 19:22:52 |
16.php | File | 343 | 2024-04-12 19:22:52 |
99.php | File | 1586 | 2024-04-12 19:22:52 |
CSP.html | File | 33679 | 2024-04-12 19:22:52 |
exercises.html | File | 16616 | 2024-04-12 19:22:52 |
index.html | File | 3547 | 2024-04-12 19:22:52 |
index.html.old | File | 4285 | 2024-04-12 19:22:52 |
index.php | File | 5920 | 2024-04-12 19:22:52 |
instructions.php | File | 2634 | 2024-04-12 19:22:52 |
solutions.txt | File | 2131 | 2024-04-12 19:22:52 |
style.css | File | 1776 | 2024-04-12 19:22:52 |