XSS (Cross-Site Scripting): A security vulnerability where an attacker injects malicious scripts into web pages viewed by other users. Prevented by escaping user-supplied output and using a Content Security Policy (CSP). Ranked in the OWASP Top 10. Cross-site scripting, XSS, happens when an attacker manages to get their own JavaScript running on your pages in other users' browsers. Typically, user input such as a comment or a name is shown on a page without being escaped, and it contains a script.
Frequently asked questions about XSS (Cross-Site Scripting)
How is XSS (Cross-Site Scripting) used in practice?
That script runs with the victim's session. It can read data on the page, perform actions as the user or send them to a fake login form. XSS has been in the OWASP Top 10 for many years.
What should you keep in mind with XSS (Cross-Site Scripting)?
The main defence is escaping output by default, which templating engines like Blade, Twig and React do automatically. Be very careful wherever you bypass that, such as {!! !!} in Blade or dangerouslySetInnerHTML in React. A strict Content-Security-Policy adds a second line of defence, and HttpOnly cookies keep session cookies out of reach of injected scripts.
OWASP Top 10 security audit and secure coding guidelines for Laravel + React/Inertia.js applications. Use when auditing for vulnerabilities ("run OWASP audit", "security review", "check my app security") or writing secure Laravel code involving auth, payments, file uploads, or API design. Triggers on security-related tasks, payment handling, authentication, or any request to audit a Laravel codeba
Master authentication and authorization patterns including JWT, OAuth2, session management, and RBAC to build secure, scalable access control systems. Use when implementing auth systems, securing APIs, or debugging security issues.
Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.