CVE-2021-23639

Remote Code Execution (RCE)

Critical · published December 10, 2021

CVSS v3.1
9.8
EPSS
5%
Percentile
92.7
In the wild
Unconfirmed
What it is

🔥 A sneaky oversight in md-to-pdf could let an attacker execute their own code — and it’s as simple as a crafted markdown file! Think of it like a restaurant that lets diners send in secret recipes without checking the ingredients — one bad dish could spoil the whole menu! If exploited, an attacker could take control of the server, leading to unauthorized data access, manipulation, or even complete server compromise. This is absolutely devastating because it not only endangers your application but also puts your users' data at risk!

Put simply

Think of it like a restaurant that lets diners send in secret recipes without checking the ingredients — one bad dish could spoil the whole menu! The vulnerability in md-to-pdf stems from its use of the gray-matter library for parsing front matter without disabling the JavaScript engine, allowing attackers to inject malicious scripts through specially crafted markdown files.

What to do

If exploited, an attacker could take control of the server, leading to unauthorized data access, manipulation, or even complete server compromise. This is absolutely devastating because it not only endangers your application but also puts your users' data at risk! To remediate this, upgrade md-to-pdf to version 5.0.0 or later immediately. Additionally, ensure that any markdown parsing disables the JavaScript engine to prevent code execution from user inputs. It’s crucial to audit any code that processes markdown files for safety. You've got this! By taking these steps, you'll safeguard your application and maintain your hero status in securing the web! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.05413 · 92.7th percentile
Published
2021-12-10T20:05Z
EPSS history
Timeline
  • 10 DEC 20:05Z
    Remote Code Execution (RCE)
    cvelistv5