# CVE-2024-41799: tgstation-server's DreamMaker environment files outside the deployment directory can be compiled and ran by insufficiently permissioned users

> Low-privilege users can compile and execute malicious files outside the deployment directory, potentially leading to remote code execution if trusted security levels are enabled.

- **Severity:** High 8.4 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:H`)
- **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:** 29 Jul 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-c3h4-9gc2-f7h4

## What is CVE-2024-41799?

CVE-2024-41799 is a high-severity path traversal vulnerability in tgstation-server, published on 29 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

tgstation-server is a production scale tool for BYOND server management. Prior to 6.8.0, low permission users using the "Set .dme Path" privilege could potentially set malicious .dme files existing on the host machine to be compiled and executed. These .dme files could be uploaded via tgstation-server (requiring a separate, isolated privilege) or some other means. A server configured to execute in BYOND's trusted security level (requiring a third separate, isolated privilege OR being set by another user) could lead to this escalating into remote code execution via BYOND's shell() proc. The ability to execute this kind of attack is a known side effect of having privileged TGS users, but normally requires multiple privileges with known weaknesses. This vector is not intentional as it does not require control over the where deployment code is sourced from and _may_ not require remote write access to an instance's `Configuration` directory. This problem is fixed in versions 6.8.0 and above.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-41799?

4 open source packages ship an affected version, including Tgstation.Server.Api and Tgstation.Server.Host. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `Tgstation.Server.Api` | NuGet | From 4.0.0 | 6.8.0 |
| `Tgstation.Server.Api` | NuGet | From 4.0.0 | 6.8.0 |
| `Tgstation.Server.Host` | NuGet | From 4.0.0 | 6.8.0 |
| `Tgstation.Server.Host` | NuGet | From 4.0.0 | 6.8.0 |

Products: Tgstation13 Tgstation-Server.

## How do I fix CVE-2024-41799?

Upgrade Tgstation.Server.Api to 6.8.0 or later.

## Is CVE-2024-41799 being exploited?

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

## Other vulnerabilities in tgstation-server

- [CVE-2018-17107](https://insights.sbomify.com/CVE-2018-17107/): tgstation-server cached user logins in legacy server (critical 9.8)
- [CVE-2025-21611](https://insights.sbomify.com/CVE-2025-21611/): tgstation-server's role authorization incorrectly OR'd with user's enabled status (high 8.8)
- [CVE-2023-32687](https://insights.sbomify.com/CVE-2023-32687/): Insufficiently Protected ChatBot Credentials in tgstation-server (high 7.7)
- [CVE-2020-16136](https://insights.sbomify.com/CVE-2020-16136/): Path traversal in n/a (high 7.7)
- [CVE-2023-33198](https://insights.sbomify.com/CVE-2023-33198/): Incorrectly Specified Chat Message Destinations in tgstation-server and DreamMaker API (medium 6.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-41799 and fix it if it is affected.

What it is: CVE-2024-41799 is a high-severity path traversal vulnerability in tgstation-server, published on 29 Jul 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-41799 in the wild and no public exploit code.

Affected packages and fixed versions:
- Tgstation.Server.Api (NuGet): affected from 4.0.0; fixed in 6.8.0
- Tgstation.Server.Api (NuGet): affected from 4.0.0; fixed in 6.8.0
- Tgstation.Server.Host (NuGet): affected from 4.0.0; fixed in 6.8.0
- Tgstation.Server.Host (NuGet): affected from 4.0.0; fixed in 6.8.0

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

## Sources

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

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