Cross-Site Scripting (XSS) is a web security vulnerability that allows an attacker to inject malicious JavaScript into a web application. The malicious script is then executed in the browser of another user.
XSS allows attackers to bypass the Same Origin Policy (SOP), which normally prevents websites from interfering with each other.
The attacker tricks a vulnerable website into sending malicious JavaScript to users.
When the script runs in the victim’s browser, the attacker may:
XSS occurs when:
User Input → Vulnerable Application → Malicious Script Returned → Browser Executes Script