CVE-2025-46654 Details
Description
CodiMD through 2.2.0 has a CSP-based protection mechanism against XSS through uploaded JavaScript content, but it can be bypassed by uploading a .html file that references an uploaded .js file.
A vulnerability exists in CodiMD versions through 2.2.0, allowing a bypass of the Content Security Policy (CSP) protection against Cross-Site Scripting (XSS) via uploaded JavaScript files. This is achieved by uploading an HTML file that references a previously uploaded JavaScript file. In CodiMD versions 2.5.4 to 2.2.1, the 'keepExtensions' option in the file upload feature allows the preservation of original file extensions, facilitating the upload of malicious files disguised as images. The vulnerability is exacerbated by the application's CSP configuration, which, while restricting inline scripts, fails to account for files uploaded to external servers like S3. In CodiMD versions through 2.2.0, the absence of proper file validation allows the upload of arbitrary file types, including those that can be exploited for XSS attacks.
Users are advised to implement their own security checks for file uploads, as the CodiMD maintainers have acknowledged this vulnerability but believe that upload validation is the responsibility of the user.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Apr 29, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/hackmdio/codimd/issues/1910 | CISA-ADP | ExploitIssue Tracking |
| https://github.com/hackmdio/codimd/issues/1910 | [email protected] | ExploitIssue Tracking |
| https://github.com/zast-ai/vulnerability-reports/blob/main/formidable/file_upload/report.md | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-424 | Improper Protection of Alternate Path | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| hackmd codimd | <= 2.2.0 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Aug 5, 2025 | Reanalysis | [email protected] |
| Jun 16, 2025 | Initial Analysis | [email protected] |
| Apr 29, 2025 | CVE Modified | CISA-ADP |
| Apr 26, 2025 | New CVE Received | [email protected] |