GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: prevent remote signals from weakening operator-configured policy by gnodet · Pull Request #2082 · apache/maven-resolver

Conversation

@gnodet

@gnodet gnodet commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes 5 findings from the maven-resolver security audit (scan-maven-resolver-20260811):

Finding Severity Description
f011 MEDIUM Metadata checksum policy silently downgraded by release/snapshot weakest-wins merge
f012 MEDIUM Descriptor cache ignores repository context: poisoned POM resolution replayed build-wide
f014 MEDIUM Single remote probe drops the entire prefixes dependency-confusion filter
f015 MEDIUM Remote POM repository declaration downgrades mirror checksum policy to ignore
f018 MEDIUM Cached not-found converts transient denial into persistent source rerouting

Root cause: Policy merges, filter state, negative caches, and the descriptor cache all accept remotely-influenced input as authoritative, allowing hostile POMs to silently weaken operator-configured verification controls.

Fix: Input from a remote repository must never weaken an operator-configured verification or filtering decision. Merge strongest-wins, include repository context in cache keys, allow only verified paths instead of dropping filters.

Test plan

  • Existing tests pass
  • Checksum policy merge uses strongest-wins
  • Descriptor cache is repository-aware
  • Prefixes filter does not drop to accept-all on single probe

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@gnodet
gnodet force-pushed the security/remote-signal-policy-weakening branch from 47ba3c6 to 00f50bb Compare August 30, 2026 19:35
@gnodet @claude
fix: prevent remote signals from weakening operator policy
5fd1601
Co-Authored-By: Claude Opus 4.6 <[email protected]>
@gnodet
gnodet force-pushed the security/remote-signal-policy-weakening branch from 00f50bb to 5fd1601 Compare August 30, 2026 20:00
@gnodet
ci: retrigger Jenkins
f7f386e
@gnodet
gnodet marked this pull request as ready for review August 31, 2026 05:20
@gnodet
gnodet requested a review from cstamas August 31, 2026 05:20
@gnodet gnodet added bug Something isn't working priority:major Major loss of function labels Aug 31, 2026
@gnodet gnodet added this to the 2.0.23 milestone Aug 31, 2026
gnodet
gnodet commented Aug 31, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The five security audit fixes (f011, f012, f014, f015, f018) are all correctly implemented with sound logic, thorough test coverage, and opt-out configuration properties for each behavioral change.

@since tag corrections (4 locations)

All new constants and the site documentation reference 2.0.22, but that version is already released (tag exists). These should be @since 2.0.23:

  • DefaultRemoteRepositoryManager.java line 185: CONFIG_PROP_RAW_CHECKSUM_POLICY_DOWNGRADE
  • DefaultRemoteRepositoryManager.java line 292: CONFIG_PROP_NATURE_MERGE_WEAKEST_CHECKSUM_POLICY
  • PrefixesRemoteRepositoryFilterSource.java line 247: CONFIG_PROP_VERIFY_DENIED_DROPS_TREE
  • remote-repository-filtering.md line 222: "since 2.0.22" → "since 2.0.23"

Minor: duplicate helper methods

checksumPolicyRank() (lines 219-235) and checksumPolicyStrength() (lines 425-441) in DefaultRemoteRepositoryManager.java have identical implementations — same switch, same return values. Could be consolidated into a single method to reduce maintenance risk from future drift.

Positive observations

  • Each fix has an opt-out configuration property that restores legacy behavior — right pattern for security hardening
  • Thread safety of CachedPrefixes.verifiedServedPath is properly handled (volatile + synchronized)
  • The refactoring of repositoriesEquals() from private ConstraintKey to a shared utility is clean
  • Test coverage is thorough: default behavior, legacy opt-out, and edge cases for each fix

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

Claude Code on behalf of gnodet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cstamas
cstamas approved these changes Aug 31, 2026
View reviewed changes
@gnodet @claude
fix: correct @SInCE tags from 2.0.22 to 2.0.23
417390e
2.0.22 is already released; new API additions must target 2.0.23.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
gnodet
gnodet commented Aug 31, 2026
View reviewed changes

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Re-reviewed after the @since tag correction — the tags are now correctly set to 2.0.23 throughout.

The security hardening itself remains solid:

  • Checksum policy clamping prevents remote metadata from downgrading operator-configured verification
  • Repository-scoped descriptor cache stops poisoned POM resolution from being replayed across repository contexts
  • Resilient prefix filter no longer drops the entire dependency-confusion guard on a single remote probe
  • Each fix is gated behind a configuration property with secure defaults and backwards-compatible opt-in for legacy behavior

Test coverage is comprehensive. No new issues introduced by the follow-up commits.

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

Claude Code on behalf of gnodet

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
gnodet added a commit to gnodet/maven-resolver that referenced this pull request Aug 31, 2026
@gnodet
Re-reviewed PR apache#2082 (APPROVE->COMMENT) 2026-08-31T11:08:21Z
674ce04
@cstamas
cstamas merged commit 55252d5 into master Aug 31, 2026
24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@cstamas
cstamas deleted the security/remote-signal-policy-weakening branch August 31, 2026 11:08
@github-actions github-actions Bot assigned cstamas Aug 31, 2026
This was referenced Sep 1, 2026
Log expired not-found markers from the current session at debug level #2112
Closed
Allow the whole artifact directory once a denied prefix is verified as served #2113
Closed
@harshab054 harshab054 mentioned this pull request Oct 8, 2026
Fix prefix filter verification for denied artifact paths #2188
Merged
@Chris0mos Chris0mos mentioned this pull request Oct 9, 2026
Warning "expiring the cached not-found" logged for every artifact found in a later repository of the same session #2196
Closed
cstamas pushed a commit that referenced this pull request Oct 20, 2026
@harshab054
Fix prefix filter verification for denied artifact paths (#2188)
836f47a
Description

Fixes the Maven Resolver prefix filter behavior when a repository serves an artifact path that is missing from its "prefixes.txt".

A repository such as an Artifactory/Nexus virtual repository may expose a prefixes file generated from a public repository index while also serving private/internal artifacts. When the requested artifact path is absent from that prefixes file, the prefix filter can reject an artifact that the repository actually serves.

This change verifies a denied path against the repository before permanently rejecting it.

Implementation

- Successfully served denied paths are cached and allowed on subsequent requests.
- Definitively absent paths remain blocked and are negative-cached to avoid repeated remote probes.
- Transient/unknown transport failures are not negative-cached, allowing later requests to retry.
- Verification is performed per exact artifact path.
- Multiple independently denied paths can be verified without disabling the repository's prefix filter globally.
- Existing "verifyDeniedDropsTree=true" legacy behavior remains unchanged.

Security

The implementation preserves the security invariant introduced by Resolver PR #2082.

A successful verification of one denied path does NOT disable the prefix filter for the entire repository or authorize unrelated artifact paths.

Only the exact remotely verified path is allowed.

Tests

- "PrefixesRemoteRepositoryFilterSourceVerifyDeniedTest": 14/14 passed
- "PrefixesRemoteRepositoryFilterSourceTest": 6/6 passed
- Checkstyle: passed with 0 violations
- Spotless: passed
- "git diff --check": clean

Related Maven Issue

This addresses the underlying Maven Resolver behavior reported in Apache Maven issue #13385:

apache/maven#13385

The original issue is reported against Maven because Maven users experience the resolution failure, while the prefix filtering implementation itself lives in Maven Resolver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

bug Something isn't working priority:major Major loss of function

Projects

None yet

Milestone

2.0.23

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@gnodet @cstamas
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.