-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Soften the cookie check if no cookies are sent #110
Soften the cookie check if no cookies are sent #110
Conversation
When no cookies are sent it is not required to perform any check for the strict or lax cookie, it does not provide any significant security advantage. It does however interfer with the Android client which requests thumbnails from the unofficial API at `/index.php/apps/files/api/v1/thumbnail/256/256/{filename}`. This endpoint expects the strict cookie to be existent to not leak the existence of files. The Android client authenticates against this endpoint using Basic Auth and without cookies in some cases at least. This will make these endpoints work again with such cases. To test this issue the following cURL command once without the patch and once with: > curl http://localhost/index.php/apps/files/api/v1/thumbnail/256/256/welcome.txt -u admin -v Without the patch the request is redirected (which the client does not obey) and with the patch the preview is returned.
Tested, works and code looks good 👍 |
My wife has the issue, gonne apply it on production 👷 and report back |
I am still seeing 503s:
|
Earlier today, @LukasReschke and I debugged this a bit. DavDroid just does not sent back the sameSite cookies as required by the server, ending up with the 503s. |
@LukasReschke I have created a PR for this on Android: nextcloud/android#37 |
Let's merge this for now and debug the DAVDroid problem independently. LGTM |
This fixed the Issue for me, too. |
When no cookies are sent it is not required to perform any check for the strict or lax cookie, it does not provide any significant security advantage.
It does however interfer with the Android client which requests thumbnails from the unofficial API at
/index.php/apps/files/api/v1/thumbnail/256/256/{filename}
. This endpoint expects the strict cookie to be existent to not leak the existence of files. The Android client authenticates against this endpoint using Basic Auth and without cookies in some cases at least. This will make these endpoints work again with such cases.To test this issue the following cURL command once without the patch and once with:
Without the patch the request is redirected (which the client does not obey) and with the patch the preview is returned.
Fixes #101
@nextcloud/android Any chance that meanwhile we can push a hotfix to the Android app that sends the cookies
nc_sameSiteCookielax
andnc_sameSiteCookiestrict
with the value oftrue
to all preview API requests? (or just to all). We can remove this patch later then but in the meanwhile users wouldn't have this bug 😉