# GHSA-39vw-qp34-rmwf: Uncontrolled recursion leads to abort in deserialization

> An attacker can cause a denial of service by providing a YAML file with self-referencing aliases, triggering uncontrolled recursion and aborting the application.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Sep 2018
- **Also known as:** RUSTSEC-2018-0005

## What is GHSA-39vw-qp34-rmwf?

GHSA-39vw-qp34-rmwf is a denial of service vulnerability in serde_yaml, published on 17 Sep 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Affected versions of this crate did not properly check for recursion
while deserializing aliases.

This allows an attacker to make a YAML file with an alias referring
to itself causing an abort.

The flaw was corrected by checking the recursion depth.

## Which versions are affected by GHSA-39vw-qp34-rmwf?

3 open source packages ship an affected version, including serde_yaml.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `serde_yaml` | crates.io | From 0.6.0-rc1 | 0.8.4 |
| `serde_yaml` | crates.io | From 0.6.0-rc1 | 0.8.4 |
| `serde_yaml` | crates.io | From 0.6.0-rc1 | 0.8.4 |

## How do I fix GHSA-39vw-qp34-rmwf?

Upgrade serde_yaml to 0.8.4 or later.

## Is GHSA-39vw-qp34-rmwf being exploited?

There is no known exploitation of GHSA-39vw-qp34-rmwf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-39vw-qp34-rmwf and fix it if it is affected.

What it is: GHSA-39vw-qp34-rmwf is a denial of service vulnerability in serde_yaml, published on 17 Sep 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-39vw-qp34-rmwf in the wild and no public exploit code.

Affected packages and fixed versions:
- serde_yaml (crates.io): affected from 0.6.0-rc1; fixed in 0.8.4
- serde_yaml (crates.io): affected from 0.6.0-rc1; fixed in 0.8.4
- serde_yaml (crates.io): affected from 0.6.0-rc1; fixed in 0.8.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-39vw-qp34-rmwf/ (Markdown: https://insights.sbomify.com/GHSA-39vw-qp34-rmwf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-39vw-qp34-rmwf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-39vw-qp34-rmwf/
Summaries are generated and may contain mistakes; the official description above is the record.
