# CVE-2022-35978: Lua sandbox escape from mod in Minetest

> A malicious mod in Minetest can escape the Lua sandbox to execute arbitrary code on the user's system.

- **Severity:** High 7.7 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Aug 2022
- **Updated:** 23 Apr 2025
- **Also known as:** DEBIAN-CVE-2022-35978, GHSA-663q-pcjw-27cc, MGASA-2023-0005, UBUNTU-CVE-2022-35978, openSUSE-SU-2023:0001-1, openSUSE-SU-2024:12284-1, openSUSE-SU-2025:14825-1

## What is CVE-2022-35978?

CVE-2022-35978 is a high-severity code injection vulnerability in minetest, published on 15 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Minetest is a free open-source voxel game engine with easy modding and game creation. In **single player**, a mod can set a global setting that controls the Lua script loaded to display the main menu. The script is then loaded as soon as the game session is exited. The Lua environment the menu runs in is not sandboxed and can directly interfere with the user's system. There are currently no known workarounds.

Weakness: CWE-693 (Protection Mechanism Failure)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `minetest` | SUSE:Package Hub 15 SP3 | All versions | 5.6.0-bp154.2.3.5 |
| `minetest` | SUSE:Package Hub 15 SP4 | All versions | 5.6.0-bp154.2.3.5 |
| `minetest` | openSUSE:Leap 15.3 | All versions | 5.6.0-bp154.2.3.5 |
| `minetest` | openSUSE:Leap 15.4 | All versions | 5.6.0-bp154.2.3.5 |
| `luanti` | openSUSE:Tumbleweed | All versions | 5.11.0-1.1 |

Products: Minetest Minetest.

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

Apply the vendor's patch.

## Is CVE-2022-35978 being exploited?

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

Public exploit code:

- Proof of concept created for CVE-2022-35978 for educational purposes only. (github_poc): https://github.com/CanVo/CVE-2022-35978-POC

## Other vulnerabilities in minetest

- [CVE-2026-41196](https://insights.sbomify.com/CVE-2026-41196/): Luanti has a mod security sandbox escape (critical 9.0)

## Fix prompt for AI coding agents

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

What it is: CVE-2022-35978 is a high-severity code injection vulnerability in minetest, published on 15 Aug 2022. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-35978 in the wild and no public exploit code.

Affected product: minetest. No package-level version data is available, so check the vendor advisory linked from the reference page.

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

## Sources

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

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