CVE-2021-32681
Improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks
Also known as GHSA-xfrw-hxr5-ghqf, PYSEC-2021-103
Mitigation
- Upgrade wagtail to one of 2.11.8, 2.12.5, 2.13.2 (or later in the same release line).
Who should check
- Projects that depend on PyPI package wagtail (< 2.11.8)
- Anyone running wagtail < 2.11.8; >= 2.12, <= 2.12.4; >= 2.13, <= 2.13.1
Vulnerability facts
- Affected
- wagtail < 2.11.8
- Fixed in
- 2.11.8, 2.12.5, 2.13.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, login needed
- CVSS
- 5.4 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: Low
- User interaction: Required
- Scope: Changed (impact reaches other components)
- Confidentiality impact: Low
- Integrity impact: Low
- Availability impact: None
- EPSS
- 1.11% chance of exploitation in 30 days (percentile 66, 2026-11-26)
- CWE
- CWE-79
- Modified
Description
Wagtail is an open source content management system built on Django. A cross-site scripting vulnerability exists in versions 2.13-2.13.1, versions 2.12-2.12.4, and versions prior to 2.11.8. When the `{% include_block %}` template tag is used to output the value of a plain-text StreamField block (`CharBlock`, `TextBlock` or a similar user-defined block derived from `FieldBlock`), and that block does not specify a template for rendering, the tag output is not properly escaped as HTML. This could allow users to insert arbitrary HTML or scripting. This vulnerability is only exploitable by users with the ability to author StreamField content (i.e. users with 'editor' access to the Wagtail admin). Patched versions have been released as Wagtail 2.11.8 (for the LTS 2.11 branch), Wagtail 2.12.5, and Wagtail 2.13.2 (for the current 2.13 branch). As a workaround, site implementors who are unable to upgrade to a current supported version should audit their use of `{% include_block %}` to ensure it is not used to output `CharBlock` / `TextBlock` values with no associated template. Note that this only applies where `{% include_block %}` is used directly on that block (uses of `include_block` on a block _containing_ a CharBlock / TextBlock, such as a StructBlock, are unaffected). In these cases, the tag can be replaced with Django's `{{ ... }}` syntax - e.g. `{% include_block my_title_block %}` becomes `{{ my_title_block }}`.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-32681. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-32681.md Affected: wagtail < 2.11.8 Fixed in: 2.11.8, 2.12.5, 2.13.2 Steps: 1. Search this machine and project for wagtail (PyPI), wagtail: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Exploits and PoCs
FAQ
Is CVE-2021-32681 being exploited?
There is no confirmed exploitation: CVE-2021-32681 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 1.11% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-32681?
Medium: CVSS 5.4 (v3.1, scored by CNA). Remote, login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2021-32681?
wagtail < 2.11.8.
Is there a fix for CVE-2021-32681?
Yes. Fixed in 2.11.8, 2.12.5, 2.13.2. Upgrade wagtail to one of 2.11.8, 2.12.5, 2.13.2 (or later in the same release line).
How do I check if I'm affected by CVE-2021-32681?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.