GRADLE-2022-0002

See a problem?
Import Source
https://github.com/gradle/advisory-database/blob/main/advisories/2022/GRADLE-2022-0002.json
JSON Data
https://api.test.osv.dev/v1/vulns/GRADLE-2022-0002
Aliases
Published
2022-07-14T19:54:12Z
Modified
2026-12-03T17:25:59Z
Severity
  • 6.6 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Gradle dependency verification skips checksum verification when signature verification cannot be performed
Details

Impact

Dependency verification is a security feature in Gradle Build Tool that was introduced to allow validation of external dependencies either through their checksum or cryptographic signatures.

In some cases, Gradle may skip that verification and accept a dependency that would otherwise fail the build as an untrusted external artifact.

This can occur in two ways:

  • When signature verification is disabled but your verification metadata contains entries for dependencies that only have a gpg element but no checksum element.
  • When signature verification is enabled, your verification metadata contains entries for dependencies with a gpg element but there is no signature file on the remote repository.

In both cases, the verification will accept the dependency, skipping signature verification and not complaining that the dependency has no checksum entry.

For builds that are vulnerable, there are two risks:

  • Dependency poisoning/Dependency confusion: Gradle could download a malicious binary from a repository outside your organization due to name squatting.
  • Man In The Middle: If you are still using HTTP only and not HTTPS for downloading dependencies, your build could download a malicious library instead of the expected one.

Patches

Gradle 7.5 patches this issue by making sure to run checksum verification if signature verification cannot be completed, whatever the reason.

Workarounds

  • Remove all gpg elements from dependency verification metadata if you disable signature validation.
  • Do not add gpg entries for dependencies that do not have signature files.

References

Questions?

  • For security related issues, please email us at security@gradle.com.
  • For non-security related issues, please open an issue on GitHub.
Database specific
{
    "cwe_ids":  [
        "CWE-829"
    ],
    "severity":  "MEDIUM"
}
References

Affected packages

Maven / org.gradle:gradle-core

Package

Name
org.gradle:gradle-core
View open source insights on deps.dev
Purl
pkg:maven/org.gradle/gradle-core

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.2
Fixed
7.5

Affected versions

6.*
6.2
6.2.1
6.2.2
6.3
6.4
6.4.1
6.5
6.5.1
6.6
6.6.1
6.7
6.7.1
6.8
6.8.1
6.8.2
6.8.3
6.9
6.9.1
6.9.2
6.9.3
6.9.4
7.*
7.0
7.0.1
7.0.2
7.1
7.1.1
7.2
7.3
7.3.1
7.3.2
7.3.3
7.4
7.4.1
7.4.2

Database specific

source
"https://github.com/gradle/advisory-database/blob/main/advisories/2022/GRADLE-2022-0002.json"