IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Switch to turn CSP script hash off

Open morrisond91 opened this issue 6 years ago • 5 comments

Hi, can you provide an option for turning CSP security headers off as shown here:

https://github.com/IdentityServer/IdentityServer4/blob/master/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs#L130

We are behind corporate infrastructure and Penetration testing results advised that we set Content-Security-Policy at IIS root, and all sites inherit from it. This caused us an issue with Safari only where the user was stuck on a white screen, triaging resulted in a CSP issue with the inline script that submits the form on callback page. ID Srv code appends the script-src csp as defined here: https://github.com/IdentityServer/IdentityServer4/blob/master/src/IdentityServer4/src/Endpoints/Results/AuthorizeResult.cs#L130 and then IIS headers are played, there becomes 2 script-src policies in the header and i found that this was invalid using csp validator

For now, i have intercepted the response headers and removed the Content-Security-Policy one using some middle ware and it gets me around the issue i faced.

morrisond91 avatar Jan 27 '20 15:01 morrisond91

For now i used some middle ware to remove the Content-Security-Policy header.

morrisond91 avatar Jan 31 '20 09:01 morrisond91

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

stale[bot] avatar Feb 14 '20 10:02 stale[bot]

I'm torn on this issue. Sometimes you need code on the request to render the CSP headers because of what's on the specific response, so I don't necessarily agree with the approach of a one-size fits all CSP directive on your reverse proxy.

brockallen avatar Feb 14 '20 13:02 brockallen

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

stale[bot] avatar Feb 28 '20 14:02 stale[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Apr 15 '20 08:04 lock[bot]