{"id":"CVE-2026-28222","aliases":["CVE-2026-28222","GHSA-p5cm-246w-84jm","PYSEC-2026-2307"],"related":[],"kind":"vulnerability","state":"published","title":"Wagtail: Improper escaping of HTML (Cross-site Scripting) on TableBlock class attributes","summary":"Wagtail is an open source content management system built on Django. Prior to versions 6.3.8, 7.0.6, 7.2.3, and 7.3.1, a stored cross-site scripting (XSS) vulnerability exists on rendering TableBlock blocks within a StreamField. A user with access to create or edit pages containing TableBlock StreamField blocks is able to set specially-crafted class attributes on the block which run arbitrary JavaScript code when the page is viewed. When viewed by a user with higher privileges, this could lead to performing actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites using TableBlock. This issue has been patched in versions 6.3.8, 7.0.6, 7.2.3, and 7.3.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Wagtail is an open source content management system built on Django. Prior to versions 6.3.8, 7.0.6, 7.2.3, and 7.3.1, a stored cross-site scripting (XSS) vulnerability exists on rendering TableBlock blocks within a StreamField. A user with access to create or edit pages containing TableBlock StreamField blocks is able to set specially-crafted class attributes on the block which run arbitrary JavaScript code when the page is viewed. When viewed by a user with higher privileges, this could lead to performing actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites using TableBlock. This issue has been patched in versions 6.3.8, 7.0.6, 7.2.3, and 7.3.1.","source":"cvelist"},{"lang":"en","text":"### Impact\nA stored Cross-site Scripting (XSS) vulnerability exists on rendering `TableBlock` blocks within a StreamField. A user with access to create or edit pages containing `TableBlock` StreamField blocks is able to set specially-crafted `class` attributes on the block which run arbitrary JavaScript code when the page is viewed. When viewed by a user with higher privileges, this could lead to performing actions with that user's credentials. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin, and only affects sites using TableBlock.\n\n### Patches\nPatched versions have been released as Wagtail 6.3.8, 7.0.6, 7.2.3 and 7.3.1.\n\n### Workarounds\nSite owners who are unable to upgrade to the new versions can remediate the vulnerability by setting a `template` attribute on all TableBlock definitions, referencing a template that does not output `class` attributes. For example:\n\n```django\n<!-- For use with TableBlock(template=\"path/to/table_block.html\") -->\n<table>\n    {% if table_caption %}\n        <caption>{{ table_caption }}</caption>\n    {% endif %}\n    {% if table_header %}\n        <thead>\n            <tr>\n                {% for cell in table_header %}\n                    <th scope=\"col\">{{ cell }}</th>\n                {% endfor %}\n            </tr>\n        </thead>\n    {% endif %}\n    <tbody>\n        {% for row in data %}\n            <tr>\n                {% for cell in row %}\n                    {% if first_col_is_header and forloop.first %}\n                        <th scope=\"row\">{{ cell }}</th>\n                    {% else %}\n                        <td>{{ cell }}</td>\n                    {% endif %}\n                {% endfor %}\n            </tr>\n        {% endfor %}\n    </tbody>\n</table>\n```\n\n### Acknowledgements\n\nMany thanks to Guan Chenxian (@GCXWLP) for reporting this issue.\n\n### For more information\n\nIf there are any questions or comments about this advisory:\n\n- Visit Wagtail's [support channels](https://docs.wagtail.io/en/stable/support.html)\n- Email Wagtail at [security@wagtail.org](mailto:security@wagtail.org) (view the [security policy](https://github.com/wagtail/wagtail/security/policy) for more information).","format":"markdown","source":"ghsa"},{"lang":"es","text":"Wagtail es un sistema de gestión de contenido de código abierto construido sobre Django. Antes de las versiones 6.3.8, 7.0.6, 7.2.3 y 7.3.1, existe una vulnerabilidad de cross-site scripting (XSS) almacenado al renderizar bloques TableBlock dentro de un StreamField. Un usuario con acceso para crear o editar páginas que contengan bloques TableBlock de StreamField puede establecer atributos de clase especialmente diseñados en el bloque que ejecutan código JavaScript arbitrario cuando se visualiza la página. Cuando es visualizado por un usuario con privilegios más altos, esto podría llevar a realizar acciones con las credenciales de ese usuario. La vulnerabilidad no es explotable por un visitante de sitio ordinario sin acceso al administrador de Wagtail, y solo afecta a los sitios que utilizan TableBlock. Este problema ha sido parcheado en las versiones 6.3.8, 7.0.6, 7.2.3 y 7.3.1.","source":"nvd"}],"published":"2026-03-03T17:57:18.000Z","modified":"2026-07-13T07:26:36.456Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 6.3.8","status":"affected"},{"version":">= 6.4rc1, < 7.0.6","status":"affected"},{"version":">= 7.1rc1, < 7.2.3","status":"affected"},{"version":">= 7.3rc1, < 7.3.1","status":"affected"}],"vendor":"wagtail","product":"wagtail","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.3.8"}],"ecosystem":"PyPI","package":"wagtail","purl":"pkg:pypi/wagtail","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.4rc1","status":"affected","fixed":"7.0.6"}],"ecosystem":"PyPI","package":"wagtail","purl":"pkg:pypi/wagtail","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.1rc1","status":"affected","fixed":"7.2.3"}],"ecosystem":"PyPI","package":"wagtail","purl":"pkg:pypi/wagtail","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.3rc1","status":"affected","fixed":"7.3.1"}],"ecosystem":"PyPI","package":"wagtail","purl":"pkg:pypi/wagtail","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"6.3.8"},{"status":"affected","introduced":"6.4","fixed":"7.0.6"},{"status":"affected","introduced":"7.1","fixed":"7.2.3"},{"status":"affected","version":"7.3"},{"status":"affected","version":"7.3"}],"vendor":"torchbox","product":"wagtail","cpe":"cpe:2.3:a:torchbox:wagtail:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.3.8"},{"type":"ecosystem","introduced":"6.4","status":"affected","fixed":"7.0.6"},{"type":"ecosystem","introduced":"7.1","status":"affected","fixed":"7.2.3"}],"ecosystem":"PyPI","package":"wagtail","purl":"pkg:pypi/wagtail","source":"pysec"}],"references":[{"url":"https://github.com/wagtail/wagtail/security/advisories/GHSA-p5cm-246w-84jm","tags":["advisory","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/commit/0375094bb57ce6e527005c2bb2e871dd20bca04d","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/commit/4620423cb22c5253391a0f04178089c1162f6e2e","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/commit/575c0d7c18c7716ed73f7a3c2720ad75956f0a85","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/commit/605a5569686565e035313222e1bc2f9802fbc55b","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/releases/tag/v6.3.8","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/releases/tag/v7.0.6","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/releases/tag/v7.2.3","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/wagtail/wagtail/releases/tag/v7.3.1","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28222","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/wagtail/wagtail","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-03-06T18:05:22.577Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-28222","url":"https://www.cve.org/CVERecord?id=CVE-2026-28222","licence":"CVE Terms of Use","modified":"2026-03-06T18:05:28.611Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p5cm-246w-84jm","url":"https://github.com/advisories/GHSA-p5cm-246w-84jm","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:36.456Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-28222","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-28222","licence":"Public domain","modified":"2026-06-17T10:28:21.563Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2307","url":"https://osv.dev/vulnerability/PYSEC-2026-2307","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:46.687Z"}],"updatedAt":"2026-11-25T22:59:15.331Z","epss":{"score":0.00514,"percentile":0.45317,"date":"2026-12-01T12:00:22.000Z"}}