Apache Ant Security Reports
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.
- if a vulnerability applies to your particular application
- obtaining further information on a published vulnerability
- availability of patches and/or new releases
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: firstname.lastname@example.org
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.
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
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
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 first reported to the Security Team on 1 June 2020 and made public on 30 September 2020
Affects: until 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
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 first reported to the Security Team on 29 January 2020 and made public on 13 May 2020
Affects: until 1.10.7
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 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
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 first reported to the Security Team on 12 April 2012 and made public on 23 May 2012.
Affects: 1.5 - 1.8.3
Please report any errors or omissions to the dev mailing list.