Skip to content

Commit 47f0dcd

Browse files
committed
docs(ssrf): clarify trailing-dot normalization
1 parent 7f8a455 commit 47f0dcd

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎docs/plugins/sdk-subpaths.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ usage endpoint failed or returned no usable usage data.
240240
| `plugin-sdk/webhook-request-guards` | Request body size/timeout helpers and `runDetachedWebhookWork` for tracked post-ack processing |
241241

242242
Provider and web-fetch helpers that accept a configured `baseUrl` use exact
243-
HTTP origin trust for SSRF exemptions. The runtime normalizes the configured
243+
HTTP origin trust for SSRF exemptions. The runtime serializes the configured
244244
origin with the platform `URL.origin` rules: path and query are ignored, default
245-
ports are elided, userinfo is stripped, host case is folded, and trailing host
246-
dots are normalized before comparison. A matching origin may promote only the
247-
current request hostname for that request; redirects and sibling origins are
248-
re-evaluated independently, and metadata/link-local/private network blocking
249-
still runs in the resolver. Do not use origin trust as a wildcard for every host
250-
that shares a domain or provider plugin.
245+
ports are elided, userinfo is stripped, and host case is folded. OpenClaw's SSRF
246+
hostname comparison separately normalizes trailing host dots. A matching origin
247+
may promote only the current request hostname for that request; redirects and
248+
sibling origins are re-evaluated independently, and metadata/link-local/private
249+
network blocking still runs in the resolver. Do not use origin trust as a
250+
wildcard for every host that shares a domain or provider plugin.
251251

252252
</Accordion>
253253

‎src/infra/net/ssrf.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe("ssrfPolicyFromHttpBaseUrlAllowedOrigin", () => {
181181
const policy = ssrfPolicyFromHttpBaseUrlAllowedOrigin("http://example.com.:11434/v1");
182182

183183
expect(resolveSsrFPolicyForUrl(new URL("http://example.com:11434/v1/chat"), policy)).toEqual({
184-
allowedOrigins: ["http://example.com.:11434"],
184+
allowedOrigins: ["http://example.com:11434"],
185185
allowedHostnames: ["example.com"],
186186
});
187187
});

0 commit comments

Comments
 (0)