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

Prevent data leaks with CSP and HSTS Headers #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Prevent data leaks with CSP and HSTS Headers #70

wants to merge 1 commit into from

Conversation

Talenka
Copy link

@Talenka Talenka commented Dec 10, 2013

These headers add two security layers against MITM and XSRF attacks, respectively. Since security is a major feature of this project, they should not be ignored.

For paranoid people, you should even use header("Content-Security-Policy: default-src 'self'"); to prevent anything to be loaded except for the very server which run ZeroBin.

These headers add two security layers against MITM and XSRF attacks, respectively. Since security is a major feature of this project, they should not be ignored.

* Adding the `Strict-Transport-Security` header, you locks the traffic on https protocol for a day (86400 seconds). If the server is not https-capable, this security layer is simply ignored by browser. See: https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security

* Adding the `Content-Security-Policy` header, you forbid the browser to load scripts from another domain. This help to address tricky code injections (e.g. unicode tag attributes bypass or `javascript:` URI in users comments). See: https://developer.mozilla.org/en-US/docs/Security/CSP/CSP_policy_directives#script-src

For paranoid people, you should even use `header("Content-Security-Policy: default-src 'self'");` to prevent anything to be loaded except for the very server which run ZeroBin.
@ulikoehler
Copy link

@Talenka Please note that it might take some time until this will be merged by @sebsauvage (assuming it works, sorry, no time to test right now). See #63 for details!

Conceptually I really like your approach. I assume it's no big deal to fix any remaining issues.

@Talenka
Copy link
Author

Talenka commented Dec 11, 2013

@ulikoehler OK I'll work on your fork for now.

jelhan added a commit to jelhan/croodle that referenced this pull request Dec 13, 2013
Set Content-Type to application/json and charset to utf-8 to tell the browser how to handle the response
Lock traffic on https  for 1 day (86400 seconds) by Strict-Transport-Security
Forbid the browser to load scripts from another domain by Content-Securty-Policy
Last ones were adopted by Talenka's Pull Request for ZeroBin: sebsauvage/ZeroBin#70
@sebsauvage
Copy link
Owner

Thank you for the work (ulikoehler@18571ba). It looks interesting, but it currently breaks discussions.

blackout314 pushed a commit to GrayHats/ZeroBin that referenced this pull request Dec 9, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants