CVE-2020-17521: Groovy Information Disclosure Vulnerability

MODERATE
Advisory Identifier: GHSA-rcjj-h6gh-jf3r
CVSS 5.5
CWE-379
Published
Advisory Summary

CVE-2020-17521 is a MODERATE (CVSS 5.5) information disclosure vulnerability (CWE-379: Creation of Temporary File in Directory with Insecure Permissions) affecting Groovy libraries in the Maven ecosystem. The issue involves information disclosure in apache groovy. Remediation is available by upgrading affected packages to version 2.4.21, 2.5.14, 3.0.7.

CVE-2020-17521 at a Glance

CVE Identifier CVE-2020-17521
GHSA Identifier GHSA-rcjj-h6gh-jf3r
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-379: Creation of Temporary File in Directory with Insecure Permissions
Affected Product Groovy
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

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

How to Fix CVE-2020-17521

To remediate this vulnerability, upgrade all affected Groovy 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.codehaus.groovy:groovy fixed: 2.4.21
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy</artifactId>
    <version>2.4.21</version>
</dependency>
org.codehaus.groovy:groovy fixed: 2.5.14
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy</artifactId>
    <version>2.5.14</version>
</dependency>
org.codehaus.groovy:groovy fixed: 3.0.7
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy</artifactId>
    <version>3.0.7</version>
</dependency>
org.codehaus.groovy:groovy-all fixed: 2.4.21
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.21</version>
</dependency>
org.codehaus.groovy:groovy-all fixed: 2.5.14
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.5.14</version>
</dependency>
org.codehaus.groovy:groovy-all fixed: 3.0.7
<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>3.0.7</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.codehaus.groovy

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.codehaus.groovy

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

Note: The mvn dependency:tree -Dincludes=org.codehaus.groovy 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-379: Creation of Temporary File in Directory with Insecure Permissions, where the product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file. In Groovy, 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

Apache Groovy provides extension methods to aid with creating temporary directories. Prior to this fix, Groovy's implementation of those extension methods was using a now superseded Java JDK method call that is potentially not secure on some operating systems in some contexts. Users not using the extension methods mentioned in the advisory are not affected, but may wish to read the advisory for further details. Versions Affected: 2.0 to 2.4.20, 2.5.0 to 2.5.13, 3.0.0 to 3.0.6, and 4.0.0-alpha-1. Fixed in versions 2.4.21, 2.5.14, 3.0.7, 4.0.0-alpha-2.

CVE-2020-17521 Affected Groovy Versions

6 component(s)
Fixed Versions:
2.4.212.5.143.0.7
Product / Package Ecosystem Affected Versions Fixed Version
org.codehaus.groovy:groovy
Maven
≥ 2.0.0
< 2.4.21
2.4.21
org.codehaus.groovy:groovy
Maven
≥ 2.5.0
< 2.5.14
2.5.14
org.codehaus.groovy:groovy
Maven
≥ 3.0.0
< 3.0.7
3.0.7
org.codehaus.groovy:groovy-all
Maven
≥ 2.0.0
< 2.4.21
2.4.21
org.codehaus.groovy:groovy-all
Maven
≥ 2.5.0
< 2.5.14
2.5.14
org.codehaus.groovy:groovy-all
Maven
≥ 3.0.0
< 3.0.7
3.0.7

References

NVD — CVE-2020-17521 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-17521
Groovy Source Repository REPOSITORY
https://github.com/apache/groovy/pull/1425
Security Fix Commit FIX COMMIT
https://github.com/apache/groovy/commit/bcbe5c4c76db83736166530647c024ac1e47ef28
Groovy Source Repository REPOSITORY
https://github.com/apache/groovy
Groovy Security Information SECURITY
https://groovy-lang.org/security.html#CVE-2020-17521
lists.apache.org/thread.html/r4b2f13... WEB
https://lists.apache.org/thread.html/r4b2f13c302eec98838ff7475253091fb9b75bc1038016ba00ebf6c08@%3Cdev.atlas.apache.org%3E
lists.apache.org/thread.html/ra9dab3... WEB
https://lists.apache.org/thread.html/ra9dab34bf8625511f23692ad0fcee2725f782e9aad6c5cdff6cf4465@%3Cnotifications.groovy.apache.org%3E
lists.apache.org/thread.html/rea63a4... WEB
https://lists.apache.org/thread.html/rea63a4666ba245d2892471307772a2d8ce0f0741f341d6576625c1b3@%3Cdev.atlas.apache.org%3E
Groovy Security Information SECURITY
https://security.netapp.com/advisory/ntap-20201218-0006
Groovy Security Information SECURITY
https://www.oracle.com//security-alerts/cpujul2021.html
Groovy Security Information SECURITY
https://www.oracle.com/security-alerts/cpuApr2021.html
Groovy Security Information SECURITY
https://www.oracle.com/security-alerts/cpuapr2022.html
Groovy Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2021.html
Groovy Security Information SECURITY
https://www.oracle.com/security-alerts/cpujan2022.html
Groovy Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2022.html
Groovy Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html

Frequently Asked Questions

What is CVE-2020-17521?
CVE-2020-17521 is a security vulnerability in Groovy involving Information Disclosure in Apache Groovy under CWE-379: Creation of Temporary File in Directory with Insecure Permissions.
Which Groovy versions are affected?
Affected versions include releases prior to 2.4.21, 2.5.14, 3.0.7 across affected packages: org.codehaus.groovy:groovy, org.codehaus.groovy:groovy-all.
What version fixes CVE-2020-17521?
Upgrading to 2.4.21, 2.5.14, 3.0.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is groovy affected?
Yes, org.codehaus.groovy:groovy is affected in releases prior to 2.4.21, 2.5.14, 3.0.7. Upgrade your dependency to 2.4.21, 2.5.14, 3.0.7 or later.
Is groovy-all affected?
Yes, org.codehaus.groovy:groovy-all is affected in releases prior to 2.4.21, 2.5.14, 3.0.7. Upgrade your dependency to 2.4.21, 2.5.14, 3.0.7 or later.
What is the CVSS score of CVE-2020-17521?
CVE-2020-17521 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2020-17521?
CVE-2020-17521 is classified under CWE-379: Creation of Temporary File in Directory with Insecure Permissions (The product creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.).
How can I check Maven dependencies for CVE-2020-17521?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.codehaus.groovy'. 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-rcjj-h6gh-jf3r",
  "modified" : "2024-10-17T16:18:50Z",
  "published" : "2020-12-09T19:03:03Z",
  "aliases" : [ "CVE-2020-17521" ],
  "summary" : "Information Disclosure in Apache Groovy",
  "details" : "Apache Groovy provides extension methods to aid with creating temporary directories. Prior to this fix, Groovy's implementation of those extension methods was using a now superseded Java JDK method call that is potentially not secure on some operating systems in some contexts. Users not using the extension methods mentioned in the advisory are not affected, but may wish to read the advisory for further details. Versions Affected: 2.0 to 2.4.20, 2.5.0 to 2.5.13, 3.0.0 to 3.0.6, and 4.0.0-alpha-1. Fixed in versions 2.4.21, 2.5.14, 3.0.7, 4.0.0-alpha-2.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.codehaus.groovy:groovy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.4.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.codehaus.groovy:groovy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "2.5.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.codehaus.groovy:groovy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.codehaus.groovy:groovy-all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.4.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.codehaus.groovy:groovy-all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.5.0"
      }, {
        "fixed" : "2.5.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.codehaus.groovy:groovy-all"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-17521"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/groovy/pull/1425"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/apache/groovy/commit/bcbe5c4c76db83736166530647c024ac1e47ef28"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/apache/groovy"
  }, {
    "type" : "WEB",
    "url" : "https://groovy-lang.org/security.html#CVE-2020-17521"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r4b2f13c302eec98838ff7475253091fb9b75bc1038016ba00ebf6c08@%3Cdev.atlas.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ra9dab34bf8625511f23692ad0fcee2725f782e9aad6c5cdff6cf4465@%3Cnotifications.groovy.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rea63a4666ba245d2892471307772a2d8ce0f0741f341d6576625c1b3@%3Cdev.atlas.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20201218-0006"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com//security-alerts/cpujul2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuApr2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujan2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-379" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-12-09T19:02:34Z",
    "nvd_published_at" : "2020-12-07T20:15:00Z"
  }
}