# CVE-2024-4040: CrushFTP VFS Sandbox Escape

> Unauthenticated attackers can exploit server-side template injection to read files, bypass authentication, and execute arbitrary code on CrushFTP servers.

- **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:** Yes, since 24 Apr 2024 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** No
- **Published:** 22 Apr 2024
- **Updated:** 21 Oct 2025
- **Also known as:** GHSA-46vf-c8gj-2pgq

## What is CVE-2024-4040?

CVE-2024-4040 is a critical code injection vulnerability in CrushFTP, published on 22 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms allows unauthenticated remote attackers to read files from the filesystem outside of the VFS Sandbox, bypass authentication to gain administrative access, and perform remote code execution on the server.

Weakness: CWE-94 (Improper Control of Generation of Code), CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine)

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

It affects 1 product.


Products: Crushftp Crushftp.

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

No fix has been published for CVE-2024-4040 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 1 May 2024.

## Is CVE-2024-4040 being exploited?

Yes. Attackers have exploited CVE-2024-4040 in the wild since at least 24 Apr 2024.

Public exploit code:

- CVE-2024-4040 CrushFTP SSTI LFI & Auth Bypass | Full Server Takeover | Wordlist Support (github_poc): https://github.com/Stuub/CVE-2024-4040-SSTI-LFI-PoC
- Scanner for CVE-2024-4040 (github_poc): https://github.com/airbus-cert/CVE-2024-4040
- https://github.com/rbih-boulanouar/CVE-2024-4040 (github_poc): https://github.com/rbih-boulanouar/CVE-2024-4040
- is a PoC for CVE-2024-4040 tool for exploiting the SSTI vulnerability in CrushFTP (github_poc): https://github.com/geniuszly/GenCrushSSTIExploit
- A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms allows unauthenticated remote attackers to read files from the filesystem outside of the VFS Sandbox, bypass authentication to gain administrative access, and perform remote code execution on the server. (github_poc): https://github.com/gotr00t0day/CVE-2024-4040
- Exploit CrushFTP CVE-2024-4040 (github_poc): https://github.com/dhammerg/CVE-2024-4040

## Other vulnerabilities in CrushFTP

- [CVE-2025-31161](https://insights.sbomify.com/CVE-2025-31161/): CrushFTP Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2025-54309](https://insights.sbomify.com/CVE-2025-54309/): CrushFTP Unprotected Alternate Channel (critical 9.0, exploited in the wild)
- [CVE-2024-53552](https://insights.sbomify.com/CVE-2024-53552/): Auth bypass in n/a (critical 9.8)
- [CVE-2023-43177](https://insights.sbomify.com/CVE-2023-43177/): Deserialization in n/a (critical 9.8)
- [CVE-2017-14035](https://insights.sbomify.com/CVE-2017-14035/): Deserialization in n/a (critical 9.8)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-4040 is a critical code injection vulnerability in CrushFTP, published on 22 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2024-4040 in the wild since at least 24 Apr 2024.

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

## Sources

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

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