CVE-2021-23639
CRITICAL 9.8CVSS 3.1Code Injection in md-to-pdf.
The package md-to-pdf before 5.0.0 are vulnerable to Remote Code Execution (RCE) due to utilizing the library gray-matter to parse front matter content, without disabling the JS engine.
- Published
- 10 Dec 2021
- Last modified
- 8 Jul 2026
- Assigned by
- report@snyk.io
- NVD status
- Modified
- Weakness
- CWE-94
- Also known as
- GHSA-x949-7cm6-fm6pSNYK-JS-MDTOPDF-1657880
- Sources
- NVDJSONOSV GHSA-x949-7cm6-fm6pJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | report@snyk.io (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | HIGH 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | markdown_to_pdf_project | markdown_to_pdfcpe:2.3:a:markdown_to_pdf_project:markdown_to_pdf:*:*:*:*:*:node.js:*:* |
< 5.0.0 | 5.0.0 |
| OSV | npm | md-to-pdf | < 5.0.0 | 5.0.0 |
References
- https://github.com/simonhaenisch/md-to-pdf/commit/a716259c548c82fa1d3b14a3422e9100619d2d8a · Patch, Third Party Advisory, WEB
- https://github.com/simonhaenisch/md-to-pdf/issues/99 · Exploit, Issue Tracking, Patch, Third Party Advisory, WEB
- https://snyk.io/vuln/SNYK-JS-MDTOPDF-1657880 · Exploit, Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-23639 · ADVISORY
- https://github.com/simonhaenisch/md-to-pdf · PACKAGE
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 10 Dec 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 16 Dec 2021)