Stored XSS in Gallery application (NC-SA-2017-010)
A JavaScript sanitisation library used by Nextcloud had a cross-site scripting flaw triggered by a behaviour change in Safari 10.1 and 10.2. An attacker could inject script through untrusted input, but Nextcloud's strict Content-Security-Policy prevented exploitation on modern browsers.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 17 days
- Disclosed after 46 days
Summary by the program
#Stored XSS in Gallery application (NC-SA-2017-010)
Risk level: Low CVSS v3 Base Score: 3 (AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:N/A:N) CWE: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
#Description A JavaScript library used by Nextcloud for sanitizing untrusted user-input suffered from a XSS vulnerability caused by a behaviour change in Safari 10.1 and 10.2.
Note that Nextcloud employs a strict Content-Security-Policy preventing exploitation of this XSS issue on modern web browsers.
#Affected Software
- Nextcloud Server < 11.0.3 (CVE-2017-0893)
- Nextcloud Server < 10.0.5 (CVE-2017-0893)
- Nextcloud Server < 9.0.58 (CVE-2017-0893)
#Action Taken The vulnerable library has been updated.
#Acknowledgements The Nextcloud team thanks the following people for their research and responsible disclosure of the above advisory:
- Lukas Reschke - Nextcloud GmbH ([email protected]) - Vulnerability discovery and disclosure.
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 sanitisation library did not account for a parsing behaviour change in Safari 10.1 and 10.2, allowing script to survive sanitisation.
Impact
Exploitation was limited because Nextcloud's strict Content-Security-Policy blocked the XSS on modern browsers, and the advisory rates the risk as low.
What the attacker needed
Safari 10.1 or 10.2 behaviour; untrusted user input
The fix
The vulnerable library was updated.
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.
Cross-site scripting (XSS) is when a website shows user-supplied content without properly neutralising it, so an attacker can sneak in code that runs in a victim's browser. Here, a library meant to clean that content failed on certain Safari versions. However, a security feature called Content-Security-Policy (CSP) stopped the code from actually running in modern browsers.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.