Skip to content

test(plugin-sdk): track origin-trust SSRF edge coverage and docs #81963

Closed as not planned

Description

@Kaspre

Follow-up from #80751 multi-lane review. This is not a blocker for #80751.

#80751 now pins the SDK boundary smoke case: plugin-supplied allowedOrigins entries for metadata/link-local targets, and DNS rebinding from a trusted private origin to metadata IPs, still get rejected by the resolver.

Remaining non-blocking hardening items:

  • Add origin-normalization assertions for custom provider baseUrl: trailing slash equivalence, default-port elision, and userinfo stripping via URL.origin.
  • Add a concurrent multi-agent origin-trust isolation test for overlapping but distinct private baseUrls.
  • Document plugin SDK origin-scoped trust semantics in docs/plugins/sdk-subpaths.md: request origin must match exactly, hostname promotion applies only to the current request, and metadata/link-local blocking remains enforced by the resolver.
  • Consider adding an invariant comment for IPv6 zone-id literals being fail-closed in the loose IP parser and DNS-answer re-check.

The BLOCKED_HOSTNAMES symmetry and fakeIpPolicy endpoint-class gating notes from the review are intentionally left as maintainer-direction questions on #80751 rather than bundled into this follow-up.

Activity

  1. clawsweeper commented on May 15, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 3, 2026, 10:47 AM ET / 14:47 UTC.

    Summary
    Keep open. This issue still tracks bounded, non-runtime hardening work that current main does not fully contain: explicit userinfo and concurrent-origin isolation coverage plus plugin-facing trust semantics documentation. The open PR #97674 explicitly owns that remaining work, so a parallel repair would duplicate a security-sensitive review path.

    Reproducibility: not applicable. This issue tracks missing regression coverage and documentation around a current security boundary, not a reported runtime failure. Source inspection confirms the remaining requested cases are not asserted or documented on current main.

    Root-cause cluster
    Relationship: canonical
    Canonical: #81963
    Summary: This issue is the canonical follow-up for coverage and documentation left after the merged origin-trust runtime change; one open PR is its candidate implementation.

    Members:

    Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    Next step
    The open PR #97674 already owns the bounded work; opening a parallel repair branch would duplicate a security-sensitive review path.

    Review details

    Best possible solution:

    Land a narrow, rebased version of #97674 that adds only the missing normalization/isolation assertions and clear SDK semantics, while preserving the current resolver-enforced SSRF policy.

    Do we have a high-confidence way to reproduce the issue?

    Not applicable: this issue tracks missing regression coverage and documentation around a current security boundary, not a reported runtime failure. Source inspection confirms the remaining requested cases are not asserted or documented on current main.

    Is this the best way to solve the issue?

    Yes. Tests and documentation are the narrowest maintainable follow-up because current main already owns the runtime policy and resolver enforcement; changing that policy would expand scope without evidence of a defect.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The linked implementation PR is reported as merge-conflicted and marked status: 📣 needs proof; it needs a current-main rebase and exact-head validation before it can safely close this security-boundary follow-up.

    Codex review notes: model internal, reasoning high; reviewed against eb76bf499b39.

    Label changes

    Label justifications:

    • P2: This is bounded security hardening for an already-landed SSRF boundary, with no current evidence of an active bypass.
    • impact:security: The requested tests and docs define how provider-origin trust must remain constrained against metadata, link-local, and DNS-rebinding SSRF targets.
    Evidence reviewed

    What I checked:

    • Current origin-scoped policy: Current main normalizes HTTP(S) base URLs to URL.origin, removes trailing hostname dots, and promotes only the matching request hostname into the policy. (src/infra/net/ssrf.ts:156, eb76bf499b39)
    • Current resolver safety boundary: The guarded resolver rechecks trusted-host DNS answers and explicitly rejects metadata or link-local rebinding unless broad private-network access was deliberately enabled. (src/infra/net/ssrf.ts:600, eb76bf499b39)
    • Existing SDK-edge coverage: Current main already asserts that plugin-supplied metadata and link-local origins remain blocked, including trusted-host DNS rebinding to metadata addresses. (src/plugin-sdk/ssrf-policy.test.ts:420, eb76bf499b39)
    • Remaining coverage and docs are absent on main: Current origin tests cover paths, query strings, default ports, trailing dots, port mismatch, and IPv6, but do not contain userinfo or concurrent-isolation cases; the SDK subpaths page names the SSRF helpers without documenting the requested exact-origin contract. (src/infra/net/ssrf.test.ts:186, eb76bf499b39)
    • Merged foundation and ownership provenance: The origin-scoped runtime behavior was introduced by the merged foundation commit for fix(agents): scope custom provider baseUrl SSRF trust by origin #80751; later blame attributes the current normalization block to recent main maintenance, so this follow-up is coverage/docs rather than a request to replace runtime policy. (src/infra/net/ssrf.ts:156, 44840007d42d)
    • Canonical open implementation candidate: Provided GitHub context identifies test(plugin-sdk): cover origin trust SSRF edges #97674 as an open PR using closing syntax for this issue and changing precisely the remaining test and documentation surfaces. Its reported dirty merge state and proof request must be resolved on that PR before this issue can close. (47f0dcd2dab1)

    Likely related people:

    • Kaspre: Authored the merged origin-scoped SSRF foundation used by the current provider transport; this issue is explicitly a follow-up to that behavior. (role: origin-trust behavior introducer; confidence: high; commits: 44840007d42d; files: src/infra/net/ssrf.ts, src/agents/provider-transport-fetch.ts)
    • Peter Steinberger: Current-main blame attributes the active origin-normalization block to a recent maintenance commit, although the local grafted history makes deeper per-line provenance incomplete. (role: recent area contributor; confidence: medium; commits: 06957a69d867; files: src/infra/net/ssrf.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-security-review
    impact:security
    on May 16, 2026
  3. openclaw-barnacle commented on Jun 2, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  4. added
    stale
    on Jun 2, 2026
  5. added
    issue-rating: 🐚 platinum hermit
    clawsweeper:needs-live-repro
    on Jun 2, 2026
  6. Kaspre commented on Jun 3, 2026

    @Kaspre
    ContributorAuthor

    Still current; core behavior is merged, remaining work is docs plus provider-level edge coverage. Recommended next action is a narrow security-reviewed PR, no policy change.

  7. added
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    and removed
    clawsweeper:needs-live-repro
    issue-rating: 🐚 platinum hermit
    clawsweeper:fix-shape-clear
    clawsweeper:needs-maintainer-review
    on Jun 14, 2026
  8. added
    clawsweeper:linked-pr-open
    on Jun 29, 2026
  9. added
    issue-rating: 🌊 off-meta tidepool
    and removed
    clawsweeper:source-repro
    issue-rating: 🦞 diamond lobster
    on Jul 31, 2026
  10. removed
    stale
    on Aug 1, 2026
  11. added and removed
    clawsweeper:needs-security-review
    on Aug 2, 2026
  12. openclaw-barnacle commented on Aug 24, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  13. added
    stale
    on Aug 24, 2026
  14. openclaw-barnacle commented on Sep 1, 2026

    @openclaw-barnacle

    Closing due to inactivity.
    If this is still an issue, please retry on the latest OpenClaw release and share updated details.
    If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:linked-pr-openclawsweeper:no-new-fix-primpact:securityissue-rating: 🌊 off-meta tidepoolstale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions