# CVE-2026-42052: beets is Vulnerable to XSS

> An attacker can inject malicious scripts into the web UI via untrusted metadata fields, potentially executing code in the victim's browser.

- **Severity:** Medium 6.0 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 4 May 2026
- **Updated:** 23 Jun 2026
- **Also known as:** DEBIAN-CVE-2026-42052, GHSA-3gxm-wfjx-m847, PYSEC-2026-2397, UBUNTU-CVE-2026-42052, USN-8747-1, openSUSE-SU-2026:10865-1, openSUSE-SU-2026:21383-1

## What is CVE-2026-42052?

CVE-2026-42052 is a medium-severity cross-site scripting vulnerability in beetbox beets, published on 4 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Beets is the media library management system. Prior to version 2.10.0, the bundled web UI uses Underscore template interpolation mode <%= ... %> for untrusted metadata fields. In this runtime, <%= ... %> is raw insertion and HTML escaping is only performed by <%- ... %>. Rendered output is then inserted with .html(...), allowing attacker-controlled markup to become active DOM. This issue has been patched in version 2.10.0.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2026-42052?

3 open source packages ship an affected version, including beets.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `beets` | PyPI | All versions | 2.10.0 |
| `beets` | PyPI | All versions | 2.10.0 |
| `beets` | PyPI | All versions | 2.10.0 |
| `beets` | openSUSE:Leap 16.0 | All versions | 2.2.0-bp160.2.1 |
| `beets` | openSUSE:Tumbleweed | All versions | 2.11.0-1.1 |

## How do I fix CVE-2026-42052?

Upgrade beets to 2.10.0 or later.

## Is CVE-2026-42052 being exploited?

There is no known exploitation of CVE-2026-42052 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-42052 and fix it if it is affected.

What it is: CVE-2026-42052 is a medium-severity cross-site scripting vulnerability in beetbox beets, published on 4 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-42052 in the wild and no public exploit code.

Affected packages and fixed versions:
- beets (PyPI): affected all versions; fixed in 2.10.0
- beets (PyPI): affected all versions; fixed in 2.10.0
- beets (PyPI): affected all versions; fixed in 2.10.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-42052/ (Markdown: https://insights.sbomify.com/CVE-2026-42052/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-42052
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-42052
- OSV: https://osv.dev/vulnerability/CVE-2026-42052

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-42052/
Summaries are generated and may contain mistakes; the official description above is the record.
