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. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.11% (45th 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 Learn

Learn about Uncaught Exception vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-YAML-5458867
  • published24 Apr 2023
  • disclosed24 Apr 2023
  • creditNazar Vinnichuk

Introduced: 24 Apr 2023

CVE-2023-2251  (opens in a new tab)
CWE-248  (opens in a new tab)

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