aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-03-13 12:04:30 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-03-13 12:04:30 +0100
commitfa63e646d4bb78609d5cc6eaa06a94804d34f5f1 (patch)
treee347156c54fea76f8d9842f590842e6f60de120d /apps
parent9dea6185ada1f9f891f2c64d256551c6ad171d29 (diff)
downloadnextcloud-server-fix/dav-csrf.tar.gz
nextcloud-server-fix/dav-csrf.zip
fix(dav): do not require CSRF for safe and indempotent HTTP methodsfix/dav-csrf
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/Auth.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Auth.php b/apps/dav/lib/Connector/Sabre/Auth.php
index 1d509d0d6f2..d977721bdfa 100644
--- a/apps/dav/lib/Connector/Sabre/Auth.php
+++ b/apps/dav/lib/Connector/Sabre/Auth.php
@@ -118,8 +118,9 @@ class Auth extends AbstractBasic {
* Checks whether a CSRF check is required on the request
*/
private function requiresCSRFCheck(): bool {
- // GET requires no check at all
- if ($this->request->getMethod() === 'GET') {
+
+ $methodsWithoutCsrf = ['GET', 'HEAD', 'OPTIONS'];
+ if (in_array($this->request->getMethod(), $methodsWithoutCsrf)) {
return false;
}