Skip to content
XSS Disclosed report Beginner

XSS in https://affiliates.kromtech.com

A reflected cross-site scripting flaw existed in the URL path of an affiliates site, where a crafted path segment was rendered into the page without proper encoding. An attacker could send a victim a crafted link that runs script in the site's context.

kphaks Follow

Originally disclosed on HackerOne

Bounty$300 Medium 4.2 View original
  • Triaged in 3 hours
  • Fixed in 3 days
  • Paid in 3 days
  • Disclosed after 6 months

Summary by the program

Summary

XSS in https://affiliates.kromtech.com

Vulnerable URL: https://affiliates.kromtech.com/monetize-mac-traffic/adgroup/affiliatefixhello%22%3E<img src%3da onerror%3dalert(document.domain)>hello/type/affiliate

Vulnerable Parameter: "URL Path"

XSS Payload: hello"><img src%3da onerror%3dalert(document.domain)>hello

Steps To Reproduce:

Navigate to the Vulnerable URL Notice the pop-up Supporting Material/References: Attached ScreenShot

The original report as published on HackerOne, by kphaks. 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. 4 min read.

What the report shows

The target is the affiliate portal at affiliates.kromtech.com, part of the Clario program on HackerOne, with the wildcard asset *.kromtech.com in scope. The researcher, kphaks, reported a reflected cross-site scripting issue in a URL path segment. The report was rated medium severity with a CVSS score of 4.2, classified as reflected XSS, and paid a bounty of 300.00 USD. It was disclosed on 2020-05-25.

The vulnerable URL is given in full:

Text
https://affiliates.kromtech.com/monetize-mac-traffic/adgroup/affiliatefixhello%22%3E<img src%3da onerror%3dalert(document.domain)>hello/type/affiliate

The vulnerable parameter is described as the "URL Path". The payload embedded in that path is:

Text
hello"><img src%3da onerror%3dalert(document.domain)>hello

Decoded, the injected fragment closes an existing attribute or tag with ">, then opens an img element whose src is the bare token a (which fails to load) and whose onerror handler calls alert(document.domain). The %3d and %3e encodings carry the = and > characters through the path.

The reproduction steps are short:

  1. Navigate to the vulnerable URL.
  2. Notice the pop-up.

The report references an attached screenshot as supporting material. The report does not describe a fix or a timeline.

Root cause

The report names the URL path as the vulnerable parameter. The payload's leading "> only produces a working script if the value lands inside an HTML attribute or tag context where those characters are interpreted as markup rather than text. In other words, the application likely takes a path segment and writes it into the HTML response without context-aware escaping, so the browser parses the injected img element and runs its onerror handler. The report does not show the server-side code or the exact template.

Impact

The demonstrated impact is a pop-up from alert(document.domain). The report does not enumerate specific data or actions exposed.

How this kind of bug works

Reflected XSS happens when an application copies part of the request into the response without encoding it for the context where it appears. The browser cannot tell developer-written markup from injected markup, so any characters that are meaningful in that context (angle brackets in HTML, quotes inside attributes, braces in some template contexts) can break out and introduce new elements or handlers.

The path is a less obvious source than the query string, which is why it is often missed. Frameworks frequently route on path segments and then echo them back in breadcrumbs, page titles, error messages or canonical links. If that echo is not escaped, the same class of bug appears. The onerror handler on an img with a broken src is a common execution vector because it fires without user interaction once the element is parsed.

The defences are context-aware output encoding (HTML-entity encoding for text and attribute values, JavaScript encoding inside script blocks, URL encoding inside URL contexts), a restrictive Content-Security-Policy that blocks inline handlers, and treating all request data, including the path, as untrusted. HttpOnly cookies limit what script can steal but do not stop the execution itself.

How to test for it

  1. Map every place where request data appears in the response: query parameters, path segments, headers such as Referer and User-Agent, and body fields. Path segments are worth explicit attention because testers often skip them.
  2. Send a benign marker first, for example a unique alphanumeric string, in each candidate location, and search the response body for it. This tells you whether the value is reflected at all and in what context.
  3. Once you find a reflection, determine the context: inside HTML text, inside an attribute value (single or double quoted, or unquoted), inside a script block, inside a URL, or inside a JSON response. The context dictates which characters matter.
  4. Send context-appropriate probe characters and observe whether they survive unencoded. For an attribute context, a double quote followed by a tag is the classic probe; for text, an opening angle bracket. Check the raw response, not just the rendered page, so you can see exactly what the server emitted.
  5. Confirm execution with a harmless payload that proves script runs in the target origin, such as one that reads the document domain. Avoid payloads that could affect other users or persist data.
  6. Common false positives: the value is reflected but HTML-encoded (harmless), it appears only inside a JavaScript string that is itself safely encoded, it is reflected in a response with a content type the browser will not render as HTML, or a filter strips the dangerous characters in a way that cannot be bypassed. Also check whether a WAF or framework is normalising the input before it reaches the sink.

How it is fixed

Apply context-aware output encoding at every point where request data is written into a response, including path-derived values used in titles, breadcrumbs and links. Validate and constrain path segments to expected formats where possible. Add a Content-Security-Policy that disallows inline event handlers and restricts script sources, which provides defence in depth if an encoding mistake slips through. Set session cookies with HttpOnly and Secure flags. Review framework auto-escaping settings, since templating engines that escape by default are often bypassed by explicit raw-output helpers.

Hunting notes

Reflected XSS tends to hide in secondary surfaces: error pages, 404 handlers, search results, redirect notices, language and locale switches, and any page that echoes the requested path. Affiliate, marketing and partner portals are good candidates because they often build pages dynamically from URL structure. Recon signals include applications that reflect the path in a canonical tag or page heading, frameworks with raw-output helpers in use, and responses that differ subtly when a path segment changes.

Keep the payload non-destructive, avoid touching other users' data, and state clearly what an attacker could reach.

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

This report is about a website called the affiliate portal, at affiliates.kromtech.com. An affiliate portal is a site where partners (affiliates) sign up to promote a company's products and track the traffic they send. It belongs to the Clario program on HackerOne, a platform where security researchers report bugs to companies. The researcher, kphaks, found a bug in it and the company paid a bounty of 300.00 USD. The report was rated medium severity with a CVSS score of 4.2, and it was disclosed on 2020-05-25.

The bug is a reflected cross-site scripting (XSS) issue. In plain terms: the website took a piece of text from the address bar and pasted it into the page without cleaning it first. Because the text was not cleaned, the browser treated part of it as instructions (HTML code) rather than as ordinary text, and ran a small script. The researcher proved this by making the browser show a pop-up box.

The vulnerable URL is given in full:

Text
https://affiliates.kromtech.com/monetize-mac-traffic/adgroup/affiliatefixhello%22%3E<img src%3da onerror%3dalert(document.domain)>hello/type/affiliate

A URL is the address you type into a browser. Everything after the domain name, split by slashes, is called the path. Here the path contains several segments, such as monetize-mac-traffic and adgroup. The report calls the vulnerable parameter the "URL Path", meaning the problem is in how the site handles the path, not a form field or a search box.

The payload, the piece of text designed to trigger the bug, is embedded in that path:

Text
hello"><img src%3da onerror%3dalert(document.domain)>hello

Line by line, this is what it does:

  • hello is harmless filler text.
  • "> closes whatever HTML attribute or tag the site had already opened around the value. Think of it as finishing someone else's sentence so you can start your own.
  • <img ...> starts an image element. The browser will try to load the image.
  • src%3da is the image source. %3d is the URL encoding of the = sign, so this reads src=a. There is no image called a, so loading it fails.
  • onerror%3dalert(document.domain) is an event handler: code that runs when the image fails to load. %3d again stands for =. alert(document.domain) opens a pop-up showing the domain of the page.
  • >hello closes the image tag and adds more filler text.

The %22 and %3e encodings carry the " and > characters through the path, because those characters have special meanings in a URL.

The reproduction steps are short:

  1. Navigate to the vulnerable URL.
  2. Notice the pop-up.

Step 1 matters because it shows the bug needs no special tools: just a browser and a crafted link. Step 2 matters because the pop-up is the proof. The pop-up is the proof that the script ran. The report references an attached screenshot as supporting material. It does not describe a fix or a timeline.

In general, how this kind of bug works

Reflected XSS happens when a website copies part of a request into its response without encoding it for the place where it lands. A request is what your browser sends to a server when you open a page; the response is what comes back. The browser cannot tell markup written by the developers from markup injected by an attacker, so any character that is meaningful in that spot (angle brackets in HTML, quotes inside attributes) can break out and add new elements or code.

The path is a less obvious source than the query string (the part after a ?), which is why it is often missed. Websites frequently use path segments to build breadcrumbs, page titles, error messages or links, and if that echo is not escaped, the bug appears. The onerror handler on an image with a broken source is a common trick because it fires automatically once the element is parsed, with no click needed.

The demonstrated impact is a pop-up from alert(document.domain). The report does not describe the impact of a real attack. The report does not list specific data or actions exposed. The report was rated medium severity with a CVSS score of 4.2.

To test for this yourself:

  1. Find every place where request data appears in the response: query parameters, path segments, headers, body fields. Pay attention to path segments, since testers often skip them.
  2. Send a harmless unique marker in each spot and search the response for it. This shows whether the value is reflected and where.
  3. Work out the context: HTML text, an attribute value, a script block, a URL, or JSON. The context decides which characters matter.
  4. Send probe characters suited to that context and check the raw response, not just the rendered page, to see exactly what the server sent.
  5. Confirm execution with a harmless payload that proves script runs in the target origin, such as one that reads the document domain. Avoid anything that could affect other users or store data.
  6. Watch for false positives: the value may be reflected but HTML-encoded (harmless), appear only inside a safely encoded JavaScript string, come back with a content type the browser will not render as HTML, or be filtered in a way that cannot be bypassed. Also check whether a WAF (web application firewall) or framework is normalising the input first.

The fix is context-aware output encoding everywhere request data is written into a response, including path values used in titles, breadcrumbs and links. Constrain path segments to expected formats where possible. Add a Content-Security-Policy that disallows inline event handlers and restricts script sources, as defence in depth. Set session cookies with HttpOnly and Secure flags. Review framework auto-escaping settings, since templating engines that escape by default are often bypassed by explicit raw-output helpers.

Reflected XSS tends to hide in secondary surfaces: error pages, 404 handlers, search results, redirect notices, language switches, and any page that echoes the requested path. Affiliate, marketing and partner portals are good candidates because they often build pages from the URL structure. Keep the payload non-destructive, avoid touching other users' data, and state clearly what an attacker could reach.

Glossary

  • Affiliate portal: a website where partners sign up to promote products and track the traffic they send.
  • Bounty: money a company pays a researcher for a valid security report.
  • Reflected XSS: XSS where the malicious text comes from the request and is echoed straight back in the response.
  • CVSS: a standard scoring system for the severity of a vulnerability.
  • URL: the address of a page in a browser.
  • Path: the part of a URL after the domain, split by slashes.
  • Parameter: a named input the site accepts, here the URL path itself.
  • Payload: the crafted text used to trigger a bug.
  • URL encoding: replacing characters with % codes so they can travel safely in a URL.
  • HTML: the markup language that describes the structure of a web page.
  • Attribute: a setting inside an HTML tag, such as src on an image.
  • Tag: an HTML element marker such as <img>.
  • Event handler: code that runs when something happens, such as an image failing to load.
  • onerror: the event handler that fires when an image cannot be loaded.
  • alert(): a browser function that shows a pop-up box.
  • document.domain: the domain name of the current page, readable from JavaScript.
  • Origin: the combination of scheme, host and port that a page belongs to; scripts run within it.
  • Request / response: what the browser sends to a server, and what the server sends back.
  • Query string: the part of a URL after ?, holding parameters.
  • Output encoding: converting characters so the browser treats them as text, not markup.
  • Context-aware encoding: encoding chosen for the exact place the value lands (HTML text, attribute, script, URL).
  • Content-Security-Policy: a response header that tells the browser which scripts and handlers are allowed.
  • HttpOnly: a cookie flag that hides the cookie from JavaScript.
  • Secure: a cookie flag that sends the cookie only over HTTPS.
  • Session cookie: a small value stored in the browser that identifies a logged-in user.
  • WAF: a web application firewall that filters suspicious requests.
  • Framework / templating engine: software that builds pages from templates and often escapes values automatically.
  • Raw-output helper: a template feature that skips automatic escaping.
  • False positive: a finding that looks like a bug but is not exploitable.
  • Triage: the first review a report gets before it is accepted.

More by kphaks

View all

3 more disclosed reports, best first.

More from Clario

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.