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

- Severity: Medium 5.4 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.11%, higher than 66% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 3 links below, marked "exploit"
- Published: 2021-06-17T16:25:11.000Z
- Modified: 2026-07-08T06:29:25.123Z
- Also known as: GHSA-xfrw-hxr5-ghqf, PYSEC-2021-103
- Weaknesses: CWE-79
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- wagtail wagtail: < 2.11.8; >= 2.12, <= 2.12.4; >= 2.13, <= 2.13.1
- wagtail (PyPI): before 2.11.8; from 2.12 before 2.12.5; from 2.13 before 2.13.2
- torchbox wagtail: before 2.11.8; from 2.12 up to 2.12.4; from 2.13 up to 2.13.1

## Every score

- GitHub_M: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 3.5 Low `AV:N/AC:M/Au:S/C:N/I:P/A:N`

## References

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

## Sources

- CVE List: [CVE-2021-32681](https://www.cve.org/CVERecord?id=CVE-2021-32681), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-xfrw-hxr5-ghqf](https://github.com/advisories/GHSA-xfrw-hxr5-ghqf), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-32681](https://nvd.nist.gov/vuln/detail/CVE-2021-32681), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-103](https://osv.dev/vulnerability/PYSEC-2021-103), CC-BY-4.0, modified 2026-06-08

---

Page: https://cve.day/CVE-2021-32681 · Whole record: https://cve.day/CVE-2021-32681.json · Rebuilt by cve.day 2026-11-25T22:58:01.986Z
