diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-03-23 19:31:17 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-03-24 08:59:56 +0100 |
commit | cc8c0b6a90be3967dd460c17e1894934016f4e0f (patch) | |
tree | 6f026645dee1d7c4b638a43448be4d30f00b537c /lib | |
parent | 4b3af9dfe781dc875f3bf94cd31e658ef1d707a9 (diff) | |
download | nextcloud-server-cc8c0b6a90be3967dd460c17e1894934016f4e0f.tar.gz nextcloud-server-cc8c0b6a90be3967dd460c17e1894934016f4e0f.zip |
Check if request is sent from official ownCloud client
There are authentication backends such as Shibboleth that do send no Basic Auth credentials for DAV requests. This means that the ownCloud DAV backend would consider these requests coming from an untrusted source and require higher levels of security checks. (e.g. a CSRF check)
While an elegant solution would rely on authenticating via token (so that one can properly ensure that the request came indeed from a trusted client) this is a okay'ish workaround for this problem until we have something more reliable in the authentication code.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/appframework/http/request.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php index 2dc636fcff2..f4cbb6384ba 100644 --- a/lib/private/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -59,6 +59,9 @@ class Request implements \ArrayAccess, \Countable, IRequest { // Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#'; const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#'; + const USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/'; + const USER_AGENT_OWNCLOUD_ANDROID = '/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/'; + const USER_AGENT_OWNCLOUD_DESKTOP = '/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/'; const REGEX_LOCALHOST = '/^(127\.0\.0\.1|localhost)$/'; protected $inputStream; |