fix(dav): reject ambiguous nested authorization encodings - #1345
fix(dav): reject ambiguous nested authorization encodings#1345seonghobae wants to merge 33 commits into
Conversation
📝 WalkthroughWalkthroughThe PR adds bounded DAV authorization-path normalization, restricts allowlisted local provider hostnames to approved private networks, and adds organization scoping to document queries. Tests and boundary documentation cover the updated behavior. ChangesDAV authorization path validation
Local provider network boundaries
Document organization authorization
Estimated code review effort: 3 (Moderate) | ~30 minutes Merge Risk: 🟡 Moderate · up to This PR tightens DAV authorization decoding, local-provider network restrictions, and organization-scoped document access. It is not merge-ready until qualifying fresh independent review and every live required check succeed on the unchanged current head; the remaining branch-coverage request is a non-blocking follow-up. Sequence Diagram(s)sequenceDiagram
participant DAVClient
participant DAVHandler
participant PathNormalizer
participant DAVAuthorization
participant PROPFINDHandler
DAVClient->>DAVHandler: send DAV request with authorization path
DAVHandler->>PathNormalizer: validate and normalize path
PathNormalizer-->>DAVHandler: normalized path or HTTP error
DAVHandler->>DAVAuthorization: authorize normalized path
DAVAuthorization-->>DAVHandler: authorization result
DAVHandler->>PROPFINDHandler: process normalized path
PROPFINDHandler-->>DAVClient: WebDAV response
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 |
|
PR governance metadata gate is not ready for
|
|
Current-head review disposition for the remaining DAV test comment: not a valid code/test defect on @coderabbitai review |
|
I have withdrawn that finding. I will run a fresh automated review of the current head. 🐇 ✏️ Learnings added
|
|
@coderabbitai review |
|
|
@coderabbitai review |
|
Superseded by later exact-head fixes. The DAV normalized-path finding is resolved and its review thread records it as addressed. This dismissal clears stale predecessor-head review state only; a fresh qualifying current-head independent approval remains required.
Bring Ready PR #1206 onto protected develop@dd8d15191338b841f9e6f3a06507c6a5643b95d0 with a normal merge commit. Preserve opaque prompt_uid, CardDAV single-pass decode, and OIDC-only admin roles. Do not pull #1345 workspace-document isolation. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Bring protected develop@dd8d15191338b841f9e6f3a06507c6a5643b95d0 (#1367 calendar conflicts and later develop history) into fix/dav-single-decode-authorization without changing DAV single-decode authorization, capability advertisement, local-provider SSRF, or workspace-document organization isolation semantics. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
|
@coderabbitai review Please review the unchanged exact current head |
|
|
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current headff6e47554a76992f8166d28aca5ffc12bd5e2088. -
Head SHA:
ff6e47554a76992f8166d28aca5ffc12bd5e2088 -
Workflow run: 32116669104
-
Workflow attempt: 1
Coverage evidence
Coverage evidence job did not run or did not publish coverage evidence.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Backend (7 files)"]
S1 --> I1["API and service runtime"]
I1 --> R1["Review risk: Backend (7 files)"]
R1 --> V1["backend tests"]
Evidence --> S2["Docs: dav-and-local-provider-network-boundaries.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: dav-and-local-provider-network-boundaries.md"]
R2 --> V2["docs review"]
OpenCode Review Overview
Pull request overviewOpenCode cannot approve yet because required coverage evidence did not pass. Review outcome1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
Coverage evidenceCoverage evidence job did not run or did not publish coverage evidence. Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Backend (7 files)"]
S1 --> I1["API and service runtime"]
I1 --> R1["Review risk: Backend (7 files)"]
R1 --> V1["backend tests"]
Evidence --> S2["Docs: dav-and-local-provider-network-boundaries.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: dav-and-local-provider-network-boundaries.md"]
R2 --> V2["docs review"]
|
There was a problem hiding this comment.
Pull request overview
OpenCode cannot approve yet because required coverage evidence did not pass.
Review outcome
1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence
-
Problem: The required coverage-evidence job result was
failure, so OpenCode cannot establish approval sufficiency for this head. -
Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.
-
Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports
successwith required evidence or explicit no-source not-applicable evidence. -
Regression test: Keep the approval branch checking
needs.coverage-evidence.result == successbefore posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present. -
Result: REQUEST_CHANGES
-
Reason: coverage-evidence result was
failure, so required test/docstring evidence was not proven for current head89d885084fec5510c53c8cab992bf1f41c6abd55. -
Head SHA:
89d885084fec5510c53c8cab992bf1f41c6abd55 -
Workflow run: 32420608708
-
Workflow attempt: 1
Coverage evidence
Coverage evidence job did not run or did not publish coverage evidence.
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Backend (7 files)"]
S1 --> I1["API and service runtime"]
I1 --> R1["Review risk: Backend (7 files)"]
R1 --> V1["backend tests"]
Evidence --> S2["Docs: dav-and-local-provider-network-boundaries.md"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs: dav-and-local-provider-network-boundaries.md"]
R2 --> V2["docs review"]
Verified: coverage-evidence and other non-metadata-gate required checks on the current head now report pass (gh pr checks). The coverage-evidence failure this review cited has since cleared on rerun. Dismissing as superseded.
|
Strix finding disposition (check-run 97109339574, model MEDIUM "Authentication Bypass via Session Verifier Override in AuthContext" — REBUTTED (false positive on unchanged trusted context). The report itself is conditional ("If there exists a code path where..."); no such path exists:
|
|
Fresh authority correction: the live protected base is |
Current authority
This PR is the Naruon owner for the existing workspace-document organization boundary and the DAV/WebDAV single-decode/capability-truth repair. It does not own LLM-provider routing or provider-network policy.
develop@042b0c70531b229af3acbd0421a2f23098d848b3fix/dav-single-decode-authorization9a019892f7d53f72415fa5633a0facd73815b8f4The prior head
8146c56587acea5c4aa859ba9366eef0f39540d7is retained in ancestry. It carried an unrelated local-LLM-provider network-policy slice. The ordinary child9a019892...restoresbackend/services/llm_provider_urls.pyandbackend/tests/test_llm_provider_urls.pyto their exact protected-developblobs without force-pushing or rewriting history, and rewrites the doctoring note to the DAV/document boundary only.Bounded fixes retained
OPTIONSadvertises DAV Level 1 and only the methods implemented by this endpoint; unsupported richer/writeback verbs remain unregistered rather than being advertised and then rejected downstream._get_workspace_documentand the Data quality-surface document list scope persistedDocument.organization_idtogether with signedworkspace_id; personal sessions requireorganization_id IS NULL.Current effective files are:
backend/api/data.pybackend/api/dav.pybackend/tests/test_data_document_authorization.pybackend/tests/test_dav_api.pybackend/tests/test_dav_normalized_route.pydocs/doctoring/dav-and-local-provider-network-boundaries.mdThe doctoring filename is retained for history, but its content now explicitly limits this decision to DAV/WebDAV and workspace-document authorization. It records RFC 3986 §§2.1/2.4 and RFC 4918 §10.1 traceability plus the external owner boundary.
External owner boundary
LLM-provider selection, provider URL/routing policy, provider-network SSRF policy, DNS-rebinding controls, credentials, and fallback behavior belong to the released
contextual-orchestratorowner path. This PR does not expand Naruon's protected legacy direct-provider implementation. Broader migration/removal of that legacy surface remains the canonical #1548/docs-governance + contextual-orchestrator integration lane.Consumer/descendant boundary
Draft #1404 introduces a new
_find_workspace_documentpreview read path. That path must preserve this organization invariant, but #1404 must not become a second authority for the inherited_get_workspace_documentor quality-surface scope. #1404 remains blocked on normal protected integration of this PR and must ordinary-restack afterward while retaining only its preview-specific regression. Preview/HWPX behavior remains owned by #1404; it is not added here.Exact-head evidence
The owner-boundary repair changed the exact head, so predecessor workflow and review results are development history only and are not inherited as merge evidence.
Fresh repository workflows created for
9a019892f7d53f72415fa5633a0facd73815b8f4:34065084229: queued34065084250: queued34065084194: queued34065084189: queued34065084471: queued34065084193: queuedCurrent-head independent robot review is not yet established. Keep Draft until the unchanged final head has terminal required execution and review evidence under the live repository policy.
Merge boundary
Merge only when this unchanged exact head (or a later ordinary descendant adopted after inspecting intervening deltas) satisfies every then-live repository/organization-required check and all valid review findings are resolved. Do not manufacture a dummy/no-op commit, weaken required contexts, self-approve, dismiss valid evidence, add Naruon-local provider fallbacks, force-push, or bypass protection.
Refs #1344.