CVE-2021-29427

Repository content filters do not work in Settings pluginManagement

8.0 high EPSS 1.31%

Published 13 Apr 2021 Updated 3 Aug 2024 CNA: GitHub_M

Check your servers for CVE-2021-29427

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-29427 affects gradle, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

In Gradle from version 5.1 and before version 7.0 there is a vulnerability which can lead to information disclosure and/or dependency poisoning. Repository content filtering is a security control Gradle introduced to help users specify what repositories are used to resolve specific dependencies. This feature was introduced in the wake of the "A Confusing Dependency" blog post. In some cases, Gradle may ignore content filters and search all repositories for dependencies. This only occurs when repository content filtering is used from within a `pluginManagement` block in a settings file. This may change how dependencies are resolved for Gradle plugins and build scripts. For builds that are vulnerable, there are two risks: 1) Information disclosure: Gradle could make dependency requests to repositories outside your organization and leak internal package identifiers. 2) Dependency poisoning/Dependency confusion: Gradle could download a malicious binary from a repository outside your organization due to name squatting. For a full example and more details refer to the referenced GitHub Security Advisory. The problem has been patched and released with Gradle 7.0. Users relying on this feature should upgrade their build as soon as possible. As a workaround, users may use a company repository which has the right rules for fetching packages from public repositories, or use project level repository content filtering, inside `buildscript.repositories`. This option is available since Gradle 5.1 when the feature was introduced.

Severity (CVSS)

8.0 high CVSS 3.1 from GitHub_M (CNA)
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H
Attack vector
network: an attacker can reach the vulnerable part over the network, often from the internet
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
high: the attacker needs an administrative account
User interaction
none: nobody has to click or open anything
Scope
changed: the damage reaches other components, such as the host of a container or other users
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 1.31%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 71.4% of all scored CVEs. Scores of 1 Dec 2026.

Weakness

  • CWE-829 Inclusion of Functionality from Untrusted Control Sphere

Affected products

As the CNA lists them.

ProductVersions
gradle
affected >= 5.1, <= 6.8.3

Is my server affected?

Find the installed version of gradle and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i gradle
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-29427 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-29427

RHEL, Rocky, Alma, Fedora

rpm -q gradle
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-29427

Alpine

apk list --installed | grep -i gradle

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2021-29427
trivy image --scanners vuln IMAGE | grep CVE-2021-29427

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Advisories

Other references

Source: the record CVE-2021-29427 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.