zio-json-yaml uses SnakeYaml 1.33 which has a 9.8 CVE
fanf opened this issue · 5 comments
SnakeYaml 1.33 has a critical CVE that allows remote code execution (a good one, with a "run anything you want if your yaml file is parsed" level - see : https://www.veracode.com/blog/research/resolving-cve-2022-1471-snakeyaml-20-release-0)
zio-json-yaml uses the faulty new Yaml()
constructor.
The correction is either to update to snake-yaml
2.0 or to only use the safe constructors.
A user can't just force snake-yaml 2.0, it leads to the expected missing method exception.
The exception is the following:
Exception in thread "zio-fiber-44010" java.lang.NoSuchMethodError: org.yaml.snakeyaml.constructor.SafeConstructor: method 'void <init>()' not found
at zio.json.yaml.internal.YamlValueConstruction.<init>(YamlValueConstruction.scala:8)
snakeyaml removed deprecated constructor of SafeConstructor in 2.0
Replacing YamlValueConstruction by this line should fix the issue
private[yaml] final class YamlValueConstruction extends SafeConstructor(new LoaderOptions()) {
Any help here is appreciated, realistically, I can’t tackle this until Sunday.
I made a pull request here: #974
Since the PR is merged and v 0.6.0 was released with the correction, that ticket can be closed in success.