Apache Ant security advisories

Security information for Apache Ant

Reporting

Do you want to disclose a potential security issue for Apache Ant? Send your report to the Apache Security Team.

You can read more about the security policy on:

Advisories

This section is experimental: it provides advisories since 2023 and may lag behind the official CVE publications. It may also lack details found on the project security page linked above. If you have any feedback on how you would like this data to be provided, you are welcome to reach out on our public mailinglist or privately on security@apache.org

Path traversal in ftp and scp tasks allows arbitrary file write

CVE-2026-78254 [CVE] [CVE json] [OSV json]

Last updated: 2026-09-07T07:41:52.694Z

Affected

  • Apache Ant from 1.2 before 1.10.18

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.

References

PackagerResolver path traversal vulnerability

CVE-2026-26032 [CVE] [CVE json] [OSV json]

Last updated: 2026-07-15T18:49:39.291Z

Affected

  • Apache Ivy from 2.0.0 through 2.5.3

Description

The PackagerResolver of Apache Ivy is able to download online
artifacts and to (re)package them in a format defined by a
packager.xml file. This repackaging is done by an Ant script, which is
stored in a subdirectory of the configured “buildRoot” directory. This
subdirectory is calculated based on modules coordinates, like the
organisation, name or version.

If one of the coordinates contains “../” sequences - which are valid
characters for Ivy coordinates in general- it is possible to break out
of the configured “buildRoot” directory where other files can be
overwritten.

In order to exploit this vulnerability an attacker needs to have
access to a packager repository and add or modify the coordinates in
ivy.xml files to have such “../” sequences.

Users of Apache Ivy 2.0.0 to 2.5.3 (inclusive) should upgrade to Ivy 2.6.0.

References

Credits

  • yudeshui of dhgate security (reporter)

XML External Entity vulnerability in Apache Ivy

CVE-2022-46751 [CVE] [CVE json] [OSV json]

Last updated: 2023-08-21T06:54:55.281Z

Affected

  • Apache Ivy from 1.0.0 through 2.5.1

Description

Improper Restriction of XML External Entity Reference, XML Injection (aka Blind XPath Injection) vulnerability in Apache Software Foundation Apache Ivy.

This issue affects any version of Apache Ivy prior to 2.5.2.

When Apache Ivy prior to 2.5.2 parses XML files - either its own configuration, Ivy files or Apache Maven POMs - it will allow downloading external document type definitions and expand any entity references contained therein when used.

This can be used to exfiltrate data, access resources only the machine running Ivy has access to or disturb the execution of Ivy in different ways.

Starting with Ivy 2.5.2 DTD processing is disabled by default except when parsing Maven POMs where the default is to allow DTD processing but only to include a DTD snippet shipping with Ivy that is needed to deal with existing Maven POMs that are not valid XML files but are nevertheless accepted by Maven. Access can be be made more lenient via newly introduced system properties where needed.

Users of Ivy prior to version 2.5.2 can use Java system properties to restrict processing of external DTDs, see the section about “JAXP Properties for External Access restrictions” inside Oracle’s “Java API for XML Processing (JAXP) Security Guide”.

References

Credits

  • CC Bomber, Kitri BoB (finder)
  • Jenkins Security Team (reporter)

Apache Ivy allows path traversal in the presence of a malicious repository

CVE-2022-37866 [CVE] [CVE json] [OSV json]

Last updated: 2022-11-07T13:15:44.826Z

Affected

  • Apache Ivy from 2.0.0 before *

Description

When Apache Ivy downloads artifacts from a repository it stores them in the local file system based on a user-supplied “pattern” that may include placeholders for artifacts coordinates like the organisation, module or version.

If said coordinates contain “../” sequences - which are valid characters for Ivy coordinates in general - it is possible the artifacts are stored outside of Ivy’s local cache or repository or can overwrite different artifacts inside of the local cache.

In order to exploit this vulnerability an attacker needs collaboration by the remote repository as Ivy will issue http requests containing “..” sequences and a “normal” repository will not interpret them as part of the artifact coordinates.

Users of Apache Ivy 2.0.0 to 2.5.1 should upgrade to Ivy 2.5.1.

References

Credits

  • This issue was discovered by Kostya Kortchinsky of the Databricks Security Team.

Apache Ivy allows creating/overwriting any file on the system

CVE-2022-37865 [CVE] [CVE json] [OSV json]

Last updated: 2022-11-07T10:53:07.179Z

Affected

  • Apache Ivy from 2.4.0 before *

Description

With Apache Ivy 2.4.0 an optional packaging attribute has been introduced that allows artifacts to be unpacked on the fly if they used pack200 or zip packaging.

For artifacts using the “zip”, “jar” or “war” packaging Ivy prior to 2.5.1 doesn’t verify the target path when extracting the archive. An archive containing absolute paths or paths that try to traverse “upwards” using “..” sequences can then write files to any location on the local fie system that the user executing Ivy has write access to.

Ivy users of version 2.4.0 to 2.5.0 should upgrade to Ivy 2.5.1.

References

Credits

  • This issue was discovered by Kostya Kortchinsky of the Databricks Security Team.

Apache Ant ZIP, and ZIP based, archive denial of service vulnerability

CVE-2021-36374 [CVE] [CVE json] [OSV json]

Last updated: 2021-07-19T07:37:04.488Z

Affected

  • Apache Ant from 1.4 before Apache Ant*
  • Apache Ant from Apache Ant 1.9.x through 1.9.15
  • Apache Ant from Apache Ant 1.10.x through 1.10.10

Description

When reading a specially crafted ZIP archive, or a derived formats, an Apache Ant build can be made to allocate large amounts of memory that leads to an out of memory error, even for small inputs. This can be used to disrupt builds using Apache Ant.

Commonly used derived formats from ZIP archives are for instance JAR files and many office files. Apache Ant prior to 1.9.16 and 1.10.11 were affected.

References

Credits

Apache Ant TAR archive denial of service vulnerability

CVE-2021-36373 [CVE] [CVE json]

Last updated: 2021-07-14T06:08:32.303Z

Affected

  • Apache Ant from Apache Ant 1.9.x through 1.9.15
  • Apache Ant from Apache Ant 1.10.x through 1.10.10
  • Apache Ant from Apache Ant before 1.9.0 unaffected

Description

When reading a specially crafted TAR archive an Apache Ant build can be made to allocate large amounts of memory that finally leads to an out of memory error, even for small inputs. This can be used to disrupt builds using Apache Ant. Apache Ant prior to 1.9.16 and 1.10.11 were affected.

References

Credits