Skip to content

Renaming a resource to banned name is allowed #1295

Closed

Description

@haribhandari07

Description

Renaming a file or folder to the banned name for eg; \name is not forbidden

Steps to reproduce:

  1. upload a file curl -X PUT -uadmin:admin -k https://localhost:9200/remote.php/webdav/file1.txt -d"123"
  2. rename the file curl -X MOVE -uadmin:admin -k https://localhost:9200/remote.php/webdav/file1.txt -H "Destination: https://localhost:9200/remote.php/webdav/\file1.txt" -v
  3. list files: curl -X PROPFIND -uadmin:admin -k https://localhost:9200/remote.php/webdav | xmllint --format -

a file with the name <d:href>/remote.php/webdav/%5cfile1.txt</d:href> is listed

It's also possible to upload a file with that name:
curl -X PUT -uadmin:admin -k https://localhost:9200/remote.php/webdav/%5cfile2.txt -d"123"

The same behavior is noticed for the folder.

Activity

  1. individual-it commented on Jun 18, 2020

    @individual-it
    Member

    on EOS storage the renaming does not work, but the return code is 500 and not 400 as it should be

  2. transferred this issue fromowncloud/ocis-revaon Jan 18, 2021
  3. refs commented on Jan 18, 2021

    @refs
    Contributor

    confirm it still occurs with the latest master.

  4. added
    Category:Defect
    on Jan 18, 2021
  5. pascalwengerter commented on Jun 10, 2021

    @pascalwengerter
    Contributor

    Where is a banned name configured?

  6. individual-it commented on Jun 11, 2021

    @individual-it
    Member

    I think the thought is that filenames with a \ will get us into trouble on windows systems
    I've updated the original post to make it easier to reproduce.
    also web happily uploads a file with a \ in its name, but it cannot download such a file again

    If a \ is a legal character in a files name then the issue needs to be moved to web, if not creating such files need to be prevented

  7. phil-davis commented on Jul 30, 2021

    @phil-davis
    Contributor

    Fixed by cs3org/reva#1900
    And by the reva update to OCIS: #2334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Category:DefectType:Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions