Repository navigation
fix(config): require owner-only no-follow registry publication - #6375
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (3)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughOwner-registry publication now hardens the registry directory before writing a pointer. The change adds POSIX permission and symlink checks, requires successful directory hardening, clarifies the atomic-writer contract, and adds tests for POSIX and Windows behavior. ChangesOwner-registry publication
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Registration as registerOwnerRegistryHome
participant Directory as Registry directory
participant Hardening as hardenSecretDir
participant Writer as atomicWriteFileNoFollow
Registration->>Directory: Create with mode 0700 and check directory type
Registration->>Hardening: Harden registry directory
Hardening-->>Registration: Return hardening result
Registration->>Writer: Write pointer after successful hardening
Merge Risk: ⚪ Minimal · up to The change strengthens registry publication and prevents publication when directory hardening fails. No actionable merge-blocking risk remains after normal checks; the existing Windows ownership weakness is outside this change. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change strengthens publication safety without expanding access or authority. A pre-existing Windows directory-ownership limitation remains, but independent identity and attestation checks limit the consequences of registry tampering. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
✅ Deterministic PR hygiene checks passed. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Maintainer integration record (MAINTAINERS.md, dev-only) — DRAFT from lane L3
|
On macOS tmpdir() is under /var, a symlink to /private/var. The no-follow writer resolves the registry's parent, so the icacls stub saw /private/var paths, failed its root-prefix assertion inside the swallowed registration and left the registry empty. #6375's CI never ran the macOS shards; this PR does, and macos 1/2 failed at owner-registry-acl.test.ts:72. Test-only fix.
Summary
Owner-registry publication could follow an attacker-planted final-entry symlink, and a permissive registry directory could expose the publication surface. Reject a symlinked registry directory, require the existing owner-only directory hardening helper, and publish entries with the no-follow atomic writer. The required hardening call also applies on Windows; mocked contract checks cover hardening failure and publication ordering.
Source history is preserved through commit
e077abf0fbbc1a88f2580c957fe8df4408897b2f. The local validation below used the integration withdevat0328373fb88fe0d019b29ae278e153d7fed4bcc7.Verification
Current upstream integration:
a6114b62ed1b65dede802359ccd373d913979b24; published HEADc912ec1bfd3dd8216a7050a5251519f74f3b00df. The source history through8e1a33352cb89dbd1028d1ded1a6c4c8ae0b5df2is retained without rewriting authors or commits. The PR-specific change was checked again after this integration; typecheck, structure, privacy and file-size gates passed. Cross-platform CI succeeded for this exact HEAD; its checkout tree matches the published HEAD tree. Skipped jobs remain skipped.Windows, Bun 1.4.0, isolated test temporary directory:
bun test tests/config/owner-registry-acl.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts: 24 passed, 0 failed, 601 assertions. The ACL contract is checked with controlled stubs; these results do not claim a real Windows ACL mutation or a live owner-registry rollout.bun node_modules/typescript/bin/tsc --noEmit: passed.bun scripts/structure-ssot.ts: passed.bun scripts/privacy-scan.ts: passed.bun scripts/file-size-ratchet.ts: passed.git diff --cached --check 0328373fb88fe0d019b29ae278e153d7fed4bcc7: passed.The full local suite and
test:changedwere not run under the focused-validation exception because concurrent isolated worktrees made the full suite impractical. Focused contract checks do not replace independent review of real Windows directory ownership and no-follow publication behavior. Exact-HEAD CI succeeded; results from another HEAD are not its verification.Checklist
c912ec1bfd3dd8216a7050a5251519f74f3b00df, known correct findings are addressed, and exact-HEAD CI is complete; author review readiness is confirmed.Independent maintainer approval, explicit security review, and any required
maintainer-sponsoreddecision remain pending before merge. These are separate from author review readiness; no approval or sponsorship is claimed.Summary by CodeRabbit