# CVE-2021-44078: Memory corruption in n/a

> Local attackers can escape the sandbox and execute arbitrary code on the host via a memory manager flaw in Unicorn Engine.

- **Severity:** High 8.1 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Dec 2021
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-rmvm-v6m6-87vr, PYSEC-2021-868

## What is CVE-2021-44078?

CVE-2021-44078 is a high-severity memory corruption vulnerability in n/a, published on 26 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

An issue was discovered in split_region in uc.c in Unicorn Engine before 2.0.0-rc5. It allows local attackers to escape the sandbox. An attacker must first obtain the ability to execute crafted code in the target sandbox in order to exploit this vulnerability. The specific flaw exists within the virtual memory manager. The issue results from the faulty comparison of GVA and GPA while calling uc_mem_map_ptr to free part of a claimed memory block. An attacker can leverage this vulnerability to escape the sandbox and execute arbitrary code on the host machine.

Weakness: CWE-697 (Incorrect Comparison)

## Which versions are affected by CVE-2021-44078?

1 open source package ship an affected version, including unicorn. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `unicorn` | PyPI | All versions | 2.0.0rc1 |

Products: Unicorn-Engine Unicorn Engine.

## How do I fix CVE-2021-44078?

Upgrade unicorn to 2.0.0rc1 or later.

## Is CVE-2021-44078 being exploited?

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

## Other vulnerabilities in n/a

- [CVE-2022-29692](https://insights.sbomify.com/CVE-2022-29692/): Use after free in n/a (high 7.8)
- [CVE-2022-29693](https://insights.sbomify.com/CVE-2022-29693/): Memory corruption in n/a (high 7.5)
- [CVE-2022-29694](https://insights.sbomify.com/CVE-2022-29694/): Null dereference in n/a (high 7.5)
- [CVE-2022-29695](https://insights.sbomify.com/CVE-2022-29695/): Memory corruption in n/a (high 7.5)
- [CVE-2020-36431](https://insights.sbomify.com/CVE-2020-36431/): Memory corruption in n/a (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-44078 and fix it if it is affected.

What it is: CVE-2021-44078 is a high-severity memory corruption vulnerability in n/a, published on 26 Dec 2021. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-44078 in the wild and no public exploit code.

Affected packages and fixed versions:
- unicorn (PyPI): affected all versions; fixed in 2.0.0rc1

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

## Sources

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

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