Earlier quoted context omitted.
At a certain point you need to set a baseline expectation of your audience in order to communicate effectively. Do you think they should also explain exploitation, img-src, the mechanics of parsing unmatched quotes, javascript or CSRF? The target audience of the article knows what CSP stands for and most likely has been reading the other entries along this journey.
I think this comment raises a very good point and I struggle to see sure why it's proving so unpopular so far. It's true that the submitted blog post doesn't expand the CSP initialism -- this has been acknowledged as an oversight by the author and the post will be edited, as it's simply good practice as recommended in several style guides [1][2][3][4]. But the post's very first sentence links to a previous entry abou…
GitHub's post-CSP journey
21–30 of 60 posts
Re: GitHub's post-CSP journey
#22The article says CSP seven times in the first two paragraphs without saying what it stands for; it would be much more readable if they did. (It stands for content security policy for those wondering.)
To that end, it might be worth spelling out in the title here. I got my hopes up thinking it was about https://en.wikipedia.org/wiki/Communicating_sequential_proce... .
Re: GitHub's post-CSP journey
#23Earlier quoted context omitted.
Ditto
Apologies for that not being clear. Given I had linked to the original article in the first sentence, I took the perspective of people knowing which "CSP" I was talking about. I'll update the post in the morning to spell/link out to the first CSP reference.
Re: GitHub's post-CSP journey
#24The article says CSP seven times in the first two paragraphs without saying what it stands for; it would be much more readable if they did. (It stands for content security policy for those wondering.)
Re: GitHub's post-CSP journey
#25The "Origin" header is similar to the "Referer" header but never contains the path or query. Furthermore, CSRF protection requires it only for "POST" requests (i.e. "GET" requests are unaffected). So there is little incentive for an option disable it for privacy concerns.
[1] https://tools.ietf.org/html/rfc6454
[2] https://en.wikipedia.org/wiki/Cross-site_request_forgery
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=446344
[4] https://developer.microsoft.com/en-us/microsoft-edge/platfor... (filed by me)
Re: GitHub's post-CSP journey
#26https://www.troyhunt.com/how-chromes-buggy-content-security-...
I had a very similar experience, and I'm still hunting for the specifics of the browser that caused it in my case.
Re: GitHub's post-CSP journey
#27Re: GitHub's post-CSP journey
#28Can someone explain more about how the Gravatar example would work? How would the attacker embed a dangling markup on Github.com? If they could do that, couldn't they just use a standard XSS attack by embedding arbitrary HTML?
If you look at : https://cspvalidator.org/#url=https://github.com you'll see that the CSP policy directive defines the origins from which images can be loaded
'self' data: assets-cdn.github.com identicons.github.com collector.githubapp.com github-cloud.s3.amazonaws.com *.githubusercontent.com ;
Previously, images could have been loaded from additional domains (gravatar) and could have been used to leak CSRF tokens.Re: GitHub's post-CSP journey
#29If all browsers sent the "Origin" HTTP header [1] with POST requests (such that web applications could rely on it) then CSRF [2] tokens mentioned in the article would become obsolete. You'd just have to check whether the "Origin" header sent by the browser is identical to your scheme + domain name (e.g. " https://www.example.com" ) and be done. Chrome and Safari have implemented the "Origin" header long ago but unfor…
Re: GitHub's post-CSP journey
#30If all browsers sent the "Origin" HTTP header [1] with POST requests (such that web applications could rely on it) then CSRF [2] tokens mentioned in the article would become obsolete. You'd just have to check whether the "Origin" header sent by the browser is identical to your scheme + domain name (e.g. " https://www.example.com" ) and be done. Chrome and Safari have implemented the "Origin" header long ago but unfor…
The Origin header is not as good to prevent CSRF since it's a known value. A CSRF token is a one-time value generated in the server, it's impossible to guess or get a valid one from the outside.