Repository content filters do not work in Settings pluginManagement
Key facts
- Attack vector
- Network
- Privileges required
- High
- User interaction
- None
- Attack complexity
- High
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 fixed, 2 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-829.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| gradle | gradle | 5.1 – 6.8.3 | — | No fix listed | CNA |
- gradle Vendorgradle Affected 5.1 – 6.8.3 Fixed in — No fix listed CNA
Remediation
Red Hat 1 advisory
- RHSA-2022:4623 Released 2022-05-18 · Red Hat rating ModerateRed Hat build of Quarkus 2.7.5 release and security update
- Red Hat build of Quarkus 2.7.5
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Integration Camel K 1 | Affected | No fix yet: Fix deferred |
| Red Hat build of Quarkus | Affected | No fix yet |
| Red Hat build of Quarkus 2.7.5 | Fixed | RHSA-2022:4623 |
Not affected: 5 products
- Red Hat Fuse 7
- Red Hat Integration Camel Quarkus 1
- Red Hat JBoss Enterprise Application Platform 7
- Red Hat JBoss Enterprise Application Platform Expansion Pack
- streams for Apache Kafka
Timeline
- 2026-10-02 Threatist record created from CVE-2021-29427
References
More Gradle vulnerabilities
- TI-2016-05320 ObjectSocketWrapper.java in Gradle 2.12 allows remote attackers to execute arbitrary code… CVSS 3.0CRITICAL 9.8
- TI-2020-09639 Injection in Apache Ant CVSS 3.1HIGH 7.5
- TI-2019-11237 The HTTP client in Gradle before 5.6 sends authentication credentials originally destined… CVSS 3.1CRITICAL 9.8
- TI-2021-12419 Arbitrary code execution via specially crafted environment variables CVSS 3.1HIGH 7.5
- TI-2023-11286 Gradle usage of long IDs for PGP keys opens potential for collision attacks CVSS 3.1CRITICAL 9.8
- TI-2021-10141 Local privilege escalation through system temporary directory CVSS 3.1HIGH 8.8
Sources
- CVE-2021-29427 · CVE Program
- CVE-2021-29427 · NVD
- FIRST EPSS
- CVE-2021-29427 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences