owncloud / owncloud/core

[QA] more errors with extra slashes in URI

Open
#40,341 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Seen while testing https://github.com/owncloud/core/issues/34365 with 10.11.0-beta.1

The following cases are fixed since #40216:

  • curl -u admin:admin http://localhost//remote.php//dav/files/admin/test.txt # double slashes at start
  • curl -u admin:admin http://localhost//remote.php//dav//files//admin//test.txt # double slashes everywhere
  • curl -u admin:admin http://localhost////remote.php//dav/files/admin/test.txt # many slashes at start

This still explodes

  • curl -u admin:admin http://localhost/remote.php///dav/files/admin/test.txt # many slashes after remote.php
< HTTP/1.1 500 Internal Server Error
< Date: Tue, 06 Sep 2022 07:17:11 GMT
< Server: Apache/2.4.41 (Ubuntu)
...
< Content-Length: 270
< Connection: close
< Content-Type: application/xml; charset=utf-8
< 
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>LogicException</s:exception>
  <s:message>Requested uri (/remote.php///dav/files/admin/test.txt) is out of base uri (/remote.php/dav/)</s:message>
</d:error>

Expected behaviour:

  • redundant slashes are harmless.

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

Start by reproducing the failing curl request against /remote.php///dav/files/admin/test.txt and compare it with the cases fixed by #40216. Trace how the remote.php and DAV base URIs are parsed, then verify that redundant slashes after remote.php no longer produce a 500 response and that the existing cases remain working.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.