Skip to content
XSS Disclosed report Beginner

Persistent XSS on favorite via filename

A file's name is echoed without encoding when a user adds it to favourites, leading to persistent cross-site scripting. An attacker could run script in the victim's browser and access data or make requests as that user.

foobar7 Follow

Originally disclosed on HackerOne

  • Triaged in 45 hours
  • Fixed in 3 months
  • Disclosed after 3 months

CVSS

Medium 6.4 CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N

Description

The name of a file is echoed without encoding when favoring the file, leading to persistent XSS.

POC

To place the payload:

  • Create a file called test'"><img src=x onerror=alert(document.location)>.pdf and upload it.

To trigger the payload:

  • click on ... next to the file followed by "add to favorites". The payload will trigger here.

Impact

With a successful attack, an attacker can access all data the attacked user has access to, as well as perform arbitrary requests in the name of the attacked user.

The original report as published on HackerOne, by foobar7. 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 application inserts the uploaded filename into the favourites page HTML without output encoding.

Impact

An attacker could access all data the victim can access and perform arbitrary requests as the victim; the report does not mention any defence limiting this.

What the attacker needed

Ability to upload a file; victim views the favourites list

How it was found

  1. Create a file whose name contains an HTML image tag with an error handler.
  2. Upload the file.
  3. Click the menu next to the file and choose add to favourites.
  4. The script runs when the favourites view renders the filename.

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, its name is shown on the page. The site put the name into the page without escaping special characters, so a name containing HTML code runs as a script. That lets an attacker act as the logged-in user who views the favourites list.

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 foobar7

View all

17 more disclosed reports, 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.