# CVE-2019-25777: YAML versions before 1.27_001 for Perl allow a loaded perl/glob document to replace any package variable, which can lead to arbitrary code execution.

> Attackers can execute arbitrary Perl code by crafting malicious YAML documents that manipulate internal variables to enable code evaluation.

- **Severity:** High 7.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Oct 2026
- **Updated:** 6 Oct 2026
- **Also known as:** DEBIAN-CVE-2019-25777, GHSA-38xx-2hm6-vh7q, UBUNTU-CVE-2019-25777

## What is CVE-2019-25777?

CVE-2019-25777 is a high-severity unsafe deserialization vulnerability, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

YAML versions before 1.27_001 for Perl allow a loaded perl/glob document to replace any package variable, which can lead to arbitrary code execution.

A perl/glob document names a package and a symbol, and supplies the value assigned to it. Nothing restricts the name, so the target can be @INC or YAML's own load options.

A perl/glob document that sets $YAML::LoadCode or $YAML::UseCode turns on code loading, which is off by default, for every later Load() in the process. A perl/code document is then passed to a string eval, so an attacker who supplies two documents to separate Load() calls in one process can execute arbitrary Perl code.

Weakness: CWE-914 (Improper Control of Dynamically-Identified Variables), CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2019-25777?


## How do I fix CVE-2019-25777?

Upgrade to a fixed version.

## Is CVE-2019-25777 being exploited?

There is no known exploitation of CVE-2019-25777 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-25777 and fix it if it is affected.

What it is: CVE-2019-25777 is a high-severity unsafe deserialization vulnerability, published on 5 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2019-25777 in the wild and no public exploit code.

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/CVE-2019-25777/ (Markdown: https://insights.sbomify.com/CVE-2019-25777/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-25777
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-25777
- OSV: https://osv.dev/vulnerability/CVE-2019-25777

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-25777/
Summaries are generated and may contain mistakes; the official description above is the record.
