Skip to content
XSS Disclosed report Intermediate

Stored XSS / Bypassing .htaccess protection in http://nodebb.ubnt.com/

The NodeBB instance was exposed on an unprotected port despite .htaccess protection on the standard port. An attacker could upload a file with an HTML extension containing malicious HTML in EXIF data, leading to stored XSS when the file is served.

inhibitor181 Follow

Originally disclosed on HackerOne

  • Triaged in 25 hours
  • Fixed in 25 hours
  • Paid in 25 hours
  • Disclosed after 8 months

Hello,

While I was looking at your renewn SSL certificated, I have noticed the following link : http://nodebb.ubnt.com/

I have seen that this link was protected by htaccess password, but I have decided to run a nmap scan. By running the following :

sudo nmap -sSV -p- 104.131.159.88 -oA stage_ph -T4

one of the open ports was this : 4567/tcp open tram?

And, to my surprise the ip 104.131.159.88:4567, as well as http://nodebb.ubnt.com:4567/ were available from internet and unprotected.

Here, I have found a nodeBB instance and I have managed to create a persisted XSS by using the upload API, that does not properly sanitize the file names and automatically sets wrong mime types.

Normally, it seems that the user is allowed to upload only images, but the stored XSS was possible by injecting malicious html in the exif data and changing the file name to .html.

I have attached a video with the POC, as well as the exif image.

I have not managed to RCE, but it is also worth noting that uploading the file with the .php extension and writing php content using exif IS possible.

Attachments

exif.jpg
exif.jpg From the original on HackerOne

The original report as published on HackerOne, by inhibitor181. 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 API did not properly validate file extensions and MIME types, allowing HTML files to be served with a content type that enables script execution.

Impact

An attacker could run injected HTML/JavaScript in the context of the NodeBB site via the uploaded file.

What the attacker needed

Access to the upload API; ability to upload files

The fix

The upload API should sanitise file names and set correct MIME types so HTML files are not served as executable content.

How it was found

  1. Scan the target IP to find open ports.
  2. Access the NodeBB instance on the discovered open port.
  3. Use the upload API to upload a file with an HTML extension containing malicious HTML in EXIF data.
  4. The uploaded file results in stored XSS when accessed.

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.

The website had a hidden door (an open port) that bypassed its password protection. The file upload feature let people upload files that the browser would treat as web pages, and those files could contain harmful code. When someone opened such a file, the code would run in their browser, which is called stored cross-site scripting (XSS).

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 inhibitor181

View all

10 more disclosed reports, best first.

More from Ubiquiti Inc.

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.