XSS @ store.steampowered.com via agecheck path name
The path after /agecheck/ on store.steampowered.com was not sanitised, allowing an attacker to inject JavaScript that executes in the victim's browser. An attacker could modify the page, inject forms to steal credentials or cookies, and conduct phishing.
- Triaged in 41 hours
- Fixed in 13 days
- Paid in 13 days
- Disclosed after 4 months
Hi,
I found a Cross-Site Scripting (XSS) in store.steampowered.com because the path after /agecheck/ is not sanitized as it should.
https://store.steampowered.com/agecheck/appmhuh2',{ sessionid: g_sessionID, ageDay: '', ageMonth: '', ageYear: '' } ).done( function( response ) { }%20 );}alert`XSS-by-TvM`;function x(){$J.post('mr2n2/247660/
Open this^ link, and XSS will be executed! Tested on FF 61.0.2
Looking forward!
Best regards, Pedro
Impact
A cross-site scripting vulnerability allows an attacker to modify the page. The attacker can inject forms to steal usernames, passwords, cookies,etc. In short, XSS opens the doors to plenty of phishing techniques.
Attachments
What the report shows
The target is the Steam store front end at store.steampowered.com, specifically the age check flow reached through the /agecheck/ path. The researcher, tvmpt, reported a reflected cross-site scripting issue in which the path segment following /agecheck/ is not sanitised as it should be.
The whole proof is a single URL. The researcher states that opening it executes the script, and that it was tested on Firefox 61.0.2:
https://store.steampowered.com/agecheck/appmhuh2',{ sessionid: g_sessionID, ageDay: '', ageMonth: '', ageYear: '' } ).done( function( response ) { }%20 );}alert`XSS-by-TvM`;function x(){$J.post('mr2n2/247660/
The payload appears shaped to break out of a JavaScript context. The leading fragment resembles the tail of a jQuery $J.post(...) call, with the path value spliced into it. The %20 );} closes that call, and then alertXSS-by-TvM;function x(){$J.post('mr2n2/247660/ injects a call to alert using a tagged template literal as the argument. The trailing fragment reopens a $J.post( call.
The report does not describe the server-side code, the exact template, or which parameter name the value arrives under beyond the path itself. It also does not say whether a fix was deployed or when.
The outcome recorded by the platform is a medium severity rating, CVSS 6.4, weakness classified as reflected cross-site scripting, and a bounty of 750.00 USD. The report was disclosed on 2019-01-07.
Root cause
The report points to one mistake: the value taken from the path after /agecheck/ is written into the page without sanitisation. The report only states that the path is not sanitised; the payload shape suggests the value lands in a script. The report only states that the path is not sanitised; the exact sink is implied by the payload shape.
Impact
The report's own impact statement is deliberately general: cross-site scripting lets an attacker modify the page, inject forms to steal usernames, passwords and cookies, and in short opens the door to plenty of phishing techniques. It does not claim a specific account takeover, a specific stolen secret, or a demonstrated cookie exfiltration. The proof stops at an alert firing, which is enough to show script execution in the origin.
How this kind of bug works
Reflected XSS happens when input from a request is echoed into a response without context-appropriate encoding, and the browser then interprets part of that input as code. The critical detail is context. A value placed between HTML tags needs HTML entity encoding; a value placed inside an HTML attribute needs attribute encoding; a value placed inside a <script> block needs JavaScript encoding, and if it sits inside a quoted string literal, the quote characters must be escaped too. A single generic filter that strips < and > does nothing for a value that lands in a script.
Modern defences are layered. Output encoding libraries pick the right escaping per sink. Content Security Policy can block inline script and eval-like constructs, which would stop a payload of this style even if encoding failed. Frameworks that auto-escape template variables reduce the chance of a raw sink, but they do not help when a developer deliberately marks a value as safe or concatenates it into a script block by hand. Cookie flags such as HttpOnly limit what script can read, though they do not stop page modification or phishing.
How to test for it
- Map every place where a request value appears in a response. Path segments, query parameters, fragment-derived values read by client script, headers echoed into error pages, and JSON fields rendered into inline script are all candidates.
- For each candidate, send a benign marker first and locate it in the response body. Note the exact context: HTML text, attribute, quoted JavaScript string, unquoted JavaScript, JSON, or a URL inside a script.
- Craft a probe for that context. In a quoted JavaScript string, try closing the quote and the statement; in HTML text, try a tag; in an attribute, try closing the attribute. Keep probes non-destructive.
- Confirm execution in a real browser, not just by reading the response. A reflected marker that is encoded is not a finding; a marker that changes the parse tree or executes is.
- Check whether a WAF or filter blocks obvious payloads, and whether alternative encodings (percent-encoding, Unicode escapes, template literal syntax) get through.
Common false positives: the value appears in the response but is correctly encoded for its context; the value is reflected only inside a comment or a non-executed block; the browser's own XSS auditor or a CSP blocks execution; or the reflection is in a response with a content type that the browser will not render as HTML.
How it is fixed
Apply context-aware output encoding at the sink, so that a value inserted into a JavaScript string is escaped as a JavaScript string and cannot terminate the literal. Avoid building inline scripts from request data; pass values through data attributes or a JSON endpoint with correct content type instead. Add a Content Security Policy that disallows inline script where feasible. Validate path segments against an allowlist where the value is expected to be an identifier. Add regression tests that assert the encoded form of hostile input in the rendered page.
Hunting notes
Path-based reflections are easy to overlook because testers focus on query strings. Look at routes that take an identifier in the path and feed it into client-side code: age gates, redirect handlers, locale switchers, share links, and error pages that echo the requested path. Recon signals include inline <script> blocks that interpolate server values, jQuery snippets assembled with string concatenation, and endpoints that return the same page for arbitrary path suffixes.
Keep the proof to a harmless action such as an alert or a DOM marker, and describe realistic impact without overclaiming. If the program asks for a fix suggestion, point at the specific sink and the encoding required for that context.
What happened, in plain words
Steam's store website has an age check under a web address that starts with /agecheck/. That check lives under a web address that starts with /agecheck/. The researcher, tvmpt, found that whatever text you put after /agecheck/ in the address is copied into the page without being cleaned up first. When the browser reads the page, it treats part of that text as a small program and runs it.
A web address (URL) is the line you type in the browser bar, like a street address for a page. A request is what your browser sends to the server to ask for that page. A cookie is a small piece of data the site stores in your browser so it can recognise you on the next request, for example to keep you logged in. A token is a value the site hands out and expects back, so it can tell a genuine request from a forged one.
The whole proof is one URL. The researcher says that opening it runs the script, and that it was tested on Firefox 61.0.2:
https://store.steampowered.com/agecheck/appmhuh2',{ sessionid: g_sessionID, ageDay: '', ageMonth: '', ageYear: '' } ).done( function( response ) { }%20 );}alert`XSS-by-TvM`;function x(){$J.post('mr2n2/247660/
Why does this work? The age check page contains a piece of JavaScript, the programming language browsers run. That code is written into the page itself. The value from the address appears to be dropped into that code. The payload is shaped to break out of the spot where it is inserted and add its own instruction.
Line by line, the parts of the URL do the following:
appmhuh2',{ sessionid: g_sessionID, ageDay: '', ageMonth: '', ageYear: '' } ).done( function( response ) { }resembles the tail of the site's own request code, with the path value spliced in.%20 );}is a space (the%20part) followed by);}.alertXSS-by-TvM;is the injected instruction.alertmakes the browser show a pop-up box; the text between the backticks is what the box displays.function x(){$J.post('mr2n2/247660/reopens a request call.
The report does not describe the server-side code, the exact template, or which parameter name the value arrives under beyond the path itself. It also does not say whether a fix was deployed or when.
The platform recorded this as a medium severity issue, CVSS 6.4, classified as reflected cross-site scripting, with a bounty of 750.00 USD. It was disclosed on 2019-01-07.
Impact
The report's own impact statement is deliberately general: cross-site scripting lets an attacker modify the page, inject forms to steal usernames, passwords and cookies, and in short opens the door to plenty of phishing techniques. Phishing means tricking someone into typing their details into a fake form. It does not claim a specific account takeover, a specific stolen secret, or a demonstrated cookie theft. The report states that opening the link executes the script on the real Steam page.
In general, how this kind of bug works
This is reflected cross-site scripting, usually shortened to XSS. It happens when something you send in a request is echoed back into the page without being encoded for the place where it lands, and the browser then reads part of it as code. Think of a form letter where your name is typed into a blank: if the clerk copies whatever you wrote, including a rude sentence, the letter now contains your sentence. The site copied the address text into the page without sanitising it, and the browser ran part of it.
The critical detail is context, meaning where in the page the value ends up. A value placed between HTML tags needs one kind of encoding; a value inside an HTML attribute needs another; a value inside a <script> block needs JavaScript encoding, and if it sits inside a quoted string, the quote characters must be escaped too. A filter that only strips < and > does nothing for a value that lands in a script.
Defences are layered. Output encoding libraries pick the right escaping for each spot. Content Security Policy, a set of rules the site sends telling the browser what it may run, can block inline script and stop a payload like this even if encoding fails. Frameworks that escape template values automatically reduce the risk, but not when a developer deliberately marks a value as safe or glues it into a script by hand. Cookie flags such as HttpOnly limit what script can read, though they do not stop page modification or phishing.
In general, how to test for it
- Map every place where a request value appears in a response. Path segments, query parameters, values read by client script, headers echoed into error pages, and JSON fields rendered into inline script are all candidates.
- For each candidate, send a harmless marker first and find it in the response. Note the exact context: HTML text, attribute, quoted JavaScript string, unquoted JavaScript, JSON, or a URL inside a script.
- Craft a probe for that context. In a quoted JavaScript string, try closing the quote and the statement; in HTML text, try a tag; in an attribute, try closing the attribute. Keep probes non-destructive.
- Confirm execution in a real browser, not just by reading the response. A marker that is encoded is not a finding; a marker that changes how the page is parsed or runs is.
- Check whether a filter blocks obvious payloads, and whether alternative encodings (percent-encoding, Unicode escapes, template literal syntax) get through.
Common false positives: the value appears but is correctly encoded for its context; it is reflected only inside a comment or a block that never runs; the browser or a Content Security Policy blocks execution; or the response has a content type the browser will not render as HTML.
In general, how it is fixed
Apply context-aware output encoding at the sink, so a value inserted into a JavaScript string is escaped as a JavaScript string and cannot end the literal. Avoid building inline scripts from request data; pass values through data attributes or a JSON endpoint with the correct content type instead. Add a Content Security Policy that disallows inline script where feasible. Validate path segments against an allowlist where the value is expected to be an identifier. Add regression tests that assert the encoded form of hostile input in the rendered page.
In general, hunting notes
Path-based reflections are easy to overlook because testers focus on query strings. Look at routes that take an identifier in the path and feed it into client-side code: age gates, redirect handlers, locale switchers, share links, and error pages that echo the requested path. Signals worth watching include inline <script> blocks that interpolate server values, jQuery snippets assembled with string concatenation, and endpoints that return the same page for arbitrary path suffixes.
Keep the proof to a harmless action such as an alert or a page marker, and describe realistic impact without overclaiming. If the program asks for a fix suggestion, point at the specific sink and the encoding required for that context.
Glossary
- URL (web address): the line in the browser bar that identifies a page, such as
https://store.steampowered.com/agecheck/. - Request: the message your browser sends to a server to ask for a page or send data.
- Response: what the server sends back, usually the page and its code.
- Cookie: a small piece of data a site stores in your browser to recognise you later, for example to keep you logged in.
- Token: a value the site issues and expects back, used to tell a genuine request from a forged one.
- Path: the part of a URL after the site name, here everything after
/agecheck/. - Sanitise (encode): to transform input so the browser treats it as plain text rather than code.
- Context: the place in a page where a value lands (HTML text, attribute, script string), which decides the correct encoding.
- JavaScript: the programming language browsers run to make pages interactive.
- Inline script: JavaScript written directly inside the page rather than in a separate file.
- jQuery: a JavaScript library that makes common tasks, such as sending requests, shorter to write;
$Jhere is a reference to it. - Cross-site scripting (XSS): a bug where an attacker's input is run as code in another user's browser on the site's page.
- Reflected XSS: XSS where the input comes straight back in the same response, rather than being stored on the server.
- Payload: the crafted piece of input designed to trigger the bug.
alert: a JavaScript function that shows a pop-up box; used here as harmless proof that code ran.- Template literal: JavaScript text wrapped in backticks, which can include values; used here to pass text to
alert. - Sink: the place in the code where a value is written into the output.
- Content Security Policy (CSP): rules a site sends telling the browser what scripts it may run.
HttpOnly: a cookie flag that stops JavaScript from reading that cookie.- CVSS: a scoring system for rating the severity of a security issue.
- Bounty: money a company pays a researcher for a valid report.
- Phishing: tricking someone into entering their details into a fake form or page.
- False positive: a suspected bug that turns out not to be exploitable.