Repository navigation
[fix] Enforce relay authentication and local filesystem authorization boundaries - #351
Draft
paul-fresquet wants to merge 8 commits into
Draft
paul-fresquet wants to merge 8 commits into
paul-fresquet wants to merge 8 commits into
Conversation
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
Relay authentication must prove possession of the client's durable key, and synchronization must only access filesystem locations explicitly authorized on the local machine. This PR enforces both boundaries across login, session operations, transfers, replicated inventories, and synchronization execution.
ClientIdseparate from cryptographicIdentity; bind both to the signed challenge. Use verified identity and epoch for JWTs, refresh tokens, SignalR subscriptions and authorization.auth/challenge, without attempting legacy login. Display an actionable English/French relay compatibility error while preserving retries for transient failures.Compatibility and rollout
This is a breaking protocol change: relay and session peers must use matching V3 builds, including the revised canonical login message and identity-bound trust confirmations in this unreleased PR. Existing
ClientIdcodes retain their storedABCD-EFG-HIJformat across the client, public-key information, login, server records, endpoints and JWT ClientId claim. Startup and login do not reset ClientId, regenerate RSA keys or clear trusted peers. The existing explicit manual-renewal action still regenerates keys/readable code and clears trust after confirmation; it now synchronizes the runtime identity and connection too.Identityis the full RSA fingerprint, andClientInstanceIdremains<Identity>_<GUID>. Readable aliases never grant authority: collisions cannot merge identities or adopt legacy records, and existing peer trust still requires the previously accepted key. Dormant profile/lobby ownership checks use an explicit slot identity without adding profile migration. Legacy tokens, sessions and remote relationships are not silently promoted. Restored profiles require prior local enrollment of their exact sources.Filesystem access deliberately rejects symlinks, reparse points, hard-linked file content, UNC/device sources and unsafe relative paths. Directory deletion remains nonrecursive.
Deployment requires a coordinated client/relay cutover. No Azure configuration, deployment, or Functions build-SDK migration is included.
Validation
The solution, including the migrated Functions integration/E2E fixtures, builds with zero errors. Existing warnings remain.
git diff --checkpasses.The latest client suite passes 1,317 tests with zero failures, including 18 additional cases for coherent manual key renewal, real RSA-PSS login after renewal, token clearing, refusal/failure paths, refresh draining, automatic restart and UI availability. Pending relay reconnection does not block displaying the renewed identity. The 431 server, 66 Functions and 54 Common results above are from the preceding P1 validation; backend production code is unchanged and these suites were not rerun for the client-only P2 correction.
P2 coverage reaches 88 of 93 changed executable/instrumented lines (94.6%), including the XAML tooltip sequence point. P1 covered 56 of 57 changed executable production lines (98.2%), with 100% coverage of the trust-confirmation handler. These change-specific metrics do not establish the PR-wide Sonar gate.
Trust-confirmation regressions cover authenticated issuer metadata, same-alias peers and distinct instances of one key, incorrect identity/instance/session, recipient key binding, expired join attempts, old exchanges and duplicate confirmations. Other existing regressions cover preserved readable IDs and saved keys/trust at startup/login, signed authentication and refresh replay, join-proof retry/finalization, storage scope, Redis 6.0 compatibility and local filesystem authorization.
Dependencies were restored from the local NuGet cache. No Azure services or Docker were used. P1 and P2 from the review are both addressed.
Functions integration and E2E fixtures now request and sign challenges, use current identity/epoch refresh records and server storage object IDs, and authenticate join validation as the validator. They compile but were not executed because Azure access and Docker startup are prohibited for this task. The correction commit uses
[skip ci]to avoid automatically invoking the existing Azure/container workflows after the requested push.Twelve POSIX-only client cases did not execute on Windows. Earlier local filesystem integration validation passed 40 tests, with six OS/ACL cases not executed.
Remaining validation
LocalPathSafetywas 63%, below the 85% target; no exclusions hide the unexecuted POSIX paths. The PR-wide 80% Sonar gate has not yet been demonstrated.See the implementation, validation and rollout report for detailed evidence and limitations.