October 30, 2026
XSS Hunting Methodology: My Complete Recon to Validation Workflow | by Samadhan Shimple
Cross-Site Scripting (XSS) is one of those vulnerabilities that looks simple at first but becomes much more interesting when you start…

By Samadhan shimple
9 min read
Cross-Site Scripting (XSS) is one of those vulnerabilities that looks simple at first but becomes much more interesting when you start testing real applications.
When I began learning XSS, I thought finding it was mostly about inserting a JavaScript payload into a parameter and checking whether it executed. Over time, I learned that successful XSS hunting requires much more than trying random payloads.
My approach is to understand how an application handles user input, where that input appears, and whether the application safely processes it before displaying it in a browser.
In this article, I will share the methodology I use to approach XSS testing, the tools that help me, and the areas I pay attention to during bug bounty hunting.
1. Understanding XSS Before Testing
Cross-Site Scripting happens when an application handles untrusted input in an unsafe way, allowing an attacker to execute JavaScript in another user's browser.
Depending on the vulnerability, this can affect user accounts, expose information available to the affected page, or allow unauthorized actions within the victim's session.
I usually divide XSS into three main categories:
- Reflected XSS: The input is included in a response and handled unsafely.
- Stored XSS: The input is saved and later displayed unsafely to other users.
- DOM-based XSS: Client-side JavaScript processes untrusted data in an unsafe way.
Understanding these differences helps me choose the right testing approach instead of relying on a single payload for every situation.
2. Phase One: Reconnaissance and Application Mapping
Before testing for XSS, I spend time understanding the application and identifying places where user-controlled data enters the system.
I do not focus only on visible search boxes or contact forms. Input can come from URL parameters, API requests, HTTP headers, uploaded filenames, profile information, and other application features.
During this phase, I pay attention to:
- URL parameters such as
search,q,redirect, andid - Form fields and request body parameters
- Usernames, profile descriptions, comments, and feedback forms
- HTTP headers such as
RefererandUser-Agent - API endpoints that accept JSON or XML
- URL fragments that client-side JavaScript reads
- File upload names and other user-controlled metadata
I use Burp Suite to browse the application, inspect requests and responses, and build a site map.
This gives me a clearer picture of the application's attack surface and helps me avoid testing the same input repeatedly.
3. Phase Two: Finding More Parameters
One of the lessons I have learned is that visible parameters are not always the only parameters an application accepts.
Some features contain hidden fields or undocumented parameters that are not immediately obvious during normal browsing.
I inspect page source, review form fields, and examine requests captured in Burp Suite. I also use tools such as Arjun and ParamSpider when appropriate to identify additional parameters and historical URLs.
However, discovering a parameter does not automatically mean it is vulnerable.
My goal at this stage is to build a useful list of inputs that I can investigate manually. I prioritize parameters that appear to influence page content, error messages, search results, redirects, or client-side behavior.
4. Phase Three: Testing Input Reflection Manually
This is one of the most important parts of my XSS methodology.
Instead of immediately trying complicated payloads, I start with a unique, harmless marker such as:
xsscanary12345
I place the marker into an input field or parameter and inspect the resulting response.
I want to answer three questions:
- Does my input appear in the response?
- Where exactly does it appear?
- Does the application encode or sanitize it correctly?
For example, the marker might appear inside an HTML element, an HTML attribute, a JavaScript string, or a URL.
Each context behaves differently. A value that is safe in one context might become dangerous in another if it is handled incorrectly.
This is why I do not assume that reflected input automatically means XSS. Reflection is a useful clue, but execution and security impact must be validated separately.
5. Understanding the Context of the Reflection
Once I find a reflected input, I examine the surrounding HTML or JavaScript.
For example, I check whether the value appears inside a text element, an attribute, a script block, or a URL. I also look for HTML encoding and other protections.
The context matters because browsers interpret data differently depending on where it appears.
A well-implemented application should treat user-controlled values as data rather than executable code. Context-aware output encoding is one of the main defenses against XSS.
I also check whether the application uses a framework or a client-side rendering process that changes how the input is handled.
My main objective is to understand the complete input-handling process rather than simply collecting reflected parameters.
6. Phase Four: Using Automation Carefully
Manual testing is important, but testing every parameter by hand can take a long time. This is where automation becomes useful.
These are some of the tools I consider during XSS testing.
Burp Suite
I use Burp Suite to intercept requests, modify parameters, inspect responses, and organize the application's attack surface. Its browser-based tools are also useful for investigating client-side behavior.
Dalfox
Dalfox helps automate XSS testing and identify potential reflected XSS issues. Its results still need manual verification because automated findings can include false positives.
XSStrike
XSStrike provides context-aware XSS testing features and can help investigate input-handling behavior.
Arjun and ParamSpider
I use these tools for parameter discovery and URL collection, where they fit the testing workflow.
Burp DOM Invader
For DOM-based XSS, DOM Invader can help trace controlled input through client-side code and identify potentially dangerous sinks.
I do not treat a scanner result as a confirmed vulnerability. Automation helps me find candidates, while manual investigation helps me understand whether the issue is real and reportable.
7. Looking for Stored XSS
Stored XSS deserves special attention because the input may be saved and displayed later, possibly to another user.
I look at features such as profile descriptions, comments, feedback forms, support tickets, and other places where users can submit content.
After submitting a harmless test marker in an authorized environment, I check where that information appears later.
For example, a value submitted through a profile form might be displayed on the public profile, in an administrative dashboard, or in a notification.
I also pay attention to Markdown editors and features that convert user-submitted content into HTML. Problems can occur when the conversion or sanitization process does not handle untrusted input safely.
The important point is to test the entire data flow, not just the form where the input was originally submitted.
8. Investigating Blind XSS
Blind XSS is more challenging because the affected page may not be visible to the person performing the test.
For example, submitted information might later appear in an internal dashboard or an application log. The person testing the application may not have direct access to that location.
I focus on identifying input fields that could be reviewed by other users or staff, such as feedback forms, support messages, and logged request headers.
Where the program permits it, an approved out-of-band testing service can help determine whether a test input reaches another execution context.
Tools such as Burp Collaborator or an authorized XSS callback service can assist with this process.
I keep blind XSS testing within the program's rules and avoid collecting sensitive information or accessing other users' data. A callback can be evidence worth investigating, but I still need to establish the affected context and realistic impact before assigning severity.
9. Investigating DOM-Based XSS
DOM-based XSS requires a different mindset because the problem may exist entirely in client-side JavaScript.
The server might return an ordinary page, while browser-side code reads data from a URL or another source and places it into the page unsafely.
I look for relationships between sources and sinks.
A source is a place where potentially untrusted data enters the JavaScript environment. Examples include location.hash and location.search.
A sink is a function or property that may interpret that data in an unsafe way. Examples include innerHTML and document.write.
I use browser developer tools and Burp DOM Invader to understand whether user-controlled data reaches a dangerous sink.
Finding a source or sink alone is not enough to confirm a vulnerability. I need to establish that untrusted data can reach the sink in a way that causes unsafe execution.
10. Understanding Filters and Security Controls
Sometimes an application blocks certain characters or removes potentially dangerous HTML elements.
When this happens, I first try to understand what the filter is designed to protect and whether the application uses proper output encoding or a maintained HTML sanitizer.
A filter that blocks a few specific strings may not provide sufficient protection. However, unusual input handling or an unexpected response is not proof of a bypass.
I examine the application's behavior in context and determine whether the protection remains effective after the input is processed.
I also check whether a Content Security Policy (CSP) is present. CSP can reduce the impact of some XSS attacks, but it should not replace secure output handling.
My focus is on identifying a genuine security weakness, not just finding a way to make the application accept unusual characters.
11. Testing Less Obvious XSS Entry Points
I also consider features that are easy to overlook during routine testing.
PDF generation: Some applications create invoices, reports, or other documents from user-controlled information. The security of the generated document depends on how the input is processed and which rendering engine is used.
Markdown conversion: User-submitted Markdown can become HTML. If unsafe content is not properly sanitized, the rendered output may introduce a vulnerability.
Administrative dashboards: Data that appears harmless to a regular user may be displayed differently in an internal interface. The security of that second rendering context also matters.
Client-side URL handling: Redirect parameters and URL fragments may be processed by JavaScript. I investigate whether those values are safely validated and handled.
These areas do not guarantee an XSS finding, but they help me look beyond the most obvious input fields.
12. Validating a Finding Before Reporting It
A possible XSS issue is not ready for a bug bounty report until I have enough evidence to explain what is happening.
My validation process focuses on the following questions:
- Can I reproduce the behavior consistently?
- Is the input controlled by me?
- Does it actually lead to JavaScript execution, or is it only reflected?
- Which user or browser context is affected?
- Does the issue require authentication or a particular user interaction?
- What is the realistic security impact?
- Can I demonstrate the problem without exposing sensitive information or affecting other users?
I use the minimum proof necessary to establish the vulnerability. A harmless proof of execution is generally preferable to a demonstration that collects cookies, accesses private data, or performs unauthorized actions.
If a scanner reports a potential issue but I cannot reproduce the behavior, I investigate further rather than reporting it as a confirmed vulnerability.
13. Writing a Clear XSS Bug Bounty Report
A good report should make the issue easy for the security team to understand and reproduce.
I normally organize my report into these sections:
Title: A short description of the vulnerability and the affected feature.
Summary: Explain what is happening and why it creates a security risk.
Affected endpoint: Include the relevant URL, parameter, or feature.
Steps to reproduce: Describe the minimum steps needed to reproduce the behavior in the authorized testing environment.
Proof of concept: Include sanitized request and response evidence or a screenshot showing the confirmed behavior.
Impact: Explain who could be affected and what an attacker could realistically achieve.
Recommended fix: Suggest an appropriate remediation based on the root cause.
I avoid assigning severity based only on the fact that JavaScript executes. Severity depends on the application's context, the privileges of the affected user, the exploit conditions, and the realistic consequences.
A clear, reproducible report is much more useful than a report filled with complicated payloads but little evidence.
14. How I Would Fix XSS
From a defensive perspective, the best solution is to prevent untrusted data from being interpreted as executable content.
The appropriate fix depends on how the application handles the input.
Common recommendations include:
- Apply context-aware output encoding wherever untrusted data is rendered.
- Use safe DOM APIs such as
textContentwhen inserting plain text. - Avoid unsafe HTML insertion and JavaScript evaluation functions.
- If HTML input is required, use a reputable, maintained HTML sanitizer with an appropriate configuration.
- Validate URLs and restrict dangerous URL schemes where applicable.
- Apply a suitable Content Security Policy as an additional security layer.
- Test the fix against the original proof of concept and related input contexts.
Input validation is useful, but it should not be the only defense. An application must also handle output safely.
15. My Final Thoughts on XSS Hunting
The biggest lesson I have learned is that XSS hunting is not just about finding a payload that works.
It is about understanding how data moves through an application, identifying unsafe rendering behavior, and proving that the behavior creates a real security problem.
Reconnaissance helps me discover possible entry points. Manual testing helps me understand the context. Automation helps me work faster, while validation helps me separate genuine vulnerabilities from false positives.
I also believe that report quality matters. A clear explanation, a reliable proof of concept, and a realistic impact assessment help a security team understand the issue and work toward a fix.
If you are learning bug bounty hunting, I recommend starting with the fundamentals, practicing in legal training labs, and focusing on understanding why a vulnerability exists instead of memorizing payloads.
The goal is not simply to find more inputs. It is to understand which inputs create a real security risk and explain that risk clearly.
AI assistance:_ I used an AI-powered grammar and spelling checker to review this article. The ideas, research, technical analysis, and final content are my own._
Have questions or want to share your own workflow? Drop a comment below or connect with me on :
🔗Linkdin: https://www.linkedin.com/company/sam-shield/
🔗Youtube: https://www.youtube.com/@sam_shield-w7l
🔗Medium: https://medium.com/@samadhanshimple