Skip to content

Upgrade to SnakeYaml 2.2 and use SafeConstructor to mitigate CVE-2022-1471

Related links:

It seems passing SafeConstructor to Yaml instances makes them safe, even in 1.x versions, regarding this particular CVE. The only problem with just using SafeConstructor is that the 1.x versions will still be tagged with a CVE and scanners will not ignore that so the version upgrade is also necessary.

Note that 2.0 changes the default Yaml constructor so that it will use SafeConstructor so after upgrading the library, no code changes to Yaml construction should be needed unless you've been dealing with custom Java classes already in your use case.

Edited by Tuukka Lehtonen