Repository navigation
fix(net): refuse chained and wildcard origin mounts in any order - #4362
Conversation
origin::Producer::mount compared a new mount only against existing mount points, so a -> z then z -> secret chained while the reverse was refused, making a grant's acceptance depend on its key order. The overlap check is now symmetric, and a mount point holding a wildcard is InvalidPath. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No concrete merge-blocking issue remains; the mount-validation change is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change tightens mount validation and rejects invalid grants before creating session handles. The reviewed paths show no new access-expansion route, although previously accepted mounts may now be refused. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
MERGE Positive improvement: closes two real post-merge gaps from #4271. The asymmetric overlap check made grant acceptance depend on Worth the complexity: the change is small and local. Symmetrizing the overlap predicate ( Different approach: nothing better jumps out. Leaving self-overlap ( Ship it. This is an automated review, not the maintainer's decision |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96ed01968a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge summary
Enabling squash auto-merge pinned to 72c49dd. (Written by Opus 5.5) |
Problem
Two gaps in
origin::Producer::mountfrom #4271, both raised by Codex after merge:atandtargetonly against existing mount points, never a newatagainst existing targets. Soa -> zthenz -> secretwas accepted (reads ofa/fooresolve to rawz/foo, the subtree the second mount shadows), while the reverse order was refused. Grant mounts apply from aBTreeMap, so whether a relay accepted a grant depended on key sort order.*(e.g. a grant key"*") was accepted, though no pattern can spell it, so it could never be announced downstream or authorized.Fix
Duplicatewhen itsatoverlaps an existing mount point or target, or itstargetoverlaps an existing mount point. A mount whose ownatandtargetoverlap (a -> a/b,a/b -> a,a -> a) isDuplicatetoo. Acceptance no longer depends on insertion order. Mounts may still share a target (the aliasing case feat(net): read a subtree through an origin mount #4271 benchmarks).atis validated withPattern::literal, returningError::InvalidPathlike any other unspellable path.Cluster::mountedlogsgrant mount refusedwith the error and admits nothing), so such grants are now refused outright rather than partially applied. Added a relay regression for both shapes.doc/concept/moq-lite.mdanddoc/bin/relay/auth.mdstate the rule.Tests:
mount_never_widens_a_scopegains the reverse-order chain cases, a shared-target case, and self-overlap cases; newmount_refuses_a_wildcard_mount_pointandsession_handles_refuse_invalid_grant_mounts(the relay test fails onmainwith the key-ordered chain{".a": "pid/.z", ".z": "secret"}).just checkpasses.Impact
origin::Producer::mountrefuses more inputs (Duplicatefor a mount point overlapping an existing target or its own,InvalidPathfor a wildcard mount point).mountschain or use a wildcard key is now refused by moq-relay (previously accepted depending on key order).Grant::validateis unchanged, since overlap depends on the session root.Maintainer decisions
Open decisions
js/netstill has nomountcounterpart (out of scope here, as in feat(net): read a subtree through an origin mount #4271).(Written by Opus 5.5)
🤖 Generated with Claude Code