Skip to content
XSS Disclosed report Beginner

Arbitrary File Upload in Logo & Log in image Theming setting.

The logo and login image upload features accepted HTML files and served them as HTML, so an attacker could upload a malicious HTML file that executes in a victim's browser. The reporter also noted that PHP files were uploaded but executed as text, limiting the impact.

bastianwelfrid Follow

Originally disclosed on HackerOne

  • Triaged in 10 hours
  • Fixed in 36 days
  • Disclosed after 2 months

Hi team

First I think this vulnerability doesn't fall at your bug bounty program but this is a bad design that should fix right now cause if an attacker get admin access he still can upload a malicious file in client server side.

I saw that Logo & Log in image allow to upload other files type example *.html and it'll execute in client server. Other case,I created an html code and saved it as image file,server still executed it as html file. The Logo & Log in image will upload it into ../data/themedinstancelogo & ../data/themedbackgroundlogo

Good news,I tried to upload an php file but server executed that file as text.

PoC: Upload an html file through logo upload and Log in image and you will see that file will execute.

http://example.com/nextcloud/data/themedinstancelogo http://example.com/nextcloud/data/themedbackgroundlogo

Regards,

Attachments

nc.png
nc.png From the original on HackerOne

The original report as published on HackerOne, by bastianwelfrid. 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 feature validated only the file extension and did not restrict or sanitise HTML content, and the uploaded files were served from a directory that executes HTML.

Impact

An attacker with admin access could upload an HTML file that executes in the browser of anyone who views it, but PHP files were executed as text, so server-side code execution was not achieved.

What the attacker needed

Admin access to the theming settings

The fix

The reporter says the bad design should be fixed, without specifying how.

How it was found

  1. Upload an HTML file through the logo upload or login image upload.
  2. Open the uploaded file at the themed logo or background logo path to see it execute as HTML.

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.

A website lets administrators upload a custom logo and login background image. The upload accepted an HTML file, and the server served it as HTML, so a browser would run any code in it.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by bastianwelfrid

View all

1 more disclosed report, best first.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.