0
CORS middleware skips the CSRF protection based on a session flag instead of the request's credentials
Source: nextcloud/server#67446 · opened by @susnux
Description #[CORS] routes may only be used with a CSRF token or with credentials sent in the request (basic auth), because otherwise cookie-based sessions could be used cross-site. The CORSMiddleware logs out session-authenticated requests and requires basic auth — except when the session has the app_api flag set: This decision is based on persistent session state, not on credentials validated in the current request. For AppAPI requests that is fine as long as such sessions are never tied to a browser cookie, but it is an implicit assumption, and there are proposals to reuse the same flag for other token-based logins (e.g. OIDC bearer tokens, see #55878 and nextcloud/user_oidc#1221). If a session carrying such a flag is ever reused by a browser (cookie), #[CORS] routes would be usable cross-site without CSRF protection for that session. Expected behavior The CORS/CSRF exception is based on how the current request was authenticated (e.g. a request attribute set by the authenti…
No pledges yet. Be the first to back this.
Comments
Similar requests
CORS origin allowed list check
1 vote · 0 comments
Soften the brute force protection on shared links with password or without
3 votes · 0 comments
CORS support in login v2 and OAuth2 flow
2 votes · 0 comments
Support AWS STS (AWS_SESSION_TOKEN) for S3 Object Storage
2 votes · 0 comments
Password protected public link shares : time to improve password protection UI to avoid a trap that many users fall into
3 votes · 0 comments
No comments yet.