Vulnerabilities in pkg:maven/org.apache.ant/ant

PACKAGE
Advisory Identifier: GHSA-f62v-xpxf-3v68
Advisory Summary

CVE-2020-11979 is a HIGH (CVSS 7.5) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Ant libraries in the Maven ecosystem. The issue involves code injection in apache ant. Remediation is available by upgrading affected packages to version 1.10.9.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.apache.ant/ant

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.apache.ant/ant. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-f62v-xpxf-3v68 CVE-2020-11979 HIGH Code injection in Apache Ant
GHSA-5v34-g2px-j4fw CVE-2021-36374 MODERATE Improper Handling of Length Parameter Inconsistency in Apache Ant
GHSA-4p6w-m9wc-c9c9 CVE-2020-1945 MODERATE Sensitive Data Exposure in Apache Ant
GHSA-q5r4-cfpx-h6fh CVE-2021-36373 MODERATE Improper Handling of Length Parameter Inconsistency in Apache Ant

CVE-2020-11979 at a Glance

CVE Identifier CVE-2020-11979
GHSA Identifier GHSA-f62v-xpxf-3v68
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Ant
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2020-11979

To remediate this vulnerability, upgrade all affected Ant dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.apache.ant:ant fixed: 1.10.9
<dependency>
    <groupId>org.apache.ant</groupId>
    <artifactId>ant</artifactId>
    <version>1.10.9</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.apache.ant

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2020-11979, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.apache.ant

Analyze the terminal output to locate any version of Ant in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.10.9), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.apache.ant command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Ant, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2020-11979 Affected Ant Versions

1 component(s)
Fixed Versions:
1.10.9
Product / Package Ecosystem Affected Versions Fixed Version
org.apache.ant:ant
Maven
< 1.10.9
1.10.9

References

GitHub Advisory / Wiki ADVISORY
https://github.com/gradle/gradle/security/advisories/GHSA-j45w-qrgf-25vm
NVD — CVE-2020-11979 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-11979
Security Fix Commit FIX COMMIT
https://github.com/apache/ant/commit/87ac51d3c22bcf7cfd0dc07cb0bd04a496e0d428
Ant Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html
Ant Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2022.html
Ant Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2021.html
Ant Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2022.html
Ant Security Information SECURITY
https://www.oracle.com/security-alerts/cpuApr2021.html
Ant Security Information SECURITY
https://www.oracle.com//security-alerts/cpujul2021.html
Ant Security Information SECURITY
https://security.gentoo.org/glsa/202011-18
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U3NRQQ7ECII4ZNGW7GBC225LVYMPQEKB
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DYBRN5C2RW7JRY75IB7Q7ZVKZCHWAQWS
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AALW42FWNQ35F7KB3JVRC6NBVV7AAYYI
lists.apache.org/thread.html/rc3c8ef... WEB
https://lists.apache.org/thread.html/rc3c8ef9724b5b1e171529b47f4b35cb7920edfb6e917fa21eb6c64ea%40%3Cdev.ant.apache.org%3E
lists.apache.org/thread.html/rbfe9ba... WEB
https://lists.apache.org/thread.html/rbfe9ba28b74f39f46ec1bbbac3bef313f35017cf3aac13841a84483a@%3Cdev.creadur.apache.org%3E
lists.apache.org/thread.html/raaeddc... WEB
https://lists.apache.org/thread.html/raaeddc41da8f3afb1cb224876084a45f68e437a0afd9889a707e4b0c@%3Cdev.creadur.apache.org%3E
lists.apache.org/thread.html/r5e1cdd... WEB
https://lists.apache.org/thread.html/r5e1cdd79f019162f76414708b2092acad0a6703d666d72d717319305@%3Cdev.creadur.apache.org%3E
lists.apache.org/thread.html/r4ca33f... WEB
https://lists.apache.org/thread.html/r4ca33fad3fb39d130cda287d5a60727d9e706e6f2cf2339b95729490@%3Cdev.creadur.apache.org%3E
lists.apache.org/thread.html/r2306b6... WEB
https://lists.apache.org/thread.html/r2306b67f20c24942b872b0a41fbdc9330e8467388158bcd19c1094e0@%3Cdev.creadur.apache.org%3E
lists.apache.org/thread.html/r1dc851... WEB
https://lists.apache.org/thread.html/r1dc8518dc99c42ecca5ff82d0d2de64cd5d3a4fa691eb9ee0304781e@%3Cdev.creadur.apache.org%3E
lists.apache.org/thread.html/r107ea1... WEB
https://lists.apache.org/thread.html/r107ea1b1a7a214bc72fe1a04207546ccef542146ae22952e1013b5cc@%3Cdev.creadur.apache.org%3E
Ant Source Repository REPOSITORY
https://github.com/apache/ant

Frequently Asked Questions

What is CVE-2020-11979?
CVE-2020-11979 is a security vulnerability in Ant involving Code injection in Apache Ant under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Ant versions are affected?
Affected versions include releases prior to 1.10.9 across affected packages: org.apache.ant:ant.
What version fixes CVE-2020-11979?
Upgrading to 1.10.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ant affected?
Yes, org.apache.ant:ant is affected in releases prior to 1.10.9. Upgrade your dependency to 1.10.9 or later.
What is the CVSS score of CVE-2020-11979?
CVE-2020-11979 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2020-11979?
CVE-2020-11979 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Maven dependencies for CVE-2020-11979?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.apache.ant'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f62v-xpxf-3v68",
  "modified" : "2025-09-27T03:18:25Z",
  "published" : "2021-02-03T19:16:35Z",
  "aliases" : [ "CVE-2020-11979" ],
  "summary" : "Code injection in Apache Ant",
  "details" : "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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.apache.ant:ant"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.10.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gradle/gradle/security/advisories/GHSA-j45w-qrgf-25vm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-11979"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/ant/commit/87ac51d3c22bcf7cfd0dc07cb0bd04a496e0d428"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuApr2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com//security-alerts/cpujul2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202011-18"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U3NRQQ7ECII4ZNGW7GBC225LVYMPQEKB"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DYBRN5C2RW7JRY75IB7Q7ZVKZCHWAQWS"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AALW42FWNQ35F7KB3JVRC6NBVV7AAYYI"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rc3c8ef9724b5b1e171529b47f4b35cb7920edfb6e917fa21eb6c64ea%40%3Cdev.ant.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rbfe9ba28b74f39f46ec1bbbac3bef313f35017cf3aac13841a84483a@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/raaeddc41da8f3afb1cb224876084a45f68e437a0afd9889a707e4b0c@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r5e1cdd79f019162f76414708b2092acad0a6703d666d72d717319305@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4ca33fad3fb39d130cda287d5a60727d9e706e6f2cf2339b95729490@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r2306b67f20c24942b872b0a41fbdc9330e8467388158bcd19c1094e0@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r1dc8518dc99c42ecca5ff82d0d2de64cd5d3a4fa691eb9ee0304781e@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r107ea1b1a7a214bc72fe1a04207546ccef542146ae22952e1013b5cc@%3Cdev.creadur.apache.org%3E"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/ant"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-02-03T19:14:47Z",
    "nvd_published_at" : "2020-10-01T20:15:00Z"
  }
}