chore: harden embedded-POM trust boundary in install:install-file - #446
Open
gnodet wants to merge 2 commits into
Open
chore: harden embedded-POM trust boundary in install:install-file#446gnodet wants to merge 2 commits into
gnodet wants to merge 2 commits into
Conversation
Security audit findings (static analysis, no live exploit demonstrated): - f001 (MEDIUM): Make coordinate adoption from embedded POM visible and cross-checked — fail on multiple POM entries, validate entry-path vs model GAV, log at INFO, warn before overwriting, validate packaging - f002 (MEDIUM): Skip embedded POM when full CLI coordinates supplied; cross-check operator-supplied coordinates against embedded POM - f003 (LOW): Defense-in-depth DOCTYPE rejection for embedded POM XML with encoding-aware screening (UTF-8/16/32, EBCDIC) - f004 (LOW): Reject empty/dot-only coordinates and leading-dot groupIds; containment-check install path against local repository root Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The embedded-POM trust hardening changed log.debug() to log.info() for provenance visibility. Update the integration test assertions to match the new log level and message format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
marked this pull request as ready for review
September 1, 2026 10:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens the embedded-POM trust boundary in
install:install-file, addressing four findings from a static security audit of the Maven 4 line (commit0bfcb64).Findings addressed
Changes
META-INF/maven/*/pom.xmlentries match; validate entry-path<g>/<a>against the embedded POM's effective GAV; log adopted coordinates at INFO (was DEBUG); WARN before overwriting an existing local-repo artifact with different content; validatepackagingwith the same rules as other coordinates.readingPomFromJarFile()entirely and generate a minimal POM. When partial coordinates are supplied, cross-check each against the embedded POM and fail on mismatch.<!DOCTYPEbefore handing them toModelXmlFactory.read(). Encoding-aware: BOM/first-bytes/XML-declaration sniffer covering UTF-8/16/32 and EBCDIC, with fail-closed handling for unsupported encodings and unterminated declarations.isValidId()rejects empty and dot-only values; newisValidGroupId()rejects leading/trailing/consecutive dots;isValidVersion()rejects empty and dot-only values. Defense in depth: composed layout path must reside under the local repository root.Category
Security hardening — no live exploit demonstrated; static-analysis findings from a 5-lane audit with blind triage panel.
Test plan
mvn clean install -Bsucceeds🤖 Generated with Claude Code