[Reflected XSS] In Request URL
The Nextcloud updater page echoed the request URL into an anchor's href attribute without HTML encoding, so a crafted path containing a quote and a script tag broke out of the attribute. An attacker who knows the updater secret could get script to run in the page.
Originally disclosed on HackerOne
- Triaged in 3 hours
- Fixed in 5 hours
- Paid in 5 hours
- Disclosed after 11 months
In index.php file on 1765 we can see XSS:
<a class="button" href="<?php echo str_replace('/index.php', '/../', $updaterUrl); ?>">
Because NextCloud allow links like: '/index.php/{ANY_CONTENT}'
If we will do request like:
POST /updater/index.php/h"><script>alert(1);</script> HTTP/1.1
Host: vulns.local
Content-Type: application/x-www-form-urlencoded
Content-Length: 33
updater-secret-input={OUR_SECRET}
We will see Reflected XSS: F452129
To fix this vulnerability need to patch <a class="button" href="<?php echo str_replace('/index.php', '/../', $updaterUrl); ?>"> to <a class="button" href="<?php echo htmlspecialchars(str_replace('/index.php', '/../', $updaterUrl), ENT_QUOTES); ?>">
Impact
If the attacker knows the secret phrase, then they can implode illegitimate html code in page
Attachments

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
The updater URL taken from the request path was written into an HTML attribute without output encoding, so quote characters in the path could close the attribute and inject markup.
Impact
If the attacker knows the secret phrase, they could inject arbitrary HTML and script into the page.
What the attacker needed
Knowledge of the updater secret; attacker can send a crafted request
The fix
The output should be encoded with htmlspecialchars using ENT_QUOTES before being placed in the href attribute.
How it was found
- Send a POST request to the updater's index.php with extra content appended to the path.
- Include the updater secret in the form body.
- Observe the injected script reflected in the response page.
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 web page sometimes puts part of the address you typed back into its own HTML. If it does that without escaping special characters, you can slip in your own HTML or script, and the browser runs it as if the site wrote it. This is called reflected cross-site scripting, because the malicious input is reflected straight back in the response.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.