Is Cross-Site Scripting Still a Risk for Indian Websites?
Key takeaways
- XSS remains among the most frequently reported findings in web application penetration tests, because it is a coding habit rather than a platform flaw.
- A script running in your origin can read localStorage, so it can steal a session token and bypass a well-configured second factor entirely.
- Output encoding is the fix that always works; an input filter alone is routinely bypassed by a nested or unusual payload.
- A Content Security Policy with nonces is defence in depth, and it is the only control that limits the damage when an injection slips through.
- Stored XSS in a comment, review or support-ticket field can become a persistent credential-harvesting page served from your own domain.
As of 24 October 2026: the service descriptions, prices and turnaround figures on this page are current.
What are the XSS variants, and which one actually hurts?
Three. Reflected XSS, where input arrives in a request and is written into the response, usually through a search term, an error message or a redirect parameter. Stored or persistent XSS, where the payload is saved and served to other users, usually through a comment, a review, a product name, a profile field or a support ticket. And DOM-based XSS, where the sink is in client-side JavaScript that reads a value from the URL, a postMessage event or a local storage entry. Reflected XSS is largely a phishing vector. Stored XSS is the serious one, because your own domain becomes the delivery mechanism and the session is a genuine first-party session. DOM-based XSS is the one testers find most often in modern single-page applications, because the framework's templating protects the template but not the JavaScript that handles data.
Why is output encoding the fix that always works?
Because it removes the possibility rather than the instance. If every value is encoded for the context it lands in, then a payload is displayed as text rather than parsed as markup, whether it arrives in a query string, a JSON field, a stored record or a log file. Input validation and sanitisation are useful but fragile, because the same character has different meanings in HTML, in an attribute, in a URL, in JavaScript and in CSS, and because a blocklist of keywords is defeated by nesting and by encoding tricks. Contextual output encoding plus a proper templating engine that escapes by default, plus a Content Security Policy that does not allow inline script, is the combination that holds. A strict CSP with a nonce or hash per response is defence in depth, and it is what turns a missed encoding bug from a breach into an alert.
What is the business impact in India specifically?
Session theft is the expensive part, and it is expensive because it bypasses your second factor. A token sitting in localStorage is readable by any script on the origin, so a stored XSS in a review field can exfiltrate a customer session on a banking or e-commerce portal and act as the customer with a valid first-party session. For businesses, the second impact is credential theft on your own domain, which is far more convincing than a lookalike page, particularly when a deepfake or a genuine-looking email is used to deliver the link. And the third is regulatory exposure, because a script that reads form fields and exfiltrates personal data engages the Digital Personal Data Protection Act, 2023, where DPDP Rule 7 notification obligations commence from May 2027. That is a reportable personal data breach, not just a bug.
How should an application team test for XSS?
Test every input that is reflected or stored, and test the contexts rather than the payloads alone. Submit a payload in a query parameter, a form field, a JSON body, a file name, a header and a cookie value, then observe whether it is encoded in the response, whether it is stored and re-rendered, and whether the same value executed in the client-side script. Then check the controls: is there a CSP, does it allow inline script, does it use nonces or hashes, are cookies HttpOnly, and is localStorage being used for session state at all. At AAVETech this is a named test area inside a fixed-price web application penetration test at roughly Rs 12,000 to Rs 30,000 per tester-day plus 18% GST, delivered in 5 to 10 working days with a retest after your fixes and a signed rules-of-engagement document.
| Variant | Example | Impact | Fix |
|---|---|---|---|
| Reflected | Search term rendered in results | Phishing on your domain | Contextual output encoding |
| Stored | Review or comment field | Session theft from your own origin | Encoding on write and on render |
| DOM-based | Client-side script reading a URL parameter | Account takeover | Avoid sink functions, validate on the client |
| Any variant | Token readable by script | MFA bypass via stolen session | HttpOnly cookies, no tokens in localStorage |
What are the common questions about X?
Get a straight answer on this
Send us your application URLs and a test account for each role, and we will return a fixed-price web application penetration test scope with a signed rules of engagement.
Send us the details See pricing