CVE-2021-32681

CVE-2021-32681 is a medium-severity cross-site scripting (XSS) vulnerability in wagtail (pip), affecting versions < 2.11.8. It is fixed in 2.11.8, 2.12.5, 2.13.2.

Summary

Workarounds

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

Acknowledgements

Many thanks to Karen Tracey for reporting this issue.

For more information

If you have any questions or comments about this advisory:

Impact

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

Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.

CVE-2021-32681 has a CVSS score of 5.4 (Medium). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.11.8, 2.12.5, 2.13.2); upgrading removes the vulnerable code path.

Affected versions

wagtail (< 2.11.8) wagtail (>= 2.12, < 2.12.5) wagtail (>= 2.13, < 2.13.2)

Security releases

wagtail → 2.11.8 (pip) wagtail → 2.12.5 (pip) wagtail → 2.13.2 (pip)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

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

Site implementors who wish to retain the existing behaviour of allowing editors to insert HTML content in these blocks (and are willing to accept the risk of untrusted editors inserting arbitrary code) may disable the escaping by surrounding the relevant {% include_block %} tag in {% autoescape off %}...{% endautoescape %}.

Frequently Asked Questions

  1. What is CVE-2021-32681? CVE-2021-32681 is a medium-severity cross-site scripting (XSS) vulnerability in wagtail (pip), affecting versions < 2.11.8. It is fixed in 2.11.8, 2.12.5, 2.13.2. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
  2. How severe is CVE-2021-32681? CVE-2021-32681 has a CVSS score of 5.4 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of wagtail are affected by CVE-2021-32681? wagtail (pip) versions < 2.11.8 is affected.
  4. Is there a fix for CVE-2021-32681? Yes. CVE-2021-32681 is fixed in 2.11.8, 2.12.5, 2.13.2. Upgrade to this version or later.
  5. Is CVE-2021-32681 exploitable, and should I be worried? Whether CVE-2021-32681 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2021-32681 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2021-32681?
    • Upgrade wagtail to 2.11.8 or later
    • Upgrade wagtail to 2.12.5 or later
    • Upgrade wagtail to 2.13.2 or later

Other vulnerabilities in wagtail

CVE-2026-44200CVE-2026-44199CVE-2026-44198CVE-2026-44197CVE-2026-28223

Stop the waste.
Protect your environment with Kodem.