Skip to content
Snippets Groups Projects
Unverified Commit c79dc0e0 authored by jaltek's avatar jaltek Committed by Roeland Jago Douma
Browse files

Configurable list for opt out from same site cookie protection

parent ebdd3fb6
No related branches found
No related tags found
No related merge requests found
...@@ -1595,4 +1595,14 @@ $CONFIG = array( ...@@ -1595,4 +1595,14 @@ $CONFIG = array(
*/ */
'gs.federation' => 'internal', 'gs.federation' => 'internal',
/**
* List of incompatible user agents opted out from Same Site Cookie Protection.
* Some user agents are notorious and don't really properly follow HTTP
* specifications. For those, have an opt-out.
*/
'csrf.optout' => array(
'/^WebDAVFS/', // OS X Finder
'/^Microsoft-WebDAV-MiniRedir/', // Windows webdav drive
),
); );
...@@ -523,11 +523,18 @@ class OC { ...@@ -523,11 +523,18 @@ class OC {
// specifications. For those, have an automated opt-out. Since the protection // specifications. For those, have an automated opt-out. Since the protection
// for remote.php is applied in base.php as starting point we need to opt out // for remote.php is applied in base.php as starting point we need to opt out
// here. // here.
$incompatibleUserAgents = [ $incompatibleUserAgents = \OC::$server->getConfig()->getSystemValue('csrf.optout');
// OS X Finder
'/^WebDAVFS/', // Fallback, if csrf.optout is unset
'/^Microsoft-WebDAV-MiniRedir/', if (!is_array($incompatibleUserAgents)) {
]; $incompatibleUserAgents = [
// OS X Finder
'/^WebDAVFS/',
// Windows webdav drive
'/^Microsoft-WebDAV-MiniRedir/',
];
}
if($request->isUserAgent($incompatibleUserAgents)) { if($request->isUserAgent($incompatibleUserAgents)) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment