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

Published Sep 6, 2026
·
Updated

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.

Affected Software

1 affected component
Apache Apache Ant<1.10.18

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Apache Ant to a version that resolves this vulnerability.

    Fixed in 1.10.18
  2. Configuration

    In Ant 1.10.18, ftp tasks prevent writing outside the destination directory by default. If an option exists to disable this behavior, keep it enabled unless existing build files require the old behavior.

    Apache Ant ftp task preventWritingOutsideDestinationDirectory (path traversal mitigation option) = enabled
  3. Configuration

    In Ant 1.10.18, scp tasks prevent writing outside the destination directory by default. If an option exists to disable this behavior, keep it enabled unless existing build files require the old behavior.

    Apache Ant scp task preventWritingOutsideDestinationDirectory (path traversal mitigation option) = enabled
  4. Configuration

    For ftp tasks not using ftps, switch to ftps where possible to reduce the risk from malicious servers or machine-in-the-middle attacks.

    Apache Ant ftp task ftps = enabled
  5. Configuration

    For scp and ftp tasks using ftps, ensure the tasks perform (and you do not bypass) the server identity checks.

    Apache Ant ftp task (ftps) and scp task server identity checks = must not be bypassed

Event History

Sep 7, 2026
CVE Published
via MITRE·07:41 AM
Data Sourced
via MITRE·07:41 AM
DescriptionWeakness
Data Sourced
via NVD·08:17 AM
DescriptionWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments that use Ant's ftp or scp download tasks are exposed when the remote server is malicious or can be intercepted by a machine-in-the-middle attacker. The impact is limited by the permissions of the user account running Ant.

2

What additional conditions are required to exploit downloads over SCP or FTPS?

For scp and ftp tasks using FTPS, the malicious or intercepted server must also pass the server identity checks performed by the Ant tasks. Users should not bypass these identity checks.

3

Are unencrypted FTP downloads at greater risk?

Yes. For ftp tasks not using FTPS, a malicious server can act as a machine-in-the-middle and provide malicious files; switching to FTPS is recommended where possible.

4

What configuration changes address the issue if upgrading is possible?

Upgrade to Apache Ant 1.10.18. In that version, ftp and scp tasks prevent writes outside the destination directory by default; ensure the option that restores the old behavior has not been enabled.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203