CVE-2022-31156Gradle's dependency verification can ignore checksum verification when signature…
Gradle is a build tool. 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 versions 6.2 through 7.4.2, there are some cases in which 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 the verification metadata contains entries for dependencies that only have a `gpg` element but no `checksum` element. When signature verification is enabled, the 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. Gradle could download a malicious binary from a repository outside your organization due to name squatting. For those still using HTTP only and not HTTPS for downloading dependencies, the build could download a malicious library instead of the expected one. Gradle 7.5 patches this issue by making sure to run checksum verification if signature verification cannot be completed, whatever the reason. Two workarounds are available: Remove all `gpg` elements from dependency verification metadata if you disable signature validation and/or avoid adding `gpg` entries for dependencies that do not have signature files.
What to do
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | gradle | Fix pending | UBUNTU-CVE-2022-31156 | |
| Ubuntu 26.04 | gradle | Under investigation | UBUNTU-CVE-2022-31156 | |
| Ubuntu 25.10 | gradle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31156 | |
| Ubuntu 24.04 | gradle | Under investigation | UBUNTU-CVE-2022-31156 | |
| Ubuntu 22.04 | gradle | Under investigation | UBUNTU-CVE-2022-31156 | |
| Ubuntu 20.04 | gradle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31156 | |
| Ubuntu 18.04 | gradle | Fix pending | UBUNTU-CVE-2022-31156 | |
| Ubuntu 16.04 | gradle | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31156 | |
| Ubuntu 14.04 | gradle | Will not fix Ubuntu decided not to fix this in this release |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- gradle: affected: >= 6.2, <= 7.4.2
References
- https://github.com/gradle/gradle/security/advisories/GHSA-j6wc-xfg8-jx2j
- https://docs.gradle.org/7.5/release-notes.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.