Uncaught Exception Affecting yaml package, versions >=2.0.0-4 <2.2.2 >=2.3.0-0 <2.3.0-5


0.0
high
0
10

Snyk CVSS

    Attack Complexity Low
    Availability High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.09% (40th percentile)
Expand this section
NVD
7.5 high

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-YAML-5458867
  • published 24 Apr 2023
  • disclosed 24 Apr 2023
  • credit Nazar Vinnichuk

How to fix?

Upgrade yaml to version 2.2.2, 2.3.0-5 or higher.

Overview

Affected versions of this package are vulnerable to Uncaught Exception due to improper validation of the input passed to the functions parseDocument and parseAllDocuments. Exploiting this vulnerability is possible when these functions are fed an invalid input with more than 80 carriage return characters (\r).

PoC

const yaml = require("yaml");
const string = "[" + "\r".repeat(80);
yaml.parseDocument(string);