Skip to content
File upload Disclosed report Beginner

NextCloud is also Accepting OCTET-STREAM Type of Documents instead of jpg or Imge Files Only

The NextCloud theming background upload accepted a file with an octet-stream content type instead of restricting to image types. An attacker could upload a non-image file, though the report does not show any further exploitation.

rohit_coder Follow

Originally disclosed on HackerOne

  • Disclosed after 19 months

Summary: I noticed that NextCloud is accepting OCTET-STREAM Type of Files Where you have Background/Logo Upload Option. I Believe that NextCloud is Checking for Such Type of Files but i can upload application/octet-stream Type of Documents by Crafting a Special Type of File (In this case i created a .bat file and attached a image into it) and your system accepted that file. Please Check Snapshot for more info.

How to Reproduce

  1. Go to this URL : settings/admin/theming
  2. You will get a option Upload Background PIC
  3. Now open your Chrome Console Network tab to see what type of file is it.
  4. Download my attached file "background.bat" and try to upload it there
  5. File will be accepted by NextCloud and you can see type of file is OCTET-STREAM in Networks tab of Chrome Console

Attachments

Background.bat
Background.bat From the original on HackerOne
Networks_Snap.PNG
Networks_Snap.PNG

The original report as published on HackerOne, by rohit_coder. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the upload validation checks only the declared content type or file extension and does not properly verify that the file is a real image.

Impact

An attacker with access to the theming settings could upload a non-image file, but the report does not demonstrate any code execution or other harm.

What the attacker needed

Access to admin theming settings

The fix

The upload should verify the file is a genuine image rather than accepting octet-stream files.

How it was found

  1. Go to the admin theming settings page.
  2. Find the background picture upload option.
  3. Open the browser's network tab to observe the file type.
  4. Upload a crafted batch file with an image attached.
  5. The file is accepted and shown as octet-stream in the network tab.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you upload a file, the server checks its type. Here, the server allowed a file that was not an image, such as a batch file disguised with an image attached. This is a problem because servers should only accept the file types they expect.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.