Skip to content
XSS Disclosed report Beginner CVE-2019-15618

[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.

nstikhomirov Follow

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

Screenshot_2.png
Screenshot_2.png From the original on HackerOne

The original report as published on HackerOne, by nstikhomirov. 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

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

  1. Send a POST request to the updater's index.php with extra content appended to the path.
  2. Include the updater secret in the form body.
  3. 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.

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.