Cross-Site Scripting (XSS) | Computer Security
XSS is a class of attacks where an attacker injects malicious JavaScript onto a webpage. When a victim user loads the webpage, the user’s browser will run the malicious JavaScript. XSS attacks are powerful because they subvert the same-origin policy. Normally, an attacker can only run JavaScript on websites they control (such as https://evil.com), so their JavaScript cannot affect websites with origins different from https://evil.com. However, if the attacker can inject JavaScript into https://google.com, then when a user loads https://google.com, their browser will run the attacker’s JavaScript with the origin of https://google.com. XSS attacks allow malicious JavaScript to run in the user’s browser with the same origin as a legitimate website. This allows the attacker to perform any action the user can perform at https://google.com or steal any user secrets associated with Google and send them back to the attacker. There are two main categories of XSS attacks: stored XSS and reflecte
Cross-Site Scripting (XSS) | Computer Security Skip to main content Menu Expand (external link) Document Search Copy Copied Computer Security 22. Cross-Site Scripting (XSS) XSS is a class of attacks where an attacker injects malicious JavaScript onto a webpage. When a victim user loads the webpage, the user’s browser will run the malicious JavaScript. XSS attacks are powerful because they subvert the same-origin policy. Normally, an attacker can only run JavaScript on websites they control (such as https://evil.com ), so their JavaScript cannot affect websites with origins different from https
Explore this link on the map →saved by
related reading
- Cross-Site Request Forgery (CSRF) | Computer Securitytextbook.cs161.org
- Mitigating Memory-Safety Vulnerabilities | Computer Securitytextbook.cs161.org
- Understanding The Web Security Model, Part III: Basic Principles and the Origin Concepteducatedguesswork.org
- All learning materials - detailed | Web Security Academyportswigger.net
- Understanding The Web Security Model, Part IV: Cross-Origin Resource Sharing (CORS)educatedguesswork.org
- GitHub RCE Vulnerability: CVE-2026-3854 Breakdown | Wiz Blogwiz.io
- What is CORS? Complete Tutorial on Cross-Origin Resource Sharingauth0.com
- When Intrusions Don’t Align: A New Water Watering Hole and Oldsmar | Dragosdragos.com
- Part 2: Complete User Authentication: Sessions vs JWT | by Nick Jagodzinski | Mediummedium.com
- Introduction to CORS for Go programmers - Eli Bendersky's websiteeli.thegreenplace.net
- research!rsc: Timeline of the xz open source attackresearch.swtch.com
- How to Build a Personal Webpage from Scratch – Alex Rutarrutar.org