# CVE-2026-78254: Apache Ant: Path traversal in ftp and scp tasks allows arbitrary file write

> A malicious server can write arbitrary files outside the target directory via path traversal in Apache Ant's ftp and scp tasks.

- **Severity:** High 7.4 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Sep 2026
- **Updated:** 8 Sep 2026
- **Also known as:** AZL-99972, BELL-CVE-2026-78254, CLEANSTART-2026-DD03194, CLEANSTART-2026-OZ64651, CLSA-2026-1789382807, CLSA-2026-1789746085, DEBIAN-CVE-2026-78254, GHSA-vjp4-m83c-mp26, UBUNTU-CVE-2026-78254, openSUSE-SU-2026:11793-1

## What is CVE-2026-78254?

CVE-2026-78254 is a high-severity path traversal vulnerability in Apache Ant, published on 7 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The ftp and scp tasks of Apache Ant can download files from a remote server. A malicious server can provide relative paths that allow it to write outside of the dedicated target directory for the download, making it possible to overwrite files of the attacker's choice using the permissions of the user running Ant in versions prior to Ant 1.10.18. 

In order to exploit this vulnerability, the server would either have to be malicious or be subject to a machine-in-the-middle attack. Additionally in the case of scp or the ftp task using ftps the server must pass the server identity checks performed by the tasks.

For ftp tasks not using ftps a malicious server could act as a machine-in-the-middle to provide malicious files.

Starting with Ant 1.10.18 both tasks will prevent writing outside of the destination directory by default. An option is available to disable this behavior in the unlikely case that the  old behavior is required by existing build files.

Mitigations:

Users of scp and ftp (when using ftps) in any version of Ant should not bypass server identity checks. Users of ftp not using ftps should switch to ftps where possible.

All users are recommended to upgrade to Apache Ant 1.10.18, which fixes this issue.

Weakness: CWE-23 (Relative Path Traversal)

## Which versions are affected by CVE-2026-78254?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ant` | openSUSE:Tumbleweed | All versions | 1.10.18-2.1 |

Products: Apache Ant.

## How do I fix CVE-2026-78254?

Upgrade to a fixed version.

## Is CVE-2026-78254 being exploited?

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

## Other vulnerabilities in Apache Ant

- [CVE-2020-11979](https://insights.sbomify.com/CVE-2020-11979/): Code injection in Apache Ant (high 7.5)
- [CVE-2020-1945](https://insights.sbomify.com/CVE-2020-1945/): Sensitive Data Exposure in Apache Ant (medium 6.3)
- [CVE-2021-36373](https://insights.sbomify.com/CVE-2021-36373/): Apache Ant TAR archive denial of service vulnerability (medium 5.5)
- [CVE-2021-36374](https://insights.sbomify.com/CVE-2021-36374/): Apache Ant ZIP, and ZIP based, archive denial of service vulerability (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-78254 and fix it if it is affected.

What it is: CVE-2026-78254 is a high-severity path traversal vulnerability in Apache Ant, published on 7 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-78254 in the wild and no public exploit code.

Affected product: Apache Ant. 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-2026-78254/ (Markdown: https://insights.sbomify.com/CVE-2026-78254/index.md)
```

## Sources

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

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