This project demonstrates how to conduct and prevent XSS attacks
git clone <...>
cd demo_xss
bundle install
ruby app.rb
Now view at the site at http://localhost:4567
or whichever port it is on.
Look at the running site and open the 'hacking instructions' link to see what kind of text input you could enter to conduct a script injection attack.
Search within the code of this project (*.rb
and views/*.slim
) for 'XSS' -- you should find comments on how make modifications to prevent XSS attacks.
- Overview of XSS Concepts
- XSS Security
- Content Security Policy (CSP)
- Subresource Integrity and CORS
- Cookie Security