
XSS: The Most Common Bug on the Web
Day 6 was injection into the server’s database. Today is injection into the victim’s browser. Cross Site Scripting, XSS, is the most common web vulnerability there is, it appears across programs of every size, and it is one of the best classes for a beginner to land a first bounty on, because the surface is enormous and the proof is clean. It is also, done well, high impact: an XSS that fires in an admin’s browser can take over accounts.
This is the fourth vulnerability class in the series. XSS extends the injection mindset from Day 6: your input becoming code, this time running in a browser instead of a database. If SQLi is data becoming SQL, XSS is data becoming JavaScript.
Inside scope only, with safe proof. XSS runs code in browsers, so your proof is the harmless demonstration that code ran, not an actual attack on a real user. A benign popup or a callback to your own server proves it. Stealing a real user’s session is damage.
What XSS actually is
A web page is HTML and JavaScript. When a page includes your input without properly separating it from the page’s code, your input can become part of the page’s HTML or script, and the browser runs it. The browser cannot tell the difference between JavaScript the developer wrote and JavaScript you injected. Both run with the page’s full privileges in the victim’s browser: reading their session, acting as them, changing what they see.
So an XSS lets you run JavaScript in another user’s browser, in the context of the vulnerable site. That is powerful, because in the browser, with the site’s privileges, you can do almost anything the user can: take actions as them, read their data, steal their session, redirect them. The DoD report shows the clean shape: a payload placed in registration fields that executed when the profile loaded, triggering in the victim’s browser. Report: https://hackerone.com/reports/1620247
The three types
XSS is classified by how the payload reaches the victim.
Reflected XSS. The payload is in the request and reflected straight back in the response. You put script in a URL parameter, the page echoes it into the HTML, and it runs. To exploit a victim, you get them to open your crafted link. Common, lower severity because it needs the victim to click your link, but still valid and still paid.
Stored XSS. The payload is saved by the application and served to other users later. You put script in a profile field, a comment, a message, a name, and it runs in the browser of everyone who views that content. This is the dangerous one, because it needs no link, it fires on normal users or admins just viewing the page. The Shopify case is the archetype: a payload placed in a staff member’s name sat stored until it executed in Shopify’s internal admin panel, earning the maximum XSS bounty precisely because it fired in a privileged internal context. Report: https://hackerone.com/reports/946053
DOM based XSS. The vulnerability is entirely in client side JavaScript. The page’s own script takes something attacker influenced, part of the URL, and writes it into the page unsafely, so the payload never needs to touch the server. You find these by reading the JavaScript, which connects directly to your recon JS work.
Why stored and blind XSS are the prize
Reflected XSS needs a victim to click your link. Stored XSS fires on anyone who views the content, including staff. And blind XSS, a stored XSS that fires somewhere you cannot see, like an internal admin panel, is where the big impact lives.
The Shopify report is blind stored XSS: the hunter placed the payload years earlier and it fired later in an internal panel they never had access to. The lesson for hunting: plant benign XSS probes in fields that staff might later view in an admin interface, support ticket bodies, usernames, feedback forms, and use a tool that calls back to your server when the payload fires, so you learn about execution in places you cannot see. This is one of the highest value techniques in bug bounty, because the admin context is where XSS hurts most.
Where to look, pointed at your recon
XSS lives anywhere user input appears on a page.
Every reflected input. Search boxes, URL parameters, anything echoed back in the response. Your recon params.txt is the list.
Every stored input that is displayed. Profile fields, names, comments, messages, reviews, support tickets, any field whose value other users or admins see later. These are your stored XSS candidates, and the ones that render in staff tools are gold.
Client side sinks in JavaScript. Your recon js_files.txt and js_endpoints.txt from Part 3 are where DOM XSS hides. Read the JS for places it writes URL-influenced data into the page unsafely.
The connection to recon is direct: the forgotten hosts, the many input fields, the JS files you collected are exactly the XSS hunting ground.
How to hunt it, step by step
Step 1: find input that appears on a page. From recon, list reflected parameters and stored fields on in scope targets.
Step 2: test reflection. Put a unique harmless marker in each input and find where it appears in the response. Does it land inside HTML, inside an attribute, inside a script, each context changes what is needed to break out. The first question is always: does my input reach the page, and in what context.
Step 3: test whether it is treated as code. If your marker is reflected, test whether HTML special characters are escaped or rendered. If the app renders them as markup rather than escaping them to safe text, your input can become HTML, which is the door to XSS.
Step 4: prove execution safely. Confirm with the most benign proof that code ran: a popup showing the site’s domain, or a payload that makes a request to a server you control. Either proves JavaScript executed in the page context. Never use a real session stealing payload against real users, the benign proof is enough for the report.
Step 5: for stored and blind, plant and wait. For stored fields, plant a benign payload and view it as another user to confirm execution. For blind, use a payload that calls back to your server, plant it in fields staff might view, and wait to see if it fires somewhere you cannot see. That callback is your proof of a blind stored XSS.
Writing the XSS report
The structure that gets XSS paid:
Title: [Reflected/Stored/DOM] XSS in [field/parameter] at [endpoint]
Summary:
One sentence: which input, which page, which XSS type.
Steps to Reproduce:
Insert [benign payload] into [input].
[Load the page / have another user view it].
Observe the payload executes (popup / callback).
(Exact payload, requests, screenshot of execution.)
Impact:
Attacker runs JavaScript in the victim’s browser as the site:
account takeover, session theft, actions as the victim. Note
if stored (fires on all viewers) or fires in an admin context.
Remediation:
Context-aware output encoding of all user input, plus a strong
Content Security Policy.
The strong reports share a pattern: a benign proof like a domain popup or a callback, a clear statement of where it fires and who it affects, and for stored XSS, proof it executes in another user’s context. Shopify paid maximum because the report showed execution in a privileged internal panel, impact context is what drives the severity.
The mindset: data crossing into code, again
XSS is the same lens as SQLi, aimed at the browser instead of the database. Wherever your input crosses into something interpreted, ask whether the boundary is enforced. SQLi, the database. XSS, the browser’s HTML and JavaScript. Once you see input become code in two places, you are watching for it everywhere, which is the injection mindset that underlies a huge share of web bugs.
Your recon found the input fields, the forgotten hosts, and the JavaScript. XSS is one of the most common and most findable bugs to test on them, and a stored one in a privileged context is high impact.
Homework for Day 7
- From recon, list in scope reflected parameters, stored-and-displayed fields, and JS files for DOM sinks.
- Test reflection with a unique marker, noting the context where it lands.
- Where input is reflected unescaped, prove execution with a benign domain popup.
- For stored fields, plant a benign payload and confirm it fires when viewed. For blind, use a callback payload in staff-viewable fields and wait.
- Read all three disclosed reports end to end: Shopify blind stored XSS in staff name (https://hackerone.com/reports/946053), DoD stored XSS in registration (https://hackerone.com/reports/1620247), and a reflected XSS report. For each, note the input, the context it fired in, and how impact was proven.
A confirmed XSS on an in scope target is a valid finding, and a stored one in a privileged context can be high severity. Document it with the benign proof and the output-encoding plus CSP remediation.
Day 8 moves to a bug that abuses the trust between a user’s browser and a site they are logged into, CSRF and its modern variants, with a real disclosed report broken down end to end.