# CVE-2021-32681: Improper escaping of HTML ('Cross-site Scripting') in Wagtail StreamField blocks

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.4
- **CVSS:** 5.4 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, login needed
- **EPSS:** 1.11% (percentile 66, 2026-11-26)
- **CWE:** CWE-79
- **Aliases:** GHSA-xfrw-hxr5-ghqf, PYSEC-2021-103
- **Published:** 2021-06-17T16:25:11.000Z
- **Modified:** 2026-07-08T06:29:25.123Z

## 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

## 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

- PyPI `wagtail`: affected \< 2.11.8; fixed 2.11.8, 2.12.5, 2.13.2 (osv)
- wagtail: \< 2.11.8; \>= 2.12, \<= 2.12.4; \>= 2.13, \<= 2.13.1 (cvelist)

## Mitigation

- Upgrade wagtail to one of 2.11.8, 2.12.5, 2.13.2 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- vendor: <https://github.com/wagtail/wagtail/security/advisories/GHSA-xfrw-hxr5-ghqf>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-32681>
- exploit: <https://github.com/wagtail/wagtail/releases/tag/v2.11.8>
- exploit: <https://github.com/wagtail/wagtail/releases/tag/v2.12.5>
- exploit: <https://github.com/wagtail/wagtail/releases/tag/v2.13.2>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/wagtail/PYSEC-2021-103.yaml>
- other: <https://github.com/wagtail/wagtail>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-32681>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-xfrw-hxr5-ghqf> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2021-103> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-32681> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-32681>
