nextcloud / nextcloud/files_accesscontrol

Inconsistent behavior when uploading to external storage root vs sub directory

Open
#605 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
PHP
Stars
60
Forks
22
Avg merge
2d 11h
Merged PRs (30d)
34

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
Preparation (one time)
  1. Configure a file access rule to block uploads above 5 Mb
  2. Ensure that chunked upload is enabled: occ config:app:delete files max_chunk_size
  3. Add an external S3 storage.
  4. Create a sub directory inside the external storage.
Case 1 (correct)
  1. Upload a big file directly to the external storage's root folder.
  2. Observe that the upload is blocked after all chunks were uploaded (error on assembly).
Case 2 (broken)
  1. Upload a big file to the sub directory inside the external store.
  2. Observe that the upload is blocked immediately when starting the first chunk.
Expected behavior

Case 1 is behaving as expected. Case 2 is not behaving as expected. The upload should be blocked after assembly in both cases.

Actual behavior

The upload is blocked immediately in case 2 instead of postponing the check until the whole file is available like in case 1.

Server configuration

Web server: Apache (Content-Length fix is applied)

PHP version: 8.1

Nextcloud version: master

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 both cases with chunked uploads, the 5 MB access rule, and an external S3 storage, using the documented occ configuration command. Trace how access control handles uploads at the external-storage root versus a subdirectory and how chunk assembly is reached. Done means both paths defer the size check until assembly, with regression coverage for the difference.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.