# CVE-2022-36944: Scala subject to file deletion, code execution due to Java deserialization chain with LazyList object deserialization

> Attackers can exploit a deserialization gadget chain in the Scala library to execute arbitrary code or modify data when used in vulnerable applications.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Sep 2022
- **Updated:** 27 May 2025
- **Also known as:** GHSA-8qv5-68g4-248j, ROOT-APP-MAVEN-CVE-2022-36944

## What is CVE-2022-36944?

CVE-2022-36944 is a critical unsafe deserialization vulnerability in Fedoraproject Fedora, published on 23 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Scala 2.13.x before 2.13.9 has a Java deserialization chain in its JAR file. On its own, it cannot be exploited. There is only a risk in conjunction with Java object deserialization within an application. In such situations, it allows attackers to erase contents of arbitrary files, make network connections, or possibly run arbitrary code (specifically, Function0 functions) via a gadget chain.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2022-36944?

2 open source packages ship an affected version, including org.scala-lang:scala-library. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.scala-lang:scala-library` | Maven | From 2.13.0 | 2.13.9 |
| `org.scala-lang:scala-library` | Maven | From 2.13.0 | 2.13.9 |

Products: Fedoraproject Fedora, Scala-Lang Scala, Scala-Lang Scala-Collection-Compat.

## How do I fix CVE-2022-36944?

Upgrade org.scala-lang:scala-library to 2.13.9 or later.

## Is CVE-2022-36944 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36944 exists.

Public exploit code:

- POC for the CVE-2022-36944 vulnerability exploit (github_poc): https://github.com/yarocher/lazylist-cve-poc

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-36944 and fix it if it is affected.

What it is: CVE-2022-36944 is a critical unsafe deserialization vulnerability in Fedoraproject Fedora, published on 23 Sep 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-36944 exists.

Affected packages and fixed versions:
- org.scala-lang:scala-library (Maven): affected from 2.13.0; fixed in 2.13.9
- org.scala-lang:scala-library (Maven): affected from 2.13.0; fixed in 2.13.9

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

## Sources

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

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