Skip to content

[Backport 4.0.x] Fix #12427: Reject path-traversal segments in coordinate ids and versions - #12565

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12410-path-traversal
Jul 28, 2026
Merged

[Backport 4.0.x] Fix #12427: Reject path-traversal segments in coordinate ids and versions#12565
gnodet merged 1 commit into
maven-4.0.xfrom
backport/12410-path-traversal

Conversation

@gnodet

@gnodet gnodet commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Backport of #12410 to maven-4.0.x.

Coordinate ids (groupId, artifactId) and versions equal to . or ..
pass character validation but become path-traversal segments in the local
repository layout. Both the maven-impl and compat maven-model-builder
validators now reject these values. Tests added for both modules.

Conflict resolution: trivial variable naming difference (i/c on 4.0.x
vs index/character on master).

…ions

Coordinate ids (groupId, artifactId) and versions equal to '.' or '..'
pass character validation but become path-traversal segments in the
local repository layout. Both the maven-impl and compat
maven-model-builder validators now reject these values in id checks,
wildcard-id checks, and version checks. Tests added for both modules.

Closes #12410
@gnodet gnodet added this to the 4.0.0-rc-6 milestone Jul 28, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean backport of #12410 (merged on master). The security fix correctly rejects . and .. as coordinate ids and versions to prevent path-traversal in the local repository layout. Both compat/maven-model-builder and impl/maven-impl validators are covered with well-structured tests (single-dot and double-dot cases). The isPathTraversalSegment() helper is clearly documented with Javadoc explaining why these values are rejected.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

gnodet added a commit to gnodet/maven that referenced this pull request Jul 28, 2026
@gnodet gnodet added the mvn40 label Jul 28, 2026
@gnodet
gnodet merged commit ff7e765 into maven-4.0.x Jul 28, 2026
24 checks passed
@gnodet
gnodet deleted the backport/12410-path-traversal branch July 28, 2026 14:33
@gnodet gnodet added the bug Something isn't working label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mvn40

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants