#!/usr/bin/env python3
"""
CVE-2026-22849 -- Saleor stored XSS via unsanitized rich text (EditorJS) fields
Advisory: GHSA-8jcj-r5g2-qrpv (https://github.com/saleor/saleor/security/advisories/GHSA-8jcj-r5g2-qrpv)
NOTE: The upstream researcher's repository (lukasz-rybak/CVE-2026-22849) ships only a
README-style advisory writeup with no standalone script. This file re-derives a
minimal, runnable PoC from that advisory's own description of the bug (Saleor accepts
and stores EditorJS-format "rich text" JSON for fields such as page/product
descriptions without running it through a backend HTML cleaner) so the technique can
be exercised against a test instance rather than only read about.
Technique
---------
Saleor represents rich text content (page bodies, product descriptions, etc.) as
EditorJS block JSON. Each block can carry raw inline HTML inside its "text"/"content"
values (e.g. a "paragraph" block). Saleor is supposed to run these fields through a
server-side HTML cleaner before persisting/rendering them, but the vulnerable
versions skip that step, so a block containing an
/