-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.18.1 NC's own 'oc...' cookie causes a 503 error on dav requests #870
Comments
We don't actualy set any cookies - this is all done automatically by the request client. Cookies are provided by Nextcloud and ownCloud, which are set automatically it seems.. these, once sent back, seem to confuse Nextcloud and ownCloud as to whether or not to treat the request as a user session or not. At least this is what it's been looking like the more we hear about Nextcloud/ownCloud auth issues. A related problem to this is the user-account stickiness which occurs after an initial request: buttercup/buttercup-mobile#127 (no info here though sorry). We use axios in the webdav client, so this issue is very relevant I feel. I think following this would probably help: perry-mitchell/webdav-client#183 (comment) Perhaps we need to add support for this in Buttercup so that all requests are made like this.. |
Yes, you are right, I was fiddling with your source code (not a programmer) and was trying to see how I could get to the chromium instance and manage its cookies. If you remove the NB: the cookies are useless, it's only the |
The fixExempt the UA used by buttercup from Nextcloud's Same Site Cookie Protection by adding this to your NC's 'csrf.optout' => array(
'/^WebDAVFS/', // comes with NC, apparently for OS X Finder
'/^Microsoft-WebDAV-MiniRedir/', // whatever, still comes with NC
'/Electron/', // buttercup-desktop uses Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.99 Electron/7.1.1 Safari/537.36
), The rantIt is Nextcloud freaking out about the result of its own set-cookie requests which Chromium/Electron is following. Furthermore, NC developers seem to adhere to some HTTP specs regarding Same Site Cookie Protection – for everything, including webdav connections – and proceed to bitch about it in their sample config: 'Some user agents are notorious and don't really properly follow HTTP specifications'. I for one have no clue what the HTTP specifications for SSCP/csrf are, nor do I understand why it needs to apply to webdav clients which use basic http auth anwyay. I guess one day I'll learn. |
@working-name Thanks for sharing this. They do indeed have a weird process over at NC regarding auth. WebDAV requests should care about nothing other than the We've been looking at our WebDAV client and so far haven't figured out a nice way to remove the cookies before making a request from within a browser. |
Any updates on this? Are there any security issues with Buttercup 1.16.2 in the meantime? Thanks. |
I missed that comment by sallar. I feel better about downgrading now too. |
See also #947 which I opened before realising this issue had already been reported and tracked down. I do think the error messages/logging from Buttercup could be a bit more informative even if the underlying issue gets addressed. I don't believe Nextcloud is wrong here to be applying CSRF protection to webdav, the fact that it's protected by BASIC auth has nothing to do with what CSRF is trying to prevent. The CSRF token isn't about verifying authorisation and Nextcloud is not using it in this way, it's about preventing replay and cross-site attacks using the existing valid session. By repeatedly sending the same stale token back you're triggering the protection mechanism, it's functioning as intended. The problem here is more likely to be the way the webdav requests are being made, I'll need to do some digging through the code. |
What's up guys? I've been fiddling with your software, trying to move from a competitor platform. Anyway short story long 😁...
Problem:
The desktop client (macOS here) sends cookies when requesting the
.bcup
from nextcloud (webdav). They're not used in authentication or verification thereof, so I'm not sure why they're included. I guess for future stuff, but either way, the cookie header contains;
which apparently throws off apache or nextcloud. I can't figure out which because they log nothing interesting with debug on.Proposals:
Authorization
header.Things I tried:
;
afteroc_sessionPassphrase=
but leave theoc7ozabxv4ks=...
alone - ✅;oc7ozabxv4ks=...
- ✅oc7ozabxv4ks=...
only, but leave;
afteroc_sessionPassphrase=
- ✅cookie
header altogether - ✅;
beforeoc_sessionPassphrase
after removing;oc7ozabxv4ks=...
- ✅oc7ozabxv4ks=...
beforeoc_sessionPassphrase=
but remove;
afteroc_sessionPassphrase
- ❌oc7ozabxv4ks=...
alone - ❌So my working theory is that NC reacts to that randomly named cookie and its value. I can't find its reaction in its own logs yet.
Details:
Server: apache2 + php7.3-fpm serving nextcloud via http (ubuntu 18), behind nginx proxy with http2 via https (debian 10)
Client: Buttercup 1.18.1 on macOS 10.14.4, or Paw duplicating the request made by Buttercup
Potentially related issues: 117,#780, #817, #833, #825
Worth nothing
The text was updated successfully, but these errors were encountered: