TOPIC 02/1918 MINNOT STARTED

Web vulnerability classes: XSS, CSRF, CORS and clickjacking

Four ways the web can be tricked: script in a page, a forged request, a loose sharing rule and a hidden frame. Learn what each is and the safe check for each.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: different ways a forged letter can reach a mailroom. One letter has a fake stamp. One looks like it came from the boss. One is hidden inside another envelope. The mailroom must spot each trick in its own way.

Daily List is a to-do list app. Tom, the tester, has to test its test copy. He looks at four tricks. A task title that the page treats as code. A request the browser sends without the person meaning it. A sharing rule that is too loose. A page hidden inside another page.

Each trick has a name. The names are , , cross-origin resource sharing and clickjacking. Tom learns what each one means and one safe check for each.

The picture has a limit. A mailroom sees one letter at a time. A browser handles many requests at once, from many sites.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PLAIN WORDS · 2 in this section
mailroom
the room where post is sorted
clickjacking
tricking a visitor into clicking a hidden page

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Knowing four different tricks that can reach a web app, and one safe check for each.

  1. Input as code
  2. Forged request
  3. Loose sharing rule
  4. Hidden frame
Four tricks, four different locks

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A fake stampInput treated as code (cross-site scripting)
A letter that looks like it came from the bossA forged request
A mailroom door left open to other officesA loose sharing rule
A letter hidden in another envelopeA page hidden in a frame

WHERE THIS PICTURE STOPS

  • A mailroom sees one letter at a time. A browser handles many requests at once.
  • Real tricks are often combined, but the picture shows them one by one.
  • Each trick has its own defence. A single lock is never the whole answer.

HOOK

Four tricks, four different locks.

REMEMBER IT THIS WAY

A chunk: a long list grouped so it is easier to hold.

Four tricks, four looks: code hiding in a title, a request nobody meant, a sharing rule too loose, a page hidden inside another.

What each part of the trick stands for
In the trickWhat it stands for
Code hiding in a titlecross-site scripting
A request nobody meantcross-site request forgery
A sharing rule too loosecross-origin resource sharing
A page hidden inside anotherclickjacking

TELL A FRIEND

A mailroom meets four tricks: a fake stamp, a forged sender, a door left open and a letter hidden in another envelope. Each needs its own check.

OFTEN MIXED UP WITH Hostile input and injection ideas. The injection lesson teaches input handling in general. This lesson names four web weaknesses and for each.

Sources & standards — 6 sources
  1. Market practice

    Cross site scripting prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · Framework security, context-specific output encoding, sanitisation and safe sinks; actual selected sections read6 November2026.

    Per the search excerpt, output encoding that matches the place the data lands (page text, script, address, style) is the main defence, and the framework's own encoding is the place to start. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read framework security, context-specific output encoding, sanitisation and safe-sink sections. HTML interpretation alone does not establish script execution; intentionally accepted rich HTML needs appropriate sanitisation.

  2. Market practice

    Cross site request forgery prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · Token/session binding, signed double-submit, Fetch Metadata with fallback, custom headers/CORS and origin/SameSite sections; read6 November2026.

    Per the search excerpt, a forged request makes a signed-in user's browser perform an unwanted action, and the main defence is a secret, unpredictable token tied to the session that the server checks on each request that changes something. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read token/session binding, signed double-submit, Fetch Metadata/fallback, custom-header/CORS and origin/SameSite sections. Missing a token alone does not show all configured defences absent.

  3. Market practice

    Cross-Origin Resource Sharing (CORS) (MDN Web Docs) ↗ — Mozilla · Functional overview and simple, preflighted and credentialed request examples; actual body and original source SVGs reviewed6 November2026.

    Official description of CORS and preflight. · Checked 2026-10-19

    Found through a web search; the page was not opened (pending verification: official page not opened and not searched (web-search limit reached before the check); URL is the publisher's known address). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read functional overview, simple/preflight/credentialed examples and browser response access. Original three SVGs inspected privately. Wildcard origin cannot authorise a credentialed browser response; some requests reach the server without preflight.

  4. Market practice

    DOM-based XSS: sources, sinks and stored/reflected data ↗ — PortSwigger · Actual DOM-based XSS explanation, including the section combining DOM processing with reflected and stored data; read6 November2026.

    DOM processing can use reflected or stored data; unsafe browser sinks and server response inspection have different coverage. Actual relevant sections reviewed; examples were not executed. · Checked 2026-11-06

    Actual primary source sections reviewed on 6 November 2026 for the V34 Security domain analysis. The source describes guidance for its own context, not a guarantee that a test proves complete security. No source example was executed.

  5. Market practice

    What is clickjacking? (PortSwigger Web Security Academy) ↗ — PortSwigger · Actual definition, CSRF-token distinction and X-Frame-Options/CSP frame-ancestors prevention sections; read6 November2026.

    Explains clickjacking as a page loaded in a hidden frame over a decoy page, so a click lands on the hidden page. Says CSRF tokens do not stop it. Names the X-Frame-Options header and the CSP frame-ancestors directive as the usual defences. Vendor teaching site, free. Practitioner or vendor guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read actual definition, real user action in hidden frames, CSRF-token distinction and effective X-Frame-Options/CSP frame-ancestors controls.

  6. Market practice

    OWASP Top 10:2025 Introduction ↗ — OWASP · 2025 edition introduction/change list; preserve2021 rankings under their own edition label; actual page read6 November2026.

    Actual edition introduction and change list: A01 broken access control, A03 software supply-chain failures and A05 injection. The 2021 edition remains a separate legitimate historical basis. · Checked 2026-11-06

    Actual primary source sections reviewed on 6 November 2026 for the V34 Security domain analysis. The source describes guidance for its own context, not a guarantee that a test proves complete security. No source example was executed.

PRACTISE AND KEEP

Sources for this topic — 15 sources
  1. Market practice

    Cross-site scripting (PortSwigger Web Security Academy) ↗ — PortSwigger · Cross-site scripting: input returned or stored and then run as script in another person's browser; reflected, stored and DOM-based kinds (search excerpt, page not opened)

    Explains cross-site scripting as input returned or stored and then run as script in another person's browser, with reflected, stored and Document Object Model (DOM)-based kinds. Vendor teaching site, free. Practitioner or vendor guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Cross site request forgery prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · Token/session binding, signed double-submit, Fetch Metadata with fallback, custom headers/CORS and origin/SameSite sections; read6 November2026.

    Per the search excerpt, a forged request makes a signed-in user's browser perform an unwanted action, and the main defence is a secret, unpredictable token tied to the session that the server checks on each request that changes something. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read token/session binding, signed double-submit, Fetch Metadata/fallback, custom-header/CORS and origin/SameSite sections. Missing a token alone does not show all configured defences absent.

  3. Market practice

    What is CORS (cross-origin resource sharing)? (PortSwigger Web Security Academy) ↗ — PortSwigger · Cross-origin resource sharing extends the same-origin policy; a badly set policy can expose data; cross-origin resource sharing is not a defence against cross-site request forgery (search excerpt, page not opened)

    Says CORS extends the same-origin policy, that a badly set policy such as a reflected origin with credentials can expose data, and that CORS is not a defence against CSRF. Vendor teaching site, free. Practitioner or vendor guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    What is clickjacking? (PortSwigger Web Security Academy) ↗ — PortSwigger · Actual definition, CSRF-token distinction and X-Frame-Options/CSP frame-ancestors prevention sections; read6 November2026.

    Explains clickjacking as a page loaded in a hidden frame over a decoy page, so a click lands on the hidden page. Says CSRF tokens do not stop it. Names the X-Frame-Options header and the CSP frame-ancestors directive as the usual defences. Vendor teaching site, free. Practitioner or vendor guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read actual definition, real user action in hidden frames, CSRF-token distinction and effective X-Frame-Options/CSP frame-ancestors controls.

  5. Market practice

    Open Worldwide Application Security Project (OWASP) Top 10:2021, introduction ↗ — Open Worldwide Application Security Project (OWASP) · The Top 10 list is revised between editions, so the edition must be named (search excerpt, page not opened)

    Per the search excerpt, the 2021 edition ranks broken access control first and injection third, with cross-site scripting folded into injection. The list changes between editions, so check the current one. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: 2021 edition. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  6. Market practice

    Testing for Reflected Cross Site Scripting (WSTG v4.2) ↗ — OWASP · OWASP WSTG pages on reflected, stored and DOM-based XSS; the guide says manual review is needed for DOM-based because automated tools miss many cases. Search excerpts, pages not opened. Authorised, harmless-input testing only.

    How reflected XSS is tested by sending harmless crafted strings to each input and seeing whether the browser runs them. Authorised scope only. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  7. Market practice

    Testing for Stored Cross Site Scripting (WSTG v4.1) ↗ — OWASP · OWASP WSTG pages on reflected, stored and DOM-based XSS; the guide says manual review is needed for DOM-based because automated tools miss many cases. Search excerpts, pages not opened. Authorised, harmless-input testing only.

    Stored XSS: input is saved and shown to later visitors; tested through forms and a proxy and by reloading the display page. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  8. Market practice

    Testing for DOM-based Cross Site Scripting (WSTG v4.2) ↗ — OWASP · OWASP WSTG pages on reflected, stored and DOM-based XSS; the guide says manual review is needed for DOM-based because automated tools miss many cases. Search excerpts, pages not opened. Authorised, harmless-input testing only.

    DOM-based XSS needs manual review of client-side code because automated tools miss many cases. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  9. Market practice

    Why does my JavaScript receive a CORS error while Postman does not? (Sentry) ↗ — Sentry · Sentry answers 'no Access-Control-Allow-Origin header error while Postman does not' and ApyHub CORS page (search excerpts, pages not opened). Official page checked 2026-10-19 by WebSearch: search excerpt, page not opened.

    CORS is enforced by the browser, not by Postman. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  10. Market practice

    What is CORS and why is it blocking my request? (ApyHub) ↗ — ApyHub · Sentry answers 'no Access-Control-Allow-Origin header error while Postman does not' and ApyHub CORS page (search excerpts, pages not opened). Official page checked 2026-10-19 by WebSearch: search excerpt, page not opened.

    Preflight OPTIONS and Access-Control-Allow-Origin. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  11. Market practice

    Cross-Origin Resource Sharing (CORS) (MDN Web Docs) ↗ — Mozilla · Sentry answers 'no Access-Control-Allow-Origin header error while Postman does not' and ApyHub CORS page (search excerpts, pages not opened). Official page checked 2026-10-19 by WebSearch: search excerpt, page not opened.

    Browsers decide whether script may read a cross-origin reply from CORS headers; preflight is an OPTIONS request. · Checked 2026-10-19

    Found through a web search; the page was not opened (search excerpt, page not opened). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  12. Market practice

    Cross-Origin Resource Sharing (CORS) (MDN Web Docs) ↗ — Mozilla · Functional overview and simple, preflighted and credentialed request examples; actual body and original source SVGs reviewed6 November2026.

    Official description of CORS and preflight. · Checked 2026-10-19

    Found through a web search; the page was not opened (pending verification: official page not opened and not searched (web-search limit reached before the check); URL is the publisher's known address). Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read functional overview, simple/preflight/credentialed examples and browser response access. Original three SVGs inspected privately. Wildcard origin cannot authorise a credentialed browser response; some requests reach the server without preflight.

  13. Market practice

    Cross site scripting prevention cheat sheet (Open Worldwide Application Security Project) ↗ — Open Worldwide Application Security Project (OWASP) · Framework security, context-specific output encoding, sanitisation and safe sinks; actual selected sections read6 November2026.

    Per the search excerpt, output encoding that matches the place the data lands (page text, script, address, style) is the main defence, and the framework's own encoding is the place to start. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    V34 review, 6 November 2026: Read framework security, context-specific output encoding, sanitisation and safe-sink sections. HTML interpretation alone does not establish script execution; intentionally accepted rich HTML needs appropriate sanitisation.

  14. Market practice

    DOM-based XSS: sources, sinks and stored/reflected data ↗ — PortSwigger · Actual DOM-based XSS explanation, including the section combining DOM processing with reflected and stored data; read6 November2026.

    DOM processing can use reflected or stored data; unsafe browser sinks and server response inspection have different coverage. Actual relevant sections reviewed; examples were not executed. · Checked 2026-11-06

    Actual primary source sections reviewed on 6 November 2026 for the V34 Security domain analysis. The source describes guidance for its own context, not a guarantee that a test proves complete security. No source example was executed.

  15. Market practice

    OWASP Top 10:2025 Introduction ↗ — OWASP · 2025 edition introduction/change list; preserve2021 rankings under their own edition label; actual page read6 November2026.

    Actual edition introduction and change list: A01 broken access control, A03 software supply-chain failures and A05 injection. The 2021 edition remains a separate legitimate historical basis. · Checked 2026-11-06

    Actual primary source sections reviewed on 6 November 2026 for the V34 Security domain analysis. The source describes guidance for its own context, not a guarantee that a test proves complete security. No source example was executed.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.