As Alfred mentioned, it looks like there’s a fix in 10.13.1, implemented by including a check for an empty signing-key in lib/private/Security/SignedUrl/Verifier.php.
I’ve added this to Verifier.php on our installation (v10.8), and everything looks like it’s still working (so far…), but I was wondering whether anyone knew of a way to test the fix using CURL (or similar)?
I tried the following, but it gives the same result whether the fix is in place or not:
curl -X PROPFIND -H “Depth: 1” “https://server.domain.com/remote.php/dav/files/userid?OC-Credential=userid&OC-Verb=GET&OC-Signature=f9e53a1ee23caef10f72ec392c1b537317491b687bfdd224c782be197d9ca2b6”
Gives
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d=“DAV:” xmlns:s=“sabre/dav”>
<s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
<s:message>No public access to this resource., No ‘Authorization: Basic’ header found. Either the client didn’t send one, or the server is misconfigured, Invalid url signature</s:message>
</d:error>
The same URL (minus query parameters) works with curl -u userid, which suggests I’m getting something wrong with the query parameters.
Is there any documentation covering the use of pre-signed keys with the webdav API? I found an introduction to webdav here, but couldn’t see anything about using pre-signed keys.
Working back from the code in Verifier.php, it looks like each user would need to have an entry in oc_preferences with appid=‘core’ and configkey=‘signing-key’, but I wasn’t sure what format configvalue would take? Is it similar to an RSA private key? Is it something users could add themselves via the WebUI, or something admins could generate for them via occ, or by directly creating entries in oc_preferences?
Once a user has a signing-key, how would it be used? Are keys passed directly as the OC-Signature query parameter, or (as the name suggests) are they used to sign something else? In other words, what would someone need to share with a third party in order for the third party to use a pre-signed URL?
If we did generate signing-keys for all our users, would that have any implications for existing client connections (desktop sync client, etc - presumably not since they’re using password authentication?)
Many thanks