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.
- 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)>.pdfand 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.
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
- Create a file whose name contains an HTML image tag with an error handler.
- Upload the file.
- Click the menu next to the file and choose add to favourites.
- 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.