nextcloud / nextcloud/server

[Bug]: Undetermined meaning of "mimetype" in Flows

Open
#43,550 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 29-feedback bug feature: workflows
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

Meaning of mimetype in not determined and not documented.

  • In some cases mimetype is defined by filename (extension)
  • In other cases, it is defined by file content
Steps to reproduce
  1. Using files_accesscontrol flow, block images by mime-type
  2. Having a local image file, for example, image.png, rename it to image.notpng
  3. Upload the image on the server (success)
  4. Remove the image from the server (blocked)

As a result, it is possible to upload a file that is not possible to delete due to block from files_accesscontrol.

Expected behavior

If mimetype is determined by file content, uploading an image should not have been allowed even it has extension .notpng.

If mimetype is determined by filename (extension), it should be allowed to delete the uploaded file because it has a non-image extension.

If this is expected behavior, it should be documented.

Nextcloud Server 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

Start with the files_accesscontrol flow and reproduce the renamed-image scenario described in the issue. Trace how mimetype is determined during upload and deletion, then establish whether the behavior is based on the filename or file content. Done means the behavior is consistent or its precise meaning is documented.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.