Apache Ant site Apache Ant logo

the Apache Ant site
Home
Projects
 

Apache Ant Security Reports

Reporting New Security Problems with Apache Ant

The Apache Software Foundation takes a very active stance in eliminating security problems and denial of service attacks against its products.

We strongly encourage folks to report such problems to our private security mailing list first, before disclosing them in a public forum.

Please note that the security mailing list should only be used for reporting undisclosed security vulnerabilities and managing the process of fixing such vulnerabilities. We cannot accept regular bug reports or other queries at this address. All mail sent to this address that does not relate to an undisclosed security problem in our source code will be ignored.

If you need to report a bug that isn't an undisclosed security vulnerability, please use the bug reporting page.

Questions about:

should be addressed to the users mailing list. Please see the mailing lists page for details of how to subscribe.

The private security mailing address is: security@apache.org

Apache Ant Security Vulnerabilities

This page lists all security vulnerabilities fixed in released versions of Apache Ant. Each vulnerability is given a security impact rating by the development team - please note that this rating may vary from platform to platform. We also list the versions of Ant the flaw is known to affect, and where a flaw has not been verified list the version with a question mark.

Please note that binary patches are never provided. If you need to apply a source code patch, use the building instructions for the Ant version that you are using.

If you need help on building Ant or other help on following the instructions to mitigate the known vulnerabilities listed here, please send your questions to the public Ant Users mailing list.

If you have encountered an unlisted security vulnerability or other unexpected behaviour that has security impact, or if the descriptions here are incomplete, please report them privately to the Apache Security Team. Thank you.

Fixed in Apache Ant 1.9.16 / Ant 1.10.11

Low: Denial of Service CVE-2021-36373 and CVE-2021-36374.

When reading a specially crafted 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.

It affects reading (or updating) tar archives as well as archives using the zip format or formats derived from it. Commonly used derived formats from ZIP archives are for instance JAR files and many office files.

This was fixed in revision 6594a2d.

These issues are similar to CVE-2021-35517 and CVE-2021-36090 present in Apache Commons Compress which have been detected by OSS Fuzz.

Affects: up to 1.9.15 / 1.10.10. Versions prior to 1.4 are not affected, versions prior to 1.9.0 are not affected when reading tar archives.

Fixed in Apache Ant 1.10.9

Medium: insecure temporary file vulnerability CVE-2020-11979

As mitigation for CVE-2020-1945 Apache Ant 1.10.8 changed the permissions of temporary files it created so that only the current user was allowed to access them. Unfortunately the fixcrlf task deleted the temporary file and created a new one without said protection, effectively nullifying the effort.

This would still allow an attacker to inject modified source files into the build process.

Mitigation:The best mitigation against CVE-2020-11979 and CVE-2020-1945 still is to make Ant use a directory that is only readable and writable by the current user.

Users of versions 1.10.8 and 1.9.15 can use the Ant property ant.tmpdir to point to such a directory, users of versions 1.1 to 1.9.14 and 1.10.0 to 1.10.7 should set the java.io.tmpdir system property.

Ant 1.10.9 will also try to create a temporary directory only accessible by the current user if neither of the properties above is set but may fail to create one if the underlying filesystem doesn't allow it.

Explicitly setting up a directory to use and set the respective property is the only mitigation that will work on every platform.

This was fixed in revisions f7159e8a084a3fcb76b933d393df1fc855d74d78 and 87ac51d3c22bcf7cfd0dc07cb0bd04a496e0d428.

This was first reported to the Security Team on 1 June 2020 and made public on 30 September 2020

Affects: until 1.10.8

Fixed in Apache Ant 1.10.8

Medium: insecure temporary file vulnerability CVE-2020-1945

Apache Ant uses the default temporary directory identified by the Java system property java.io.tmpdir for several tasks and may thus leak sensitive information. The fixcrlf and replaceregexp tasks also copy files from the temporary directory back into the build tree allowing an attacker to inject modified source files into the build process.

Mitigation: Ant users of versions 1.1 to 1.9.14 and 1.10.0 to 1.10.7 should set the java.io.tmpdir system property to point to a directory only readable and writable by the current user prior to running Ant.

Users of versions 1.9.15 and 1.10.8 can use the Ant property ant.tmpfile instead. Users of Ant 1.10.8 can rely on Ant protecting the temporary files if the underlying filesystem allows it, but we still recommend using a private temporary directory instead.

This was fixed in revisions 9c1f4d905da59bf446570ac28df5b68a37281f35, 041b058c7bf10a94d56db3ca9dba38cf90ab9943 and a8645a151bc706259fb1789ef587d05482d98612.

This was first reported to the Security Team on 29 January 2020 and made public on 13 May 2020

Affects: until 1.10.7

Fixed in Apache Ant 1.9.10 / Ant 1.10.2

Low: Denial of Service CVE-2017-5645

When using Apache Ants Log4jListener there could be a security issue with the underlying Apache Log4j library in version 1.x.
Please note that Log4j 1.x has reached its end of life and is no longer maintained. For details about migrating away from Log4j 1.x please consult with the Apache Log4j team.

This was fixed in revisions 2b53103932031a1d2321f5dc890ede55a9833f95 and 146df361556b499f2fa7d34f58a86508b9492652.

This was first reported to the Security Team on 8 January 2018 and made public on 07 February 2018.

Affects: until 1.9.9 / 1.10.1

Fixed in Apache Ant 1.8.4

Low: Denial of Service CVE-2012-2098

The bzip2 compressing streams in Apache Ant internally use sorting algorithms with unacceptable worst-case performance on very repetitive inputs. A specially crafted input to Ants' <bzip2> task can be used to make the process spend a very long time while using up all available processing time effectively leading to a denial of service.

This was fixed in revisions 1340895 and 1340990.

This was first reported to the Security Team on 12 April 2012 and made public on 23 May 2012.

Affects: 1.5 - 1.8.3

Errors and Ommissions

Please report any errors or omissions to the dev mailing list.