Create 06_xss_demo.md

This commit is contained in:
bpetschowitsch
2026-04-16 15:15:05 +02:00
parent f82f855f9b
commit dfe7f4a568
+25
View File
@@ -0,0 +1,25 @@
# XSS/CSP Demo
## Environment
Demo App -> [Addressbook](enable_php.md)
## Demo
check that csp is not set in nginx
## Browser
add following name & press "Speichern":
```html
Charlie <div id="out"></div><script>document.onkeypress = function(e) {document.getElementById('out').innerHTML += e.key};</script>
```
and now type on your keyboard...
## CSP
set CSP in nginx config
```nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self';" always;
```
repeat the Demo.