fix: deploy-side integrity must fail closed - #2084
Conversation
9ebd6b1 to
fc737b1
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fc737b1 to
7b883cd
Compare
|
Re "First matching checksum algorithm accepts, skipping stronger provided checksums": this was always the behaviour of Resolver (default SHA1, MD5). The idea is that when user configures |
|
Also, by checking all checksums, Resolver "lazyness" is being removed, and also may trigger extra HTTP roundtrips (think about reposes that have "optional" checksums, like Central -- not all of it has SHA512). Basically this change IMHO should then (would be logical) to trigger another change, to mark listed checksum "optional", as otherwise, "mixed reposes" (just like Central is), cannot be uniformly configured, OR, user is forced to use "least common denominator" (that is SHA1) in cases where they may be available stronger algorithms. |
|
So, checksums list were envisioned as:
|
|
@cstamas — thanks for the detailed review, both points are important. Let me clarify the scope of the change, because the implementation already splits the behaviour along exactly the line you're drawing: PROVIDED / REMOTE_INCLUDED checksums (
|
cstamas
left a comment
There was a problem hiding this comment.
Explanations aligns, I am okay now with PR
gnodet
left a comment
There was a problem hiding this comment.
Solid set of fail-closed security fixes for four audit findings (f022, f023, f029, f030). All implementations are correct and well-tested.
@since tag corrections (6 locations)
All six new @since tags reference 2.0.22, but that version is already released. They must be @since 2.0.23:
BasicRepositoryConnectorConfigurationKeys.java—CONFIG_PROP_CHECKSUM_UPLOAD_FAIL_CLOSEDFileTrustedChecksumsSourceSupport.java—getTrustedMetadataChecksums+doGetTrustedMetadataChecksumsProvidedChecksumsSource.java—getProvidedMetadataChecksumsTrustedChecksumsSource.java—getTrustedMetadataChecksums+Writer.addTrustedMetadataChecksums
Minor observation (not blocking)
hasSignature and isSignatureArtifact are duplicated identically in GnupgSignatureArtifactGenerator and SigstoreSignatureArtifactGenerator. Consider extracting to a shared utility to reduce maintenance risk.
Positive observations
- f022: Checksum upload fail-closed defaults correctly with per-repository override
- f023: Metadata checksum SPI extension uses backward-compatible default methods
- f029:
validateChecksumscorrectly returnsaccepted && !rejected(all-must-match) - f030: Per-artifact signature check replaces all-or-nothing bail-out
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
2.0.22 is already released; new API additions must target 2.0.23. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Fixes 4 findings from the maven-resolver security audit (scan-maven-resolver-20260811):
.ascsilently disables signing of all deploy artifactsRoot cause: On the publication and strongest-verification paths, failures degrade silently: checksums that fail to upload are logged and forgotten, one pre-existing signature disables signing wholesale, and trusted-checksums has structural coverage gaps.
Fix: Deploy must be atomic across artifact bytes and integrity metadata: propagate failures, cover metadata, compare all checksums, per-artifact signature skip.
Test plan
🤖 Generated with Claude Code