{"id":"CVE-2026-42052","aliases":["CVE-2026-42052","GHSA-3gxm-wfjx-m847","PYSEC-2026-2397"],"related":[],"kind":"vulnerability","state":"published","title":"beets is Vulnerable to XSS","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"During code logic analyis, an area that may lead to unintended behavior under specific conditions was discovered. \n\n## Overview\n- Verified Version: `80cd21554124da07d17a4f962c7d770a4f70d0f2`\n- Vulnerability Type: Stored XSS\n- Affected Location: `beetsplug/web/templates/index.html:42`\n- Trigger Scenario: Metadata fields such as `title`, `lyrics`, or `comments` are rendered with raw template interpolation and inserted into DOM via `.html(...)`.\n\n## Root Cause\nThe 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.\n\n## Source-to-Sink Chain\n1. Source (attacker-controlled input)\n- Item metadata values (for example `title`, `lyrics`, `comments`) can contain attacker HTML payload.\n\n2. Data flow\n- Templates in `beetsplug/web/templates/index.html:42-46,87-91` render metadata with `<%= ... %>`.\n- Underscore runtime defines `<%= ... %>` as raw interpolation (`beetsplug/web/static/underscore.js:890-907`).\n\n3. Sink (security-sensitive action)\n- Frontend inserts rendered template output into DOM via `$(this.el).html(this.template(this.model.toJSON()));` in `beetsplug/web/static/beets.js:182,208,220`.\n\n## Exploitation Preconditions\n1. Victim opens the web UI page that renders attacker-controlled metadata.\n2. Metadata includes executable HTML/JS payload.\n\n## Risk\nStored payload executes in the web UI context and can perform actions available to that origin.\n\n## Impact\nAttacker can run arbitrary JavaScript in the victim browser, exfiltrate viewable data, and perform UI-driven actions as the victim session.\n\n## Remediation\n1. Replace raw interpolation `<%= ... %>` with escaped output `<%- ... %>` for untrusted fields.\n2. Avoid `.html(...)` for untrusted template output; use text-safe rendering.\n3. Sanitize metadata values on ingest and before rendering, including attribute contexts.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Beets es el sistema de gestión de bibliotecas multimedia. Antes de la versión 2.10.0, la interfaz de usuario web incluida utiliza el modo de interpolación de plantillas de Underscore <%= ... %> para campos de metadatos no confiables. En este entorno de ejecución, <%= ... %> es una inserción directa y el escape de HTML solo lo realiza <%- ... %>. La salida renderizada se inserta luego con .html(...), permitiendo que el marcado controlado por el atacante se convierta en DOM activo. Este problema ha sido parcheado en la versión 2.10.0.","source":"nvd"}],"published":"2026-04-29T18:29:00.000Z","modified":"2026-10-26T19:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 2.10.0","status":"affected"}],"vendor":"beetbox","product":"beets","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.10.0"}],"ecosystem":"PyPI","package":"beets","purl":"pkg:pypi/beets","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.10.0"}],"ecosystem":"PyPI","package":"beets","purl":"pkg:pypi/beets","source":"pysec"}],"references":[{"url":"https://github.com/beetbox/beets/security/advisories/GHSA-3gxm-wfjx-m847","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/beetbox/beets/releases/tag/v2.10.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2026/06/msg00030.html","tags":["web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42052","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/beetbox/beets","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/beets","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-3gxm-wfjx-m847","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-05T13:07:05.509Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42052","url":"https://www.cve.org/CVERecord?id=CVE-2026-42052","licence":"CVE Terms of Use","modified":"2026-06-23T21:33:30.608Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3gxm-wfjx-m847","url":"https://github.com/advisories/GHSA-3gxm-wfjx-m847","licence":"CC-BY-4.0","modified":"2026-07-13T16:43:02.903Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42052","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42052","licence":"Public domain","modified":"2026-10-26T19:10:00.163Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2397","url":"https://osv.dev/vulnerability/PYSEC-2026-2397","licence":"CC-BY-4.0","modified":"2026-07-13T16:31:38.628Z"}],"updatedAt":"2026-11-25T22:59:20.539Z","epss":{"score":0.00312,"percentile":0.26012,"date":"2026-12-01T12:00:22.000Z"}}