Lesson 2.1

Cross-site scripting (XSS)

XSS is attacker-controlled content executing as script in your page. Contextual output encoding is the fix; blocklists are not.

Duration
19m
Level
Intermediate
Students
11k students

Overview

XSS is attacker-controlled content executing as script in your page. Contextual output encoding is the fix; blocklists are not.

In this lesson you will:

  • Tell stored, reflected, and DOM-based XSS apart
  • Encode output for the context it lands in
  • Constrain script sources with a content security policy

Resources

OWASP Top 10

The official reference for the tools used in this lesson.