Apache Ant - Information Leakage and Source Code Injection

ant Updated 02 Oct 2025

Summary

14/05/2020
N/A
Yes i
Medium
6.3

CVE-2020-1945: Apache Ant 1.1 to 1.9.14 and 1.10.0 to 1.10.7 uses the default temporary directory identified by the Java system property java.io.tmpdir for several tasks and may thus leak sensitive information. Affects ant versions < 1.10.8-1. Fixed in 1.10.8-1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Apache Ant is a popular Java-based build tool used for automating software build processes. It provides a set of tasks and libraries that enable developers to compile, test, and package their applications. However, versions 1.1 to 1.9.14 and 1.10.0 to 1.10.7 of Apache Ant have a vulnerability that can lead to information leakage and source code injection.

Vulnerability Detail

The vulnerability in Apache Ant arises from its use of the default temporary directory, which is identified by the Java system property java.io.tmpdir. This directory is used for various tasks within Apache Ant. However, due to improper handling, sensitive information can be leaked through this directory. Additionally, the fixcrlf and replaceregexp tasks in Apache Ant copy files from the temporary directory back into the build tree. This allows an attacker to inject modified source files into the build process, potentially leading to the execution of malicious code.

How To Fix

Minimum fixed version

1.10.8-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade ant

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented. The workaround involves manually setting the temporary directory to a secure location, different from the default java.io.tmpdir. This can be done by modifying the Ant build script or by setting the JAVA_OPTS environment variable with the -Djava.io.tmpdir flag. By specifying a secure temporary directory, the risk of information leakage and source code injection can be mitigated.

Conclusion

The vulnerability in Apache Ant can result in information leakage and source code injection. It is crucial to upgrade to the latest version of Apache Ant (1.10.8 or later) to mitigate these risks. Alternatively, a temporary workaround can be implemented by setting a secure temporary directory. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ant →

Share this vulnerability

FAQ

Apache Ant is a Java-based build tool used for automating software build processes. It provides a set of tasks and libraries that enable developers to compile, test, and package their applications.

Versions 1.1 to 1.9.14 and 1.10.0 to 1.10.7 of Apache Ant are affected by this vulnerability.

This vulnerability can lead to information leakage and source code injection. Attackers can potentially access sensitive information and inject malicious source code into the build process.

To fix this vulnerability, it is recommended to upgrade to Apache Ant version 1.10.8 or later. This version includes the necessary fixes to address the information leakage and source code injection issues.

Yes, if upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented by manually setting the temporary directory to a secure location, different from the default java.io.tmpdir.

Related vulnerabilities

Recent vulnerabilities recorded for ant.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.10.8-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade ant

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback