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


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.12% (47th percentile)

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);

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.5 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    None
  • Availability (A)
    High
Expand this section

NVD

7.5 high