Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. org.yaml/snakeyaml
  4. ›
  5. CVE-2022-1471

CVE-2022-1471: SnakeYaml Constructor Deserialization Remote Code Execution

December 12, 2022 (updated February 13, 2025)

SnakeYaml’s Constructor class, which inherits from SafeConstructor, allows any type be deserialized given the following line:

new Yaml(new Constructor(TestDataClass.class)).load(yamlContent);

Types do not have to match the types of properties in the target class. A ConstructorException is thrown, but only after a malicious payload is deserialized.

References

  • bitbucket.org/snakeyaml/snakeyaml
  • bitbucket.org/snakeyaml/snakeyaml/commits/5014df1a36f50aca54405bb8433bc99a8847f758
  • bitbucket.org/snakeyaml/snakeyaml/commits/acc44099f5f4af26ff86b4e4e4cc1c874e2dc5c4
  • bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in
  • bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in
  • bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in
  • bitbucket.org/snakeyaml/snakeyaml/wiki/CVE-2022-1471
  • github.com/advisories/GHSA-mjmj-j48q-9wg2
  • github.com/google/security-research/security/advisories/GHSA-mjmj-j48q-9wg2
  • github.com/mbechler/marshalsec
  • groups.google.com/g/kubernetes-security-announce/c/mwrakFaEdnc
  • nvd.nist.gov/vuln/detail/CVE-2022-1471
  • security.netapp.com/advisory/ntap-20230818-0015
  • security.netapp.com/advisory/ntap-20240621-0006
  • snyk.io/blog/unsafe-deserialization-snakeyaml-java-cve-2022-1471
  • www.github.com/mbechler/marshalsec/blob/master/marshalsec.pdf?raw=true

Code Behaviors & Features

Detect and mitigate CVE-2022-1471 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.0

Fixed versions

  • 2.0

Solution

Upgrade to version 2.0 or above.

Impact 8.3 HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation
  • CWE-502: Deserialization of Untrusted Data

Source file

maven/org.yaml/snakeyaml/CVE-2022-1471.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:50 +0000.