# CVE-2021-23639: Remote Code Execution (RCE)

- Severity: Critical 9.8 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 5.41%, higher than 92% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2021-12-10T20:05:16.643Z
- Modified: 2026-07-08T06:49:43.151Z
- Also known as: GHSA-x949-7cm6-fm6p, SNYK-JS-MDTOPDF-1657880
- Weaknesses: CWE-94
- Assigned by: snyk

## Description

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.

(As written by CVE List.)

## Affected

- md-to-pdf: from unspecified before 5.0.0
- md-to-pdf (npm): before 5.0.0
- markdown_to_pdf_project markdown_to_pdf: before 5.0.0

## Every score

- snyk: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 7.5 High `AV:N/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://snyk.io/vuln/SNYK-JS-MDTOPDF-1657880> (exploit, patch, third-party-advisory, web)
- <https://github.com/simonhaenisch/md-to-pdf/issues/99> (exploit, issue-tracking, patch, third-party-advisory, web)
- <https://github.com/simonhaenisch/md-to-pdf/commit/a716259c548c82fa1d3b14a3422e9100619d2d8a> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-23639> (advisory)
- <https://github.com/simonhaenisch/md-to-pdf> (package)

## Sources

- CVE List: [CVE-2021-23639](https://www.cve.org/CVERecord?id=CVE-2021-23639), CVE Terms of Use, modified 2024-09-17
- GitHub Advisory Database: [GHSA-x949-7cm6-fm6p](https://github.com/advisories/GHSA-x949-7cm6-fm6p), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-23639](https://nvd.nist.gov/vuln/detail/CVE-2021-23639), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-23639 · Whole record: https://cve.day/CVE-2021-23639.json · Rebuilt by cve.day 2026-11-25T22:58:05.927Z
