owncloud / owncloud/core

HTTP status should be 415(Unsupported Media Type) for `MOVE, DELETE, COPY` request with body

Open
#40,252 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:Bug
Dominant language
PHP
Stars
8.8k
Forks
2.1k
Avg merge
20h 7m
Merged PRs (30d)
41

Description

Steps to reproduce
  1. Create user uu1
  2. Create a file test.txt
  3. Send MOVE request for test.txt with the body using curl
curl -ks -u uu1:uu1 -XMOVE -H "DESTINATION: http://localhost/core/remote.php/webdav/test2.txt" --data "doesnotmatter"  http://localhost/core/remote.php/webdav/test.txt

curl -ks -u uu1:uu1 -XMOVE -H "DESTINATION: http://localhost/core/remote.php/dav/files/uu1/test2.txt" --data "doesnotmatter"  http://localhost/core/remote.php/dav/files/uu1/test.txt
Expected behaviour

webDAV DELETE, COPY or MOVE requests should not send a body in the request. If a body is sent, then the server is supposed to return HTTP status 415 (Unsupported Media Type):
https://datatracker.ietf.org/doc/html/rfc4918#section-8.4

In oCIS: HTTP/1.1 415 Unsupported Media Type

Actual behaviour

In oC10: HTTP/1.1 403 Forbidden
https://drone.owncloud.com/owncloud/core/36451/51/13#:~:text=Scenario%3A%20send%20MOVE%20requests%20to%20webDav%20endpoints%20with,470

Server configuration

Operating system: Ubuntu 20.04 LTS

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided curl commands against the WebDAV endpoints and compare the response for MOVE, DELETE, and COPY requests carrying a body. Consult RFC 4918 section 8.4 and trace the request handling until the response status is selected; done means these requests return HTTP 415 Unsupported Media Type rather than 403 Forbidden.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.