Skip to content
XSS Disclosed report Beginner CVE-2023-29489

CVE-2023-29489 XSS in cpanel at [www.███] - Securado, Oman

The cPanel application on the website was not updated because automatic updates were disabled, leaving it vulnerable to a cross-site scripting flaw. An attacker could use a crafted URL to run script in a victim's browser and potentially steal cookies or hijack the session.

rook1337 Follow

Originally disclosed on HackerOne

  • Triaged in 14 hours
  • Fixed in 27 days
  • Disclosed after 30 days

Description: There is a cross-site scripting vulnerability found on cpanel application hosted on the website. Cpanel is not updated because auto update feature is disabled.

Impact

An attacker can steal cookies or hijack browser session.

System Host(s)

www.██████

Affected Product(s) and Version(s)

CVE Numbers

Steps to Reproduce

  1. Go to http://www.████/cpanelwebcall/%3Cimg%20src=x%20onerror=%22prompt(1)%22%3Eaaaaaaaaaaaa
  2. You will see XSS popup message

Suggested Mitigation/Remediation Actions

Enable autoupdate feature and update cpanel

The original report as published on HackerOne, by rook1337. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

This is a medium-severity, reflected cross-site scripting report against a cPanel installation on a U.S. Department of Defence host, disclosed on HackerOne on 9 June 2023. The researcher notes that the cPanel application on the site was not updated because its auto-update feature was disabled.

The affected host is given only as www.██████, and the report leaves the affected product and version fields and the CVE number field empty. The title associates the finding with CVE-2023-29489, but the body of the report does not repeat that identifier or explain the underlying flaw beyond the update state.

The reproduction is a single step. The researcher navigated to the following URL:

HTTP
http://www.████/cpanelwebcall/%3Cimg%20src=x%20onerror=%22prompt(1)%22%3Eaaaaaaaaaaaa

The path segment after /cpanelwebcall/ is a URL-encoded HTML fragment. Decoded, it is an img element whose src is x and whose onerror handler calls prompt(1), followed by a run of a characters. Because the src does not resolve to a valid image, the browser fires the error event and runs the handler. The researcher reports that an XSS popup appeared.

The report does not record a bounty amount, a CVSS score, or a confirmation of a fix. The suggested remediation is to enable the auto-update feature and update cPanel.

Root cause

The report attributes the issue to an out-of-date cPanel installation, with automatic updates turned off. The report attributes the issue to an out-of-date cPanel installation with automatic updates turned off, and does not describe the underlying flaw. The report does not identify the specific code path or the version in which the flaw was introduced or fixed.

Impact

The report states that an attacker can steal cookies or hijack a browser session. That is the standard consequence of script execution in the victim's origin: the injected code runs with the privileges of the site, can read non-HttpOnly cookies, act on the user's behalf against the application, and rewrite the page to phish for credentials. The report does not demonstrate a specific cookie theft or session hijack.

How this kind of bug works

Reflected XSS happens when an application takes data from the request and places it into an HTML response without context-appropriate encoding. The browser cannot tell developer-supplied markup from attacker-supplied markup, so any tag or attribute that arrives in the response is parsed and executed. The classic vectors are event handlers such as onerror and onload, javascript: URLs, and svg elements with script content. The img/onerror pattern used here is popular because it fires without user interaction and survives many naive filters that only look for <script>.

Several defences stop this. Output encoding that matches the sink context (HTML body, attribute, URL, JavaScript string) is the primary control. A restrictive Content-Security-Policy that disallows inline script and unsafe-inline blocks event-handler payloads even when encoding fails. Frameworks that auto-escape by default reduce the chance of the mistake being made at all. On the input side, validation helps but is not a substitute for encoding, since payloads can be encoded in the URL in many ways.

How to test for it

  1. Map endpoints that echo request data into the response: path segments, query parameters, headers that appear in error pages, and redirect or callback parameters. Control-panel and appliance paths such as /cpanelwebcall/ are worth trying because they often sit outside the main application's templating.
  2. Send a benign marker first, for example a unique alphanumeric string, and locate it in the response body. Note the exact context: inside a tag, inside an attribute, inside a script block, or inside a URL.
  3. Choose a payload for that context. For an HTML body, an element with an event handler is a reliable probe. For an attribute, break out of the quoting first. For a script block, close the string and the tag.
  4. Observe whether the browser executes the payload, not just whether the string appears. A popup, a DOM change, or a network request to a listener you control are all valid signals.
  5. Repeat with different encodings (URL encoding, double encoding, mixed case) if a filter appears to strip or rewrite the payload.

Common false positives: the payload appears in the response but is HTML-encoded, so it renders as text; the payload lands in a context where the browser does not execute it, such as inside a comment or a <textarea>; a CSP blocks execution, which means the reflection exists but the exploit does not; or the reflection only occurs in a response the victim cannot be induced to load, such as one requiring a custom header. Always confirm execution in a real browser rather than relying on string matching.

How it is fixed

Apply context-aware output encoding at the point where request data is written into the response. Where the framework supports it, rely on auto-escaping templates and avoid building HTML by string concatenation. Add a Content-Security-Policy that forbids inline script and event handlers. Keep the affected component patched and, as the report recommends, enable automatic updates so that known flaws are closed promptly. For appliances and control panels, verify that auxiliary endpoints share the same encoding discipline as the main application.

Hunting notes

Reflected XSS tends to hide in places that bypass the main templating layer: error pages, search results, redirect endpoints, file-not-found handlers, and vendor-specific paths on appliances and control panels. Version banners and default pages are useful recon signals, because an unpatched or end-of-life component often carries known reflection bugs. When you find a reflection, spend time on the context and on filter behaviour rather than firing many payloads; a single well-chosen payload that executes is worth more than a list of blocked ones.

To make the report accepted, show execution with a minimal proof, state the exact URL and the decoded payload, and describe the realistic attack path: how a victim would be induced to load the URL and what the script could do in their session. If cookies are HttpOnly or a CSP blocks inline script, say so, because that changes the impact and the triager's assessment.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

A security researcher found a bug on a website belonging to the U.S. Department of Defence. The site was running cPanel, a control panel application. The researcher reported the bug on HackerOne, a platform where people report security problems to organisations, on 9 June 2023. The report is rated medium severity.

The bug is a reflected cross-site scripting (XSS) flaw. In plain terms, text supplied in the URL ended up being treated as part of the page. Because the text was written as HTML (the language web pages are made of), the browser treated it as part of the page and ran it as a small program. That is what XSS means: an attacker gets their own code to run inside someone else's website, in that visitor's browser.

The researcher says the cPanel software on the site had not been updated, because the automatic update feature was switched off. The report's title links the finding to CVE-2023-29489, a public identifier for a known security flaw, but the body of the report does not repeat that number or explain the flaw further.

The affected host is written only as www.██████. The report leaves the affected product and version fields empty, and it does not record a bounty amount, a CVSS score (a standard 0 to 10 severity rating) or confirmation that the problem was fixed.

How the researcher proved it

The reproduction is one step. The researcher opened this address in a browser:

HTTP
http://www.████/cpanelwebcall/%3Cimg%20src=x%20onerror=%22prompt(1)%22%3Eaaaaaaaaaaaa

Let us take it apart, because the interesting part is hidden in the encoding. A URL cannot contain spaces or angle brackets directly, so special characters are written as a percent sign followed by two characters. This is called URL encoding. Decoded, the part after /cpanelwebcall/ reads:

Line by line:

  • <img ...> tells the browser to load an image.
  • src=x says the image is at the address x. That address does not exist, so the image fails to load.
  • onerror="prompt(1)" is an event handler: a piece of JavaScript (the programming language browsers run) that the browser executes when the image fails to load. Here it calls prompt(1), which opens a small popup box showing the number 1.
  • aaaaaaaaaaaa is just padding, a harmless string of letters.

The researcher reports that an XSS popup appeared, which is the proof of the bug. The img/onerror trick is popular with testers because it fires on its own, without the visitor clicking anything, and it slips past filters that only look for the word script.

Why does this matter? The report says an attacker can steal cookies or hijack a browser session. A cookie is a small piece of data a website stores in your browser so it can remember who you are, for example that you are logged in. If an attacker can run code on the site's page, that code runs with the site's own permissions and can read cookies that are not marked HttpOnly (a setting that hides a cookie from JavaScript), act as the logged-in user, or rewrite the page to trick the user into typing a password. The report does not demonstrate an actual cookie theft or session hijack.

The suggested fix is simple: enable the automatic update feature and update cPanel.

In general, how this kind of bug works

Reflected XSS happens when a website takes something from the request (the address the browser asks for) and puts it into the page it sends back without encoding it. Encoding means turning characters that have a special meaning in HTML, such as < and >, into harmless text so the browser displays them instead of acting on them. The browser cannot tell which markup came from the website's developers and which came from an attacker, so anything in the response gets parsed and run.

Common payloads use event handlers such as onerror and onload, javascript: links, or svg elements containing script. The img/onerror pattern used here is a favourite because it needs no user interaction.

Several defences stop this:

  1. Output encoding that matches where the data lands: inside the page body, inside an attribute, inside a URL or inside a script block each need different treatment.
  2. A Content-Security-Policy, a set of rules the site sends to the browser saying which scripts may run. One that forbids inline script blocks event-handler payloads even when encoding fails.
  3. Frameworks that escape output automatically by default, so the mistake is less likely to be made.
  4. Input validation, which helps but is no substitute for encoding, because a payload can be encoded in the URL in many ways.

In general, how to test for it

  1. Find places where the site echoes request data back: parts of the path, query parameters, headers shown on error pages, redirect parameters. Control-panel and appliance paths such as /cpanelwebcall/ are worth trying because they often sit outside the main application's templates.
  2. Send a harmless unique marker first, such as a random word, and find it in the response. Note exactly where it lands: in a tag, in an attribute, in a script block or in a URL.
  3. Pick a payload for that context. In the page body, an element with an event handler is a reliable probe. In an attribute, close the quotes first. In a script block, close the string and the tag.
  4. Check whether the browser actually runs the payload, not just whether the text appears. A popup, a change to the page, or a request to a server you control are all valid signals.
  5. If a filter seems to strip or rewrite the payload, try other encodings: URL encoding, double encoding, mixed case.

Watch for false positives: the payload appears but is HTML-encoded and shows as text; it lands somewhere the browser does not execute, such as a comment or a <textarea>; a Content-Security-Policy blocks it, so the reflection exists but the exploit does not; or the reflection only appears in a response a victim cannot be made to load. Always confirm execution in a real browser rather than trusting a text match.

In general, how it is fixed

Apply context-aware output encoding wherever request data is written into a response. Use auto-escaping templates where the framework offers them, and avoid building HTML by gluing strings together. Add a Content-Security-Policy that forbids inline script and event handlers. Keep the affected component patched, and as this report recommends, enable automatic updates so known flaws are closed promptly. For appliances and control panels, check that auxiliary endpoints follow the same encoding rules as the main application.

In general, where to look

Reflected XSS tends to hide where the main templating layer is bypassed: error pages, search results, redirect endpoints, file-not-found handlers, and vendor-specific paths on appliances and control panels. Version banners and default pages are useful clues, because an unpatched or end-of-life component often carries known reflection bugs. When you find a reflection, spend time on the context and the filter behaviour rather than firing many payloads; one well-chosen payload that executes is worth more than a list of blocked ones.

To get a report accepted, show execution with a minimal proof, give the exact URL and the decoded payload, and describe the realistic attack path: how a victim would be made to load the URL and what the script could do in their session. If cookies are HttpOnly or a Content-Security-Policy blocks inline script, say so, because that changes the impact.

Glossary

  • cPanel: control panel software used by hosting customers to manage websites, email and files.
  • Cross-site scripting (XSS): a bug where an attacker's code runs inside another website's page, in a visitor's browser.
  • Reflected XSS: XSS where the malicious input comes from the request and is echoed straight back in the response.
  • HackerOne: a platform where security researchers report bugs to organisations.
  • CVE: a public identifier for a known security flaw.
  • Severity: a rating of how serious a bug is; medium is in the middle of the scale.
  • CVSS: a standard 0 to 10 scoring system for vulnerability severity.
  • URL: the address of a page or resource on the web.
  • URL encoding: writing special characters in a URL as a percent sign plus two characters, so they can travel safely.
  • HTML: the language web pages are written in.
  • JavaScript: the programming language browsers run to make pages interactive.
  • Event handler: code attached to an event, such as an image failing to load, that runs when the event happens.
  • Payload: the piece of code an attacker sends to trigger a bug.
  • Cookie: a small piece of data a site stores in the browser, often to remember a logged-in user.
  • Session: the period a user stays logged in to a site.
  • Session hijack: taking over someone's logged-in session, for example by stealing their cookie.
  • HttpOnly: a cookie setting that stops JavaScript from reading the cookie.
  • Encoding (output encoding): converting characters so the browser displays them as text instead of acting on them.
  • Content-Security-Policy (CSP): rules a site sends to the browser saying which scripts may run.
  • Endpoint: a specific address on a server that handles a request.
  • False positive: a test result that looks like a bug but is not exploitable.
  • Patch: an update that fixes a known flaw.

More by rook1337

View all

3 more disclosed reports, best first.

More from U.S. Dept Of Defense

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.