GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — fix: atomic file publication and authenticated IPC lock daemon by gnodet · Pull Request #2083 · apache/maven-resolver Conversation
Contributor
SummaryFixes 3 findings from the maven-resolver security audit (scan-maven-resolver-20260811):
Root cause: The concurrency layer has spots where its own guarantee is violated: Windows publication is not atomic, and the IPC lock daemon trusts every connection and digests keys ambiguously. Fix: Atomic rename on Windows with retry, authenticated IPC daemon with SecureRandom tokens and peer credentials, unambiguous length-prefixed key digest. Test plan
🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
gnodet
force-pushed
the
security/locking-atomicity
branch
from
c4d9f95 to
14b23c9
Compare
…handling Co-Authored-By: Claude Opus 4.6 <[email protected]>
cstamas
approved these changes
gnodet
commented
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent security-hardening PR — defense-in-depth across the IPC lock protocol with comprehensive tests. Strengths
One observation
Overall this is high-quality, well-thought-out security work. Well done!
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions2.0.22 is already released; new API additions must target 2.0.23. Co-Authored-By: Claude Opus 4.6 <[email protected]>
cstamas
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
This was referenced
Windows AccessDeniedException on install when IDE holds the jar open (Maven 3.10.0 regression)
#2204
Closed
cstamas
pushed a commit
that referenced
this pull request
…r open (#2205) ## Summary Fixes a Windows regression introduced by PR #2083 (resolver 2.0.24 / Maven 3.10.0): `mvn install` throws `java.nio.file.AccessDeniedException` when an IDE (e.g. IntelliJ IDEA) keeps the installed `.jar` open. Closes #2204 · Closes apache/maven#13329 ## Root Cause PR #2083 replaced the old stream-based file copy with `Files.move()` + `ATOMIC_MOVE` in `PathProcessorSupport.retryingMove()` to fix the f007 security finding. That was the right thing to do — but it introduced a behavioral regression on Windows. **Old behavior (resolver ≤ 1.9.x):** `classicCopy()` opens the target with a truncating `FileOutputStream`. On Windows, this succeeds even when another process has the file open for reading, because the stream open uses `FILE_SHARE_READ` semantics. **New behavior (resolver 2.0.24):** `Files.move()` maps to `MoveFileEx`/`ReplaceFile` on Windows. These system calls **require exclusive access** to the destination — any open handle (including a shared read-only handle from an IDE's class loader) causes `AccessDeniedException`. With only 5 retries at 50 ms (250 ms total), a persistent IDE lock is never released and all retries fail. | Operation | Target open by reader? | Succeeds on Windows? | |---|---|---| | `FileOutputStream(target)` (stream write) | Yes (shared read) | ✅ Yes | | `Files.move(src, target, ATOMIC_MOVE)` | Yes (shared read) | ❌ No — needs exclusive | ## Fix After exhausting all `WINDOWS_MOVE_ATTEMPTS` with `AccessDeniedException`, fall back to `classicCopy()` directly to the target as a last resort, logging a `WARN` to identify the situation. The atomicity guarantee is lost for this edge case (a concurrent reader may observe a partially written file), but the build completes — matching the pre-2.0.24 behavior that users relied on. A new system property controls the fallback: ``` -Dorg.eclipse.aether.spi.io.PathProcessor.WINDOWS_CLASSIC_COPY_FALLBACK=false ``` Setting it to `false` disables the fallback and propagates the original `AccessDeniedException` (strict never-truncate mode). The fallback is also exposed as an overridable `protected boolean isClassicCopyFallbackEnabled()` method for subclasses and tests. ## Note on PR #2198 The open PR #2198 (hard-link install) sidesteps this problem for `mvn install` by not copying at all. This PR fixes the underlying `retryingMove` logic, which is also exercised in other code paths (download to local repo, `writeFile`). The two PRs are complementary. ## Changes - `maven-resolver-spi/pom.xml` — add `slf4j-api` compile dependency and `slf4j-simple` test dependency - `PathProcessorSupport.java` — add `WINDOWS_CLASSIC_COPY_FALLBACK` constant, `isClassicCopyFallbackEnabled()` hook, fallback logic in `retryingMove()` - `PathProcessorSupportTest.java` — rename `retryingMoveNeverTruncatesTargetOnFailure` → `...WhenFallbackDisabled` (adds subclass override), add `retryingMoveFallsBackToClassicCopyOnPersistentLock` _Hermès Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesLabelsProjectsDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |