fix(security): reject missing tenant authority at submission boundary - #346
fix(security): reject missing tenant authority at submission boundary#346seonghobae wants to merge 3 commits into
Conversation
|
Warning Review limit reached
Next review available in: 6 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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 |
Objective
Advance issue #317 with one path-local production security boundary: the tenant-aware service entrypoint must fail closed when authenticated tenant context is absent instead of silently manufacturing
buyer-demoauthority and continuing validation, deduplication, persistence, artifact work, and enqueue.Fresh exact state — 2026-08-10
d4a59a72b485b76c7870770ca69c6963bc8346c1;main:55d7ae8647208e301f282350f076eeddaba61d11;31404369157: success;31404368715: success;31404369100: success;31404369115: success;d4a59a72b485b76c7870770ca69c6963bc8346c1; 497 tests ran with 0 failures, 0 errors and 0 skips; all JaCoCo coverage checks and public Javadocs passed;Test-first evidence
RED
Test-only head
d6a6729d21fd2c0adc876b2b89bb5991c4d086b0added a focused regression around the three-argument tenant-awaresubmit(...)service boundary before production changes. Exact-head CI31403123801checked out that exact SHA and failed one of 497 tests. Instead of the required controlledIllegalArgumentException("tenant context is required"), protected-main behavior continued through the null-context demo fallback and eventually produced aNullPointerExceptionwhen the mocked repository returned no canonical result. That proved the service crossed validation/repository boundaries after authority was absent. Security Scan, Semgrep and fuzz were already GREEN on the RED head.GREEN
The tenant-aware three-argument
submit(...)now rejects a nullTenantContextimmediately, before policy validation, hashing, deduplication, persistence, PDF artifact seeding or enqueue. The two-argument demo convenience overload remains explicit and continues to construct its own demoTenantContext; this slice therefore removes only the unsafe implicit null-to-demo escalation from the production tenant-aware boundary.Focused GREEN tests prove:
IllegalArgumentException("tenant context is required");The unchanged exact head is GREEN through the full Maven lifecycle, synthetic-main merge compatibility, security scan, Semgrep and fuzz.
Scope boundary
This does not remove the legacy two-argument demo convenience overload, redesign browser/session bootstrap, modify
viewer.js,demo.jsordom-utils.js, implement OIDC/JWT federation, or touch active Office adapter #306. It is a narrow fail-closed prerequisite for issue #317's broader production workspace authority work and does not claim that demo authority has been fully removed.Merge gate
Move to Ready for ordinary independent review. Keep this exact head unchanged. Merge or auto-merge may complete only after live protection still sees all applicable required gates passing, zero valid unresolved findings, and any required qualifying independent non-author approval. Automated evidence is not approval.