Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WebDAV: enforce ACL on the public directory and on temporary files
Security fix
sabre's
TemporaryFileFilterPluginstores the junk files desktop clients write next to real ones (.DS_Store,Thumbs.db,._*,*.swp, …) outside the DAV tree. Because those files never exist in the tree, the ACL plugin never checked anything for them: anybody, authenticated or not, couldPUT,GETandDELETEsuch files under any path.DavisTemporaryFileFilterPluginnow applies the privileges of the directory the file would live in (bindforPUT,unbindforDELETE,readotherwise), exactly like a real file. Anonymous requests get a401, unprivileged users a403, and no temporary file is written.Behaviour change: who can write to
/dav/publicThe public directory is now mounted as
\Sabre\DAVACL\FS\Collectionwith an explicit ACL:WEBDAV_PUBLIC_DIR_WRITABLE=trueopens it to every authenticated user.Important
Up to 5.4 the public directory fell under sabre's default ACL, which granted every authenticated user
{DAV:}all. Deployments that use it as a shared drop folder must setWEBDAV_PUBLIC_DIR_WRITABLE=truewhen upgrading, otherwise regular users get a403when saving. The Diagnostics page shows which policy isactive.
Stricter directory checks
WEBDAV_TMP_DIR,WEBDAV_PUBLIC_DIRandWEBDAV_HOMES_DIRmust:Davis refuses to start the DAV server otherwise, with a message naming the variable.
Other changes
$server->httpResponse(status, headers, body) instead of only patchingContent-Type. Plugins that short-circuit a request frombeforeMethod(the temporary file filter does) never reachSapi::sendResponse, so their status and headers were previously lost.\Sabre\DAVACL\FS\CollectionextendsFSExt\Directory: the public dir gains fastMOVE, inode-based ETags,PATCHpartial updates, and rejects./..children..envanddocker/.envdocument the new variable and the upgrade path.Tests
New
tests/Functional/WebDavTest.php(enables WebDAV with throw-away directories):PUT/GET/DELETEof temporary files are refused and nothing is written;WEBDAV_PUBLIC_DIR_WRITABLE=trueopens it;Content-Type,WWW-Authenticate) survive the conversion to a Symfony response.requestDav()moved to a sharedDavRequestTrait.