Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous users can unlock a file shared to them through a public link if they get the lock token #7761

Open
SwikritiT opened this issue Nov 20, 2023 · 0 comments
Labels

Comments

@SwikritiT
Copy link
Contributor

SwikritiT commented Nov 20, 2023

Describe the bug

Public can unlock a file shared to them through a public link if they get the lock token.

Steps to reproduce

  1. As user einstein creates a file hello/newtest.txt
  2. As user einstein create a public link of folder hello with all permission
  3. As user einstein Lock the file newtest.txt
 curl -ueinstein:relativity -XLOCK "https://localhost:9200/remote.php/dav/files/einstein/hello/newtest.txt" -H "Content-Type: application/json" -d"<?xml version='1.0' encoding='UTF-8'?><d:lockinfo xmlns:d='DAV:'><d:lockscope><d:exclusive/></d:lockscope></d:lockinfo>" -vk 
  1. As anonymous user try to Unlock te file with token from Einstein user
curl -XUNLOCK 'https://localhost:9200/remote.php/dav/public-files/<public-link-token>/newtest.txt' \
--header 'Lock-Token: <lock-token>' -upublic:#Passw0rd -vk

Expected behavior

Even though the anonymous user has the Lock token they should not be able to unlock the file. The server should throw some appropriate status code and error message.

Actual behavior

The anonymous user can unlock the file.

curl --location --request UNLOCK 'https://localhost:9200/remote.php/dav/public-files/EcQTKexBySBoGPd/newtest.txt' \
--header 'Lock-Token: urn:uuid:e7f7f8b1-c2d7-41c1-93c9-ee9f90ae5189' -upublic:#Passw0rd -vk
*   Trying 127.0.0.1:9200...
* Connected to localhost (127.0.0.1) port 9200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.2 (OUT), TLS header, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: O=Acme Corp; CN=OCIS
*  start date: Nov 20 10:41:12 2023 GMT
*  expire date: Nov 19 10:41:12 2024 GMT
*  issuer: O=Acme Corp; CN=OCIS
*  SSL certificate verify result: self-signed certificate (18), continuing anyway.
* Server auth using Basic with user 'public'
* TLSv1.2 (OUT), TLS header, Supplemental data (23):
> UNLOCK /remote.php/dav/public-files/EcQTKexBySBoGPd/newtest.txt HTTP/1.1
> Host: localhost:9200
> Authorization: Basic cHVibGljOiNQYXNzdzByZA==
> User-Agent: curl/7.81.0
> Accept: */*
> Lock-Token: urn:uuid:e7f7f8b1-c2d7-41c1-93c9-ee9f90ae5189
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 204 No Content
< Access-Control-Allow-Origin: *
< Content-Security-Policy: default-src 'none';
< Date: Mon, 20 Nov 2023 11:07:37 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: swikriti-OptiPlex-3070/lvJs9WE2WD-005643
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 
* Connection #0 to host localhost left intact

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

OCIS_COMMITID=5c8c29ca0e80ec4ea65c9f904100ad0c2b89c9da

@SwikritiT SwikritiT changed the title Public can unlock a file if they get the lock token Anonymous users can unlock a file shared to them through the a link if they get the lock token Nov 20, 2023
@SwikritiT SwikritiT changed the title Anonymous users can unlock a file shared to them through the a link if they get the lock token Anonymous users can unlock a file shared to them through a public link if they get the lock token Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant