Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2021-12-06 17:17:08 +0300
committerJohn Molakvoæ <skjnldsv@protonmail.com>2021-12-07 11:40:23 +0300
commit5223b0b6112defe682aafcddeda951b5461c95c8 (patch)
tree75a286a12f01e1130ce3d793416817a1a4a92ea3 /apps/dav/lib/Connector
parent4ed014ca86892498c585cf28603c768db86b7e71 (diff)
Prevent writing invalid mtime
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/dav/lib/Connector')
-rw-r--r--apps/dav/lib/Connector/Sabre/Node.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Node.php b/apps/dav/lib/Connector/Sabre/Node.php
index 7f7299296c6..0fc8a441277 100644
--- a/apps/dav/lib/Connector/Sabre/Node.php
+++ b/apps/dav/lib/Connector/Sabre/Node.php
@@ -412,6 +412,11 @@ abstract class Node implements \Sabre\DAV\INode {
throw new \InvalidArgumentException('X-OC-MTime header must be an integer (unix timestamp).');
}
+ // Prevent writing invalid mtime (timezone-proof)
+ if ((int)$mtimeFromRequest <= 24 * 60 * 60) {
+ throw new \InvalidArgumentException('X-OC-MTime header must be a valid positive integer');
+ }
+
return (int)$mtimeFromRequest;
}
}