Skip to content

Add custom CSP for Win 10 compatibility - #17791

Merged
LukasReschke merged 1 commit into
masterfrom
make-eventsource-compatible-with-win10
Sep 10, 2015
Merged

LukasReschke merged 1 commit into
masterfrom
make-eventsource-compatible-with-win10

Conversation

@LukasReschke

Copy link
Copy Markdown
Contributor

The default content-security-policy of ownCloud forbids inline
JavaScript for security reasons. Edge starting on Windows 10 will
however also obey the CSP which will break the event source fallback.
As a workaround thus we set a custom policy which allows the execution
of inline JavaScript.

This fixes #14286 and is also required for owncloud/gallery#206

The default content-security-policy of ownCloud forbids inline
JavaScript for security reasons. IE starting on Windows 10 will
however also obey the CSP which will break the event source fallback.
As a workaround thus we set a custom policy which allows the execution
of inline JavaScript.

This fixes #14286
@LukasReschke LukasReschke added this to the 8.2-current milestone Jul 21, 2015
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@LukasReschke

Copy link
Copy Markdown
Contributor Author

@karlitschek Should get backported to the older releases. Win 10 will add CSP support which makes ownCloud pretty much unusable on newer IEs then as the EventSource is used for some other stuff as well such as the update process and also file listing if I'm not completely wrong.

If you agree I will prepare backports for stable7 - stable8.1.

@ghost

ghost commented Jul 21, 2015

Copy link
Copy Markdown

🚀 Test PASSed.🚀
chuck

@karlitschek

Copy link
Copy Markdown
Contributor

@LukasReschke Nice. Please backport 👍

@LukasReschke

Copy link
Copy Markdown
Contributor Author

So anybody up to review this since Win 10 has been released? 🙊

To test this access http://localhost/master/index.php/apps/files/ajax/scan.php?dir=/&force=true&requesttoken=urUGo9SQ01D4vPn8iWouZdByLYGLFK&fallback=true&=fallback_id=2 (obviously adjust the request token).

Before the CSP header was: Content-Security-Policy:default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *; connect-src *
With this patch the header is: Content-Security-Policy:default-src 'none'; script-src 'unsafe-inline'

The unsafe-inline allows inline JS for this resource.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@rperezb qa please 🙊 THX a lot

@rperezb

rperezb commented Aug 13, 2015

Copy link
Copy Markdown

Checking with @bboule for the environment to check this

@LukasReschke

Copy link
Copy Markdown
Contributor Author

Ping? 🙊

@LukasReschke

Copy link
Copy Markdown
Contributor Author

Pong? 🙉

@SergioBertolinSG

Copy link
Copy Markdown
Contributor

Using edge in windows 10. After accessing the provided url I am getting same headers as before.
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src *; font-src 'self' data:; media-src *; connect-src *

@LukasReschke

Copy link
Copy Markdown
Contributor Author

Are you sure you read the Content-Security-Policy of the EventSource page? This seems to work fine for me:
2015-09-10_13-42-31

@SergioBertolinSG

Copy link
Copy Markdown
Contributor

I've tried with that /master/ folder in the url and without it, same result in this headers.

content_policy

@LukasReschke

Copy link
Copy Markdown
Contributor Author

Are you sure the patch is applied? 52328 which has as per the Web UI 52330 as SSH port hasn't.

2015-09-10_13-55-09

@SergioBertolinSG

Copy link
Copy Markdown
Contributor

Yes, sorry, I patched the wrong server.

Now it is working fine
Content-Security-Policy: default-src 'none'; script-src 'unsafe-inline'

@SergioBertolinSG

Copy link
Copy Markdown
Contributor

Update is working correctly as well. (without the patch it didn't redirect, not sure if related) 👍

LukasReschke added a commit that referenced this pull request Sep 10, 2015
…ith-win10

Add custom CSP for Win 10 compatibility
@LukasReschke
LukasReschke merged commit 89cd929 into master Sep 10, 2015
@LukasReschke
LukasReschke deleted the make-eventsource-compatible-with-win10 branch September 10, 2015 13:00
@LukasReschke

Copy link
Copy Markdown
Contributor Author

stable8.1: #18957
stable8: #18958

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventSource fallback will not work with IE versions that support CSP

7 participants