Repository navigation
test(plugin-sdk): cover origin trust SSRF edges - #97674
lin-hongkuan wants to merge 3 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 4:56 AM ET / 08:56 UTC. ClawSweeper reviewWhat this changesThis PR adds origin-normalization and isolation coverage for provider Merge readiness⛔ Blocked until real behavior proof is added - 6 items remain Keep this PR open: its normalization tests and plugin SDK documentation remain absent from current main, but its claimed concurrent-isolation coverage is not actually concurrent and the external PR still lacks current-head real-behavior evidence. Priority: P2 Review scores
Verification
How this fits togetherConfigured provider and plugin HTTP requests pass through OpenClaw's SSRF guard before DNS resolution and outbound transport. A matching configured origin can promote only the current request hostname, while redirects and resolver-level private-network blocks are evaluated independently. flowchart LR
A[Configured provider base URL] --> B[Origin normalization]
B --> C[Per-request SSRF policy]
C --> D[Guarded fetch redirect loop]
D --> E[Resolver safety checks]
E --> F[Provider HTTP request]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceTests +47, Docs +11. Total +58 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current main, replace the Promise-wrapped resolver assertions with an overlapping guarded-fetch or provider-transport test for two distinct private origins, and add redacted current-head runtime evidence showing each configured origin succeeds while the cross-port request remains blocked. Do we have a high-confidence way to reproduce the issue? Yes for the review finding: source inspection shows each resolver call completes synchronously before Is this the best way to solve the issue? No: the normalization cases and documentation are appropriate, but a pure resolver test wrapped in promises is not the best way to establish concurrent isolation. The narrow maintainable proof is an overlapping request at the existing guarded-fetch or provider-transport boundary. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 41051fe37c7f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
Ensured the PR body has explicit real-behavior proof sections for the proof gate. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Rebased the focused issue-backed patch onto current |
5b94f63 to
76d33bc
Compare
|
Correction/read-back: the refreshed public head is now |
76d33bc to
4fc7873
Compare
|
Rebased the focused two-file patch onto current This also clears the prior exact-head docs failure: Validation on the refreshed head:
Public read-back confirms base |
|
Addressed the trailing-host-dot finding in |
743885d to
47f0dcd
Compare
|
Addressed the current documentation finding and the exact-head CI assertion in
Validation on the refreshed head:
The prior compact-large test failure was the stale expected dotted origin; compact-small's Apple catalog failure was branch-external and the branch is now on current |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
Adds the remaining origin-trust SSRF edge coverage and plugin SDK docs requested by #81963.
Issue / Motivation
Fixes #81963.
The core origin-scoped SSRF behavior already landed in #80751. The follow-up issue asks for narrow provider
baseUrlnormalization coverage plus documentation of the trust semantics for plugin authors, without changing runtime policy.Changes
baseUrlorigin normalization:URL.origindocs/plugins/sdk-subpaths.md, including redirect re-evaluation and continued metadata/link-local/private-network resolver blocking.Testing
pnpm exec vitest run src/infra/net/ssrf.test.tspnpm oxfmt --check src/infra/net/ssrf.test.ts docs/plugins/sdk-subpaths.mdgit diff --checkWhat Problem This Solves
Plugin/provider authors need a precise contract for when configured
baseUrlvalues may promote a private hostname through the SSRF guard. This PR pins the intended origin-normalization behavior in tests and documents that the trust is exact-origin, per-request, and does not bypass resolver-level metadata/link-local/private network protections.Evidence
Exact-head static validation passed:
npx --yes oxfmt@latest --check docs/plugins/sdk-subpaths.md src/infra/net/ssrf.test.ts,npx --yes oxlint@latest --tsconfig config/tsconfig/oxlint.core.json src/infra/net/ssrf.test.ts,node scripts/generate-docs-map.mjs --check,git diff --check, and diff secret scan. The new regression directly covers the configured trailing-dot baseUrl contract identified in review. The PR intentionally contains tests/docs only and does not change production SSRF policy behavior.