Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSS protection #9

Open
octopusinvitro opened this issue Oct 15, 2017 · 0 comments
Open

XSS protection #9

octopusinvitro opened this issue Oct 15, 2017 · 0 comments

Comments

@octopusinvitro
Copy link
Contributor

octopusinvitro commented Oct 15, 2017

See our contributing guides.

Sinatra comes with some protection out of the box, but still there are some extra things we can do:

Input validation:

  • At the moment we have basic native validation. Are there any relevant restrictions we can add?

Input sanitization:

  • Some kind of tags stripping.

Output Escaping

Setting up CSP:

  • Either setting the HTTP headers in Sinatra or adding a meta tag:
get '/foo' do
    headers['Content-Security-Policy'] = 'script-src none'
<meta http-equiv="Content-Security-Policy" content="script-src none">

Using HttpOnly cookies:


Some useful guides:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant