Skip to content

feat: Optimize Gradle wrapper checksum validation#3736

Draft
fbricon wants to merge 1 commit into
eclipse-jdtls:mainfrom
fbricon:reduce-gradlew-checksum-checks
Draft

feat: Optimize Gradle wrapper checksum validation#3736
fbricon wants to merge 1 commit into
eclipse-jdtls:mainfrom
fbricon:reduce-gradlew-checksum-checks

Conversation

@fbricon

@fbricon fbricon commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Replace the download-all-versions pipeline with a single-version lookup
that validates the wrapper JAR before Gradle runs, preventing a
compromised wrapper from executing. The new flow checks user-allowed
checksums, bundled checksums.json (by version then by value), a
per-version disk cache, and finally a single network fetch with a
5-second timeout. An unparseable distributionUrl with an unknown JAR
is now treated as INVALID rather than silently allowed.

  • Add VALID/INVALID/UNVERIFIABLE enum to ValidationResult
  • Move validation into getGradleDistribution() (before import)
  • Delete DownloadChecksumJob (inline fetch with short timeout)
  • Remove waitForLoadingGradleVersionJob / LoadingGradleVersionJobMatcher
  • Remove versions.json from runtime bundle (build-time only)
  • Add version field to checksums.json entries in Groovy script
  • Cache fetched checksums to disk per version for offline reuse
  • Fix getDisallowed() returning allowed set instead of disallowed
  • Simplify GradlePreferenceChangeListener to trigger re-import

Fixes redhat-developer/vscode-java#4357

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@fbricon fbricon force-pushed the reduce-gradlew-checksum-checks branch from 282bc2e to 861577e Compare March 11, 2026 14:09
Replace the download-all-versions pipeline with a single-version lookup
that validates the wrapper JAR before Gradle runs, preventing a
compromised wrapper from executing. The new flow checks user-allowed
checksums, bundled checksums.json (by version then by value), a
per-version disk cache, and finally a single network fetch with a
5-second timeout. An unparseable distributionUrl with an unknown JAR
is now treated as INVALID rather than silently allowed.

- Add VALID/INVALID/UNVERIFIABLE enum to ValidationResult
- Move validation into getGradleDistribution() (before import)
- Delete DownloadChecksumJob (inline fetch with short timeout)
- Remove waitForLoadingGradleVersionJob / LoadingGradleVersionJobMatcher
- Remove versions.json from runtime bundle (build-time only)
- Add version field to checksums.json entries in Groovy script
- Cache fetched checksums to disk per version for offline reuse
- Fix getDisallowed() returning allowed set instead of disallowed
- Simplify GradlePreferenceChangeListener to trigger re-import

Fixes redhat-developer/vscode-java#4357

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fbricon fbricon force-pushed the reduce-gradlew-checksum-checks branch from 861577e to 977f5dd Compare March 12, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DownloadChecksumJob fails for Gradle snapshot versions fetched from versions API, causing projects to fall back to unmanaged/invisible project mode

1 participant