server/lib/public
Lukas Reschke 9e6634814e
Add support for CSP nonces
CSP nonces are a feature available with CSP v2. Basically instead of saying "JS resources from the same domain are ok to be served" we now say "Ressources from everywhere are allowed as long as they add a `nonce` attribute to the script tag with the right nonce.

At the moment the nonce is basically just a `<?php p(base64_encode($_['requesttoken'])) ?>`, we have to decode the requesttoken since `:` is not an allowed value in the nonce. So if somebody does on their own include JS files (instead of using the `addScript` public API, they now must also include that attribute.)

IE does currently not implement CSP v2, thus there is a whitelist included that delivers the new CSP v2 policy to newer browsers. Check http://caniuse.com/#feat=contentsecuritypolicy2 for the current browser support list. An alternative approach would be to just add `'unsafe-inline'` as well as `'unsafe-inline'` is ignored by CSPv2 when a nonce is set. But this would make this security feature unusable at all in IE. Not worth it at the moment IMO.

Implementing this offers the following advantages:

1. **Security:** As we host resources from the same domain by design we don't have to worry about 'self' anymore being in the whitelist
2. **Performance:** We can move oc.js again to inline JS. This makes the loading way quicker as we don't have to load on every load of a new web page a blocking dynamically non-cached JavaScript file.

If you want to toy with CSP see also https://csp-evaluator.withgoogle.com/

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
2016-10-24 12:27:50 +02:00
..
Activity Fix others 2016-07-21 18:13:57 +02:00
App check registered sections and settings after an app got updated to garbage collect orphaned classes 2016-08-16 00:56:17 +02:00
AppFramework Add support for CSP nonces 2016-10-24 12:27:50 +02:00
Authentication Fix others 2016-07-21 18:13:57 +02:00
BackgroundJob Update with robin 2016-07-21 18:13:58 +02:00
Capabilities Fix others 2016-07-21 18:13:57 +02:00
Command Update with robin 2016-07-21 18:13:58 +02:00
Comments emit pre-update event for comments 2016-10-12 18:06:22 +02:00
Console Fix others 2016-07-21 18:13:57 +02:00
Contacts Fix others 2016-07-21 18:13:57 +02:00
DB/QueryBuilder Update with robin 2016-07-21 18:13:58 +02:00
Diagnostics add stacktrace to query logger 2016-08-24 14:37:15 +02:00
Encryption Fix others 2016-07-21 18:13:57 +02:00
Files optimize Folder::getById to use less queries 2016-10-12 16:12:28 +02:00
Http/Client Update with robin 2016-07-21 18:13:58 +02:00
L10N Fix others 2016-07-21 18:13:57 +02:00
LDAP Nextcloud license header for new files 2016-07-28 15:13:00 +08:00
Lock Update with robin 2016-07-21 18:13:58 +02:00
Mail Fix others 2016-07-21 18:13:57 +02:00
Migration Fix others 2016-07-21 18:13:57 +02:00
Notification Add an icon to the notification API 2016-10-07 17:00:24 +02:00
Preview Fix others 2016-07-21 18:13:57 +02:00
Route Update with robin 2016-07-21 18:13:58 +02:00
Search Fix others 2016-07-21 18:13:57 +02:00
Security Fix others 2016-07-21 18:13:57 +02:00
Session/Exceptions Fix others 2016-07-21 18:13:57 +02:00
Settings check registered sections and settings after an app got updated to garbage collect orphaned classes 2016-08-16 00:56:17 +02:00
Share Fix others 2016-07-21 18:13:57 +02:00
SystemTag Fix others 2016-07-21 18:13:57 +02:00
WorkflowEngine Validate the operation 2016-08-19 12:23:05 +02:00
API.php Fix others 2016-07-21 18:13:57 +02:00
App.php Fix others 2016-07-21 18:13:57 +02:00
AutoloadNotAllowedException.php Fix others 2016-07-21 18:13:57 +02:00
BackgroundJob.php Update with robin 2016-07-21 18:13:58 +02:00
Config.php Update with robin 2016-07-21 18:13:58 +02:00
Constants.php Fix others 2016-07-21 18:13:57 +02:00
Contacts.php Fix others 2016-07-21 18:13:57 +02:00
DB.php Update with robin 2016-07-21 18:13:58 +02:00
Defaults.php Fix others 2016-07-21 18:13:57 +02:00
Files.php Update with robin 2016-07-21 18:13:58 +02:00
GroupInterface.php Fix others 2016-07-21 18:13:57 +02:00
IAddressBook.php Fix others 2016-07-21 18:13:57 +02:00
IAppConfig.php Update with robin 2016-07-21 18:13:58 +02:00
IAvatar.php Update with robin 2016-07-21 18:13:58 +02:00
IAvatarManager.php Fix others 2016-07-21 18:13:57 +02:00
ICache.php Fix others 2016-07-21 18:13:57 +02:00
ICacheFactory.php Update with robin 2016-07-21 18:13:58 +02:00
ICertificate.php Update with robin 2016-07-21 18:13:58 +02:00
ICertificateManager.php Update with robin 2016-07-21 18:13:58 +02:00
IConfig.php Update with robin 2016-07-21 18:13:58 +02:00
IContainer.php Fix others 2016-07-21 18:13:57 +02:00
IDateTimeFormatter.php Fix others 2016-07-21 18:13:57 +02:00
IDateTimeZone.php Fix others 2016-07-21 18:13:57 +02:00
IDb.php Fix others 2016-07-21 18:13:57 +02:00
IDBConnection.php Allow 4byte unicode filenames on supported platforms 2016-10-20 14:26:09 +02:00
IEventSource.php Update with robin 2016-07-21 18:13:58 +02:00
IGroup.php Update with robin 2016-07-21 18:13:58 +02:00
IGroupManager.php Update with robin 2016-07-21 18:13:58 +02:00
IHelper.php Fix others 2016-07-21 18:13:57 +02:00
IImage.php Fix others 2016-07-21 18:13:57 +02:00
IL10N.php Fix IL10N phpdoc 2016-08-16 20:24:50 +02:00
ILogger.php Fix others 2016-07-21 18:13:57 +02:00
Image.php Fix others 2016-07-21 18:13:57 +02:00
IMemcache.php Update with robin 2016-07-21 18:13:58 +02:00
IMemcacheTTL.php Update with robin 2016-07-21 18:13:58 +02:00
INavigationManager.php Fix others 2016-07-21 18:13:57 +02:00
IPreview.php Update with robin 2016-07-21 18:13:58 +02:00
IRequest.php Fix others 2016-07-21 18:13:57 +02:00
ISearch.php Fix others 2016-07-21 18:13:57 +02:00
IServerContainer.php Deprecate old app folder 2016-10-05 11:00:16 +02:00
ISession.php Fix others 2016-07-21 18:13:57 +02:00
ITagManager.php Fix others 2016-07-21 18:13:57 +02:00
ITags.php Fix others 2016-07-21 18:13:57 +02:00
ITempManager.php Update with robin 2016-07-21 18:13:58 +02:00
IURLGenerator.php Fix others 2016-07-21 18:13:57 +02:00
IUser.php Update with robin 2016-07-21 18:13:58 +02:00
IUserBackend.php Fix others 2016-07-21 18:13:57 +02:00
IUserManager.php Update with robin 2016-07-21 18:13:58 +02:00
IUserSession.php Update with robin 2016-07-21 18:13:58 +02:00
JSON.php Fix others 2016-07-21 18:13:57 +02:00
PreConditionNotMetException.php Fix others 2016-07-21 18:13:57 +02:00
Response.php Update with robin 2016-07-21 18:13:58 +02:00
SabrePluginEvent.php Fix others 2016-07-21 18:13:57 +02:00
SabrePluginException.php Fix others 2016-07-21 18:13:57 +02:00
Share.php Fix others 2016-07-21 18:13:57 +02:00
Share_Backend.php Fix others 2016-07-21 18:13:57 +02:00
Share_Backend_Collection.php Fix others 2016-07-21 18:13:57 +02:00
Share_Backend_File_Dependent.php Fix others 2016-07-21 18:13:57 +02:00
Template.php Fix others 2016-07-21 18:13:57 +02:00
User.php Fix others 2016-07-21 18:13:57 +02:00
UserInterface.php Fix others 2016-07-21 18:13:57 +02:00
Util.php write channel to config file when changed 2016-09-26 13:44:56 +02:00