Just another XSS | by lnxcs
A parameter on a help-centre subdomain reflected user input without proper handling, allowing script injection. The author found one payload that got past the Akamai WAF and triggered an alert, though the text does not show the response or confirm execution.
lnxcs.medium.com
Published on lnxcs.medium.com
Bughunting
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The target was a site the author refers to as example.com, described as an old RDVP. Because of that, the author did not test the main domain and went looking at subdomains instead. One of them was helpcenter.example.com, a help centre application. The feature of interest is a lang parameter, which such applications normally use to select the language of the page content.
Setup
The only tool mentioned is Burp Suite, used to spider the site and later to send payloads. No accounts, roles or versions are given. The report says only that the host sits behind an Akamai WAF and that a lang parameter was found; it does not describe how the value is handled.
Finding it
After firing up Burp and spidering helpcenter.example.com, the author found a parameter called:
/lang=
The choice of payloads was driven by earlier experience: a couple of days before, the author had exploited a FortiClient directory traversal bug that also lived on a lang parameter. That made directory traversal the first thing to try here.
Exploitation
Step 1: directory traversal attempts
The first round of testing aimed directory traversal at the lang parameter. Every payload was blocked by the Akamai WAF, encoded and non-encoded alike. The author does not list the individual traversal payloads, only that all of them were stopped.

Step 2: switching to XSS
After leaving the target for a while, the author returned and decided to try XSS on the same parameter instead. A wordlist of XSS payloads was run through Burp against lang. Every payload was blocked except one:
%27%3balert(String%2efromCharCode(88,83,83))%2f%2f%27%3balert(String%2e%20fromCharCode(88,83,83))%2f%2f”%3balert(String%2efromCharCode%20(88,83,83))%2f%2f”%3balert(String%2efromCharCode(88,83,83))%2f%2f — %20><%2fSCRIPT>”>%27><SCRIPT>alert(String%2efromCharCode(88,83,83))%20<%2fSCRIPT>
What the surviving payload does, part by part:
%27is a URL-encoded single quote, and%3bis a semicolon, so the payload starts by trying to break out of a quoted JavaScript string context.alert(String%2efromCharCode(88,83,83))builds the stringXSSat runtime from character codes 88, 83 and 83, so the literal textalert(is not followed by a quoted string that a filter might match.%2eis a dot.%2f%2fis//, a JavaScript line comment, used to comment out whatever follows the injected code inside the original script.- The same construction is repeated with a double quote (
%22) instead of a single quote, and with a space inside thefromCharCodecall, to cover the other quoting context. %20><%2fSCRIPT>closes the current context and a script element, and%27><SCRIPT>alert(String%2efromCharCode(88,83,83))%20<%2fSCRIPT>opens a fresh<SCRIPT>block containing the samealertcall, again withXSSassembled from character codes.
The report does not show the server response or a screenshot of the alert firing; it states only that this was the one payload the WAF let through.
Root cause
The report does not analyse the application code, so the exact sink is not stated. The report does not analyse the application code or show the response, so the sink and the controls in place are not stated. Which variant actually executed is not described.
Impact
The report does not assess impact, scope or affected users. In general terms, script execution on a help centre subdomain would let an attacker run JavaScript in the browser of a victim who opens a crafted link, in the origin of that subdomain. The author gives no details on what could be reached from there.
Fix
The control that should have stopped this is context-aware output encoding of the lang value on the server side, rather than relying on WAF signature matching, which the payload above shows can be evaded.
Variants to test
- Try the same
langparameter on other help centre or localisation endpoints. A positive result is the payload being reflected into a script context and thealertfiring. - Where a WAF blocks
alert('XSS'), substituteString.fromCharCodeconstruction as above. A positive result is the same execution with no literalXSSstring in the request. - Send a single request containing several breakout variants (single quote, double quote,
</SCRIPT>,><SCRIPT>) so that one of them matches the page's quoting. A positive result is execution from any one of the variants. - Test the parameter with encoded and non-encoded traversal sequences first, as the author did. A positive result here is file content from outside the intended directory being returned; on this target the WAF blocked all of them.
What happened, in plain words
A security researcher was testing a company's website for bugs, the kind of work people do in bug bounty programmes, where companies pay people to find weaknesses before criminals do. He picked a smaller part of the site rather than the main page, found a spot where the site takes a value from the address bar, and tried to make that value do something the site's authors never intended. His first idea was blocked by a protective filter. His second idea, a different kind of attack, got through with exactly one cleverly disguised piece of text. This article walks through that story slowly, explaining each idea as it comes up, so that someone who has only ever used a browser can follow it.
The target and why subdomains were chosen
The author refers to the site as example.com. He describes it as an old RDVP. The report does not expand that abbreviation, so treat it as the author's label for the kind of programme or target it was. What matters is the consequence: he did not test the main domain and went looking at subdomains instead.
A subdomain is the part of a web address that sits to the left of the main name. In helpcenter.example.com, the main name is example.com and helpcenter is the subdomain. Think of a large building: example.com is the main entrance everyone knows, and subdomains are side doors, service entrances and staff stairwells. They often lead to the same building but are maintained by different teams, updated at different times, and protected less carefully. That is exactly why a tester starts there.
One of those side doors was helpcenter.example.com, a help centre application, the kind of site where customers read articles and FAQs about a product.
The feature that was tested
The interesting feature is a lang parameter. Help centre applications are usually translated into several languages, and the lang parameter is how the site knows which language to show. When you pick "Français" from a dropdown, the site often just puts something like ?lang=fr at the end of the address. The server reads that value and serves the French version of the page.
A parameter, in this sense, is simply a named value passed in the address bar (or in a form submission) so the server can adjust what it sends back. It is like telling a waiter "no onions": the kitchen reads the instruction and changes the dish. The danger is that the kitchen might also do whatever else is written on the note, if nobody checks it properly.
The tool: Burp Suite
The only tool the report mentions is Burp Suite. Burp is a program that sits between your browser and a website, like a post office clerk who opens every letter, reads it, and can rewrite it before passing it on. Two of its features are used here:
- Spidering. Burp can crawl a site automatically, following links and recording every page and parameter it finds, the way a librarian walks the shelves and notes every book. This is how the author discovered the
langparameter. - Sending payloads. Burp lets you take a captured request, change parts of it, and send it again and again, quickly. A payload is the piece of text an attacker puts into a parameter hoping the site will mishandle it.
The report gives no accounts, roles or software versions, so there is nothing more to say about the setup. The report says only that the host sits behind an Akamai WAF and that a lang parameter was found.
A WAF, or Web Application Firewall, is a filter placed in front of a website. It inspects incoming requests and blocks ones that look like known attacks, much like a bouncer at a club who checks a list of banned faces. Akamai is a company that provides such a service. A WAF is a useful extra layer, but as this story shows, it is not the same as fixing the underlying problem.
Finding the parameter
After firing up Burp and spidering helpcenter.example.com, the author found a parameter called:
/lang=
This is the fragment of the address that carries the language choice. The = sign is followed by whatever value the site expects, for example a language code. The author now had a place to experiment: a value that the server reads and acts on.
Step 1: trying directory traversal first
The choice of first attack was driven by earlier experience. A couple of days before, the author had exploited a FortiClient directory traversal bug that also lived on a lang parameter. FortiClient is security software made by Fortinet, and the report does not describe that earlier bug beyond calling it a directory traversal. The lesson the author took was simple: a lang parameter had been vulnerable to traversal once, so try traversal here first.
Directory traversal is an attack where the value you supply is designed to make the server read a file from outside the folder it intended to serve. Servers store files in folders, and .. means "go up one folder". If a site is supposed to serve files only from /help/, a value containing ../ might let you climb out and read something else, like a guest who is told to wait in the hallway but keeps opening doors until one is unlocked. The report does not list the individual traversal payloads the author tried, only the outcome.
Every payload was blocked by the Akamai WAF, encoded and non-encoded alike. Encoding here means writing characters in a different form, for example %2e instead of a dot, so that a filter looking for the literal characters does not recognise them. The author tried both forms and both were stopped. His reaction, as the report puts it, was:

The image sits right after the sentence about the WAF blocking everything, and it captures the author's frustration at that point: the filter was doing its job and none of the traversal attempts got through.
Step 2: switching to XSS
After leaving the target for a while, the author came back and decided to try XSS on the same parameter instead. XSS, or cross-site scripting, is a class of bug where an attacker gets their own JavaScript to run inside someone else's website, in the browser of a victim who opens a crafted link. JavaScript is the programming language that browsers run to make pages interactive. If an attacker can inject JavaScript into a page, that code runs with the trust of the site, which is why XSS matters.
A wordlist is a file full of ready-made payloads, collected from past research and public sources. Testers run a wordlist through a tool like Burp so that hundreds of attempts can be tried quickly. The author ran an XSS wordlist against lang. Every payload was blocked except one:
%27%3balert(String%2efromCharCode(88,83,83))%2f%2f%27%3balert(String%2e%20fromCharCode(88,83,83))%2f%2f”%3balert(String%2efromCharCode%20(88,83,83))%2f%2f”%3balert(String%2efromCharCode(88,83,83))%2f%2f — %20><%2fSCRIPT>”>%27><SCRIPT>alert(String%2efromCharCode(88,83,83))%20<%2fSCRIPT>
This is one long string containing several variations of the same idea, packed together. Here is what each part does, in plain words:
%27is a URL-encoded single quote. In a web address, characters that are not letters or digits are often written as a percent sign and two hex digits, so%27means'. The payload starts with a single quote because it is trying to break out of a quoted JavaScript string. Imagine the page has code likevar lang = 'en';. If you can insert a quote, you can end the string early and start writing your own code.%3bis a semicolon, which in JavaScript separates one instruction from the next. It lets the injected code start a fresh statement.alert(String%2efromCharCode(88,83,83))is the actual attack.alertis a browser function that pops up a message box.String.fromCharCodebuilds a piece of text from numbers, and 88, 83 and 83 are the character codes for the letters X, S and S. So this call builds the wordXSSat the moment it runs, rather than containing it as literal text.%2eis a dot. The trick matters because many filters look for the literal wordXSSor foralert('...')with a quoted string inside. Here neither appears in the request.%2f%2fis//, which in JavaScript starts a comment. Everything after it on that line is ignored by the browser. The attacker uses it to comment out whatever code follows the injection point, so the page's own script does not break and the injected code runs cleanly.- The same construction is then repeated with a double quote (
%22) instead of a single quote, and with a space inside thefromCharCodecall. This covers the other common quoting context: if the page wraps the value in double quotes rather than single ones, the single-quote version would not break out, but the double-quote version would. %20><%2fSCRIPT>is a space, a closing angle bracket, and a closing</SCRIPT>tag. This is for the case where the value lands inside an HTML page rather than inside a script string. Closing the current tag and the script element lets the attacker start fresh markup.%27><SCRIPT>alert(String%2efromCharCode(88,83,83))%20<%2fSCRIPT>opens a brand new<SCRIPT>block containing the samealertcall, again withXSSassembled from character codes, and then closes it. If the page lets the value through into the HTML, this is the version that runs.
The report does not show the server response or a screenshot of the alert firing. It states only that this was the one payload the WAF let through. So the evidence here is the bypass itself: the filter accepted this string while rejecting the rest of the wordlist.
Why it worked
The report does not analyse the application code, so the exact place in the page where the value ends up is not stated. The report does not analyse the application code or show the response, so where the value ends up is not stated.
Output encoding means converting special characters into a safe form before putting them into a page, so that a quote stays a harmless character instead of ending a string. It is the difference between reading a customer's note aloud as text and following it as an instruction. Which variant actually executed is not described.
Impact
The report does not assess impact, scope or affected users. In general terms, script execution on a help centre subdomain would let an attacker run JavaScript in the browser of a victim who opens a crafted link, in the origin of that subdomain. Origin here means the combination of scheme, host and port that the browser treats as one trust boundary, so code running in the help centre's origin can act as the help centre. The author gives no details on what could be reached from there.
Fix
The control that should have stopped this is context-aware output encoding of the lang value on the server side, rather than relying on WAF signature matching, which the payload above shows can be evaded. Context-aware means the encoding is chosen for where the value lands: inside a JavaScript string, inside an HTML attribute, or inside HTML text each need different treatment.
Variants to test
- Try the same
langparameter on other help centre or localisation endpoints. A positive result is the payload being reflected into a script context and thealertfiring. - Where a WAF blocks
alert('XSS'), substituteString.fromCharCodeconstruction as above. A positive result is the same execution with no literalXSSstring in the request. - Send a single request containing several breakout variants (single quote, double quote,
</SCRIPT>,><SCRIPT>) so that one of them matches the page's quoting. A positive result is execution from any one of the variants. - Test the parameter with encoded and non-encoded traversal sequences first, as the author did. A positive result here is file content from outside the intended directory being returned; on this target the WAF blocked all of them.
The author closes by saying the write-up was kept short on purpose, because resources and wordlists play an important role in finding bugs, so choose yours wisely.
Glossary
- Bug bounty: a programme where organisations pay researchers for reporting security weaknesses.
- Subdomain: the part of a web address to the left of the main name, such as
helpcenterinhelpcenter.example.com. - Parameter: a named value passed to a site, usually in the address bar, that changes what the site returns.
langparameter: the parameter a site uses to choose which language to display.- Burp Suite: a tool that sits between browser and server, letting you capture, inspect and resend requests.
- Spidering: automatically crawling a site to discover its pages and parameters.
- Payload: the piece of text an attacker inserts into a parameter hoping the site mishandles it.
- WAF: Web Application Firewall, a filter in front of a site that blocks requests matching known attack patterns.
- Akamai: the company providing the WAF in front of this target.
- Directory traversal: an attack that uses
..sequences to make a server read files outside the folder it intended to serve. - Encoding (URL encoding): writing characters as a percent sign plus two hex digits, such as
%27for a single quote. - XSS (cross-site scripting): a bug where an attacker's JavaScript runs inside another site, in a victim's browser.
- JavaScript: the programming language browsers run to make pages interactive.
- Wordlist: a file of ready-made payloads used to test a target quickly.
alert: a browser function that shows a pop-up message, commonly used to prove script execution.String.fromCharCode: a JavaScript function that builds text from numeric character codes, used here to hide the wordXSSfrom filters.- Comment (
//): JavaScript syntax that makes the rest of the line ignored by the browser. - Output encoding: converting special characters into a safe form before placing them in a page.
- Context-aware encoding: output encoding chosen according to where the value lands, such as a script string or HTML text.
- Origin: the scheme, host and port combination a browser treats as one trust boundary.
- Reflected XSS: XSS where the payload is echoed back in the response to the same request, rather than stored on the server.