Skip to content

fix(ssrf): allow opt-in IPv6 unique-local exemption for fake-ip proxies - #74571

Merged
steipete merged 2 commits into
openclaw:mainfrom
jeffrey701:fix/ssrf-allow-ipv6-unique-local-range-74351
Apr 29, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
jeffrey701:fix/ssrf-allow-ipv6-unique-local-range-74351

Conversation

@jeffrey701

Copy link
Copy Markdown
Contributor
Closes #74351. AI-assisted, fully tested.

Sing-box / Clash / Surge fake-ip proxy stacks resolve foreign domains
to BOTH IPv4 198.18.0.0/15 AND IPv6 fc00::/7 simultaneously. Setting
`tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange: true` already
exempted the IPv4 leg, but the IPv6 ULA range stayed unconditionally
blocked, so every web_fetch through a fake-ip proxy still failed with
"Blocked: resolves to private/internal/special-use IP address".

## Approach

Adds a separate, opt-in `allowIpv6UniqueLocalRange` flag rather than
extending `allowRfc2544BenchmarkRange`'s semantics. Reasons:

- No silent behavior change for existing `allowRfc2544BenchmarkRange:
  true` users — their IPv6 surface stays exactly as restrictive as it
  was.
- Operators can mix and match: only IPv4 fake-ip ranges, only IPv6
  ULA, or both, depending on which proxy they actually run.
- Matches the issue's "Alternatively, provide a separate configuration
  option for exempting the IPv6 ULA range" suggestion, which is the
  conservative of the two presented options.

## Implementation

- `src/shared/net/ip.ts`: new `Ipv6SpecialUseBlockOptions` type;
  `isBlockedSpecialUseIpv6Address` now takes optional opts and returns
  false for `range() === "uniqueLocal"` only when
  `allowUniqueLocalRange === true`. Loopback (`::1`), unspecified
  (`::`), multicast (`ff00::/8`), discard, reserved, and the
  deprecated site-local `fec0::/10` keep their unconditional block —
  the exemption is scoped to ULA, not "any reserved IPv6 range".
- `src/infra/net/ssrf.ts`: new `allowIpv6UniqueLocalRange` field on
  `SsrFPolicy`, mirrored into `normalizeSsrFPolicyForComparison` so
  `isSameSsrFPolicy` participates in policy-cache invalidation. New
  `resolveIpv6SpecialUseBlockOptions` helper threaded through the
  `isPrivateIpAddress` path. The `media/parse.ts` call site keeps the
  default options (no opt-in), so media URL safety stays unchanged.

## Tests

- `src/shared/net/ip.test.ts` — 2 new unit tests covering the wrapper
  contract and the explicit "exemption is scoped to ULA only" invariant.
- `src/infra/net/ssrf.test.ts` — 7 new `it.each` rows covering the
  policy-threading: ULA blocked by default; exempt with the new flag;
  other reserved ranges still blocked; the new flag is independent of
  `allowRfc2544BenchmarkRange`. Plus a new `isSameSsrFPolicy` case
  asserting the new field participates in semantic equality.

`pnpm test src/shared/net/ip.test.ts src/infra/net/ssrf.test.ts
src/infra/net/ssrf.pinning.test.ts src/infra/net/fetch-guard.ssrf.test.ts`
— 108 passed across 4 files.

`pnpm exec oxfmt --check` — clean. `pnpm exec oxlint` — 0 warnings,
0 errors.

## AI-assisted PR

- [x] Mark as AI-assisted (Claude). Lightly tested via targeted Vitest
  shards on the four ssrf/ip-policy files; not exercised end-to-end
  against a live fake-ip proxy stack — operator confirmation welcome.
- [x] Confirm I understand what the code does: yes — the SSRF gate
  is delegating to `isBlockedSpecialUseIpv6Address`, and the new flag
  is a per-call, per-policy opt-out for one specific IPv6 range.

Closes #74351

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge.

What this changes:

Adds an optional IPv6 unique-local SSRF-policy exemption to shared IP/SSRF helpers and tests so fc00::/7 can be allowed independently of the RFC2544 IPv4 fake-IP flag.

Maintainer follow-up before merge:

This is an open contributor implementation PR with a concrete blocking wiring bug on a security-sensitive SSRF surface; the next step is maintainer/author revision and review rather than an automated replacement job.

Security review:

Security review cleared: The diff touches SSRF policy but defaults remain closed and there are no dependency, CI, secret, or supply-chain changes; the blocking issue is incomplete functional wiring for the new opt-in.

Review findings:

  • [P2] Wire the IPv6 policy through web_fetch config — src/infra/net/ssrf.ts:50
  • [P3] Preserve the flag when merging SSRF policies — src/infra/net/ssrf.ts:50
Review details

Best possible solution:

Revise the PR so the IPv6 ULA opt-in is a complete, documented tools.web.fetch.ssrfPolicy surface: keep defaults strict, update config schema/types/help/generated schema and docs, thread the bit through runWebFetch including cache partitioning and guarded fetch policy, preserve it in policy helpers, and add regression coverage for fake-IP DNS answers containing both IPv4 RFC2544 and IPv6 ULA records.

Full review comments:

  • [P2] Wire the IPv6 policy through web_fetch config — src/infra/net/ssrf.ts:50
    The new SsrFPolicy field is internal-only as written. Current tools.web.fetch.ssrfPolicy parsing is strict and only accepts allowRfc2544BenchmarkRange, and runWebFetch only forwards that IPv4 flag to the guarded fetch path. As a result, operators cannot set the new IPv6 ULA opt-in for the web_fetch failure this PR is meant to fix.
    Confidence: 0.96
  • [P3] Preserve the flag when merging SSRF policies — src/infra/net/ssrf.ts:50
    SsrFPolicy is exported through the plugin SDK, but mergeSsrFPolicies only carries the existing private-network, RFC2544, and hostname fields. Any caller that composes a hostname policy with the new ULA opt-in would silently lose the exemption before calling the guard, so the helper and its tests should be updated with the new field.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.94

Acceptance criteria:

  • pnpm test src/shared/net/ip.test.ts src/infra/net/ssrf.test.ts src/infra/net/ssrf.pinning.test.ts src/infra/net/fetch-guard.ssrf.test.ts src/agents/tools/web-fetch.ssrf.test.ts src/config/schema.test.ts src/plugin-sdk/ssrf-policy.test.ts
  • pnpm exec oxfmt --check --threads=1 src/shared/net/ip.ts src/infra/net/ssrf.ts src/agents/tools/web-fetch.ts src/config/zod-schema.agent-runtime.ts src/config/types.tools.ts src/config/schema.help.ts src/config/schema.labels.ts src/plugin-sdk/ssrf-policy.ts

What I checked:

  • PR intent targets web_fetch fake-IP proxy behavior: The PR body says it closes [Bug]: allowRfc2544BenchmarkRange SSRF exemption does not cover IPv6 ULA addresses from fake-ip proxies #74351 and proposes a separate allowIpv6UniqueLocalRange opt-in for fake-IP proxy stacks that return both 198.18.0.0/15 and fc00::/7 DNS answers. (7a074f83c796)
  • web_fetch runtime only carries the IPv4 flag: WebFetchRuntimeParams.ssrfPolicy only includes allowRfc2544BenchmarkRange, and runWebFetch only forwards { allowRfc2544BenchmarkRange } to the guarded fetch path. A new IPv6 ULA policy bit would be dropped before DNS validation. (src/agents/tools/web-fetch.ts:275, 3059702687da)
  • Strict config schema would reject the new config key: ToolsWebFetchSchema defines ssrfPolicy as a strict object with only allowRfc2544BenchmarkRange, so tools.web.fetch.ssrfPolicy.allowIpv6UniqueLocalRange is not accepted by current config parsing. (src/config/zod-schema.agent-runtime.ts:354, 3059702687da)
  • Public config type exposes only the existing RFC2544 option: The TypeScript config surface for tools.web.fetch.ssrfPolicy lists only allowRfc2544BenchmarkRange; the PR does not update this user-facing contract, help labels, generated schema, or docs. (src/config/types.tools.ts:578, 3059702687da)
  • Policy merge helper would not preserve the new field: The SDK policy merger copies private-network, RFC2544, and hostname fields, but would silently drop a future allowIpv6UniqueLocalRange policy when callers compose policies. (src/plugin-sdk/ssrf-policy.ts:63, 3059702687da)

Likely related people:

  • xing-xing-coder: The changelog credits @xing-xing-coder for feat(web-fetch): add ssrfPolicy.allowRfc2544BenchmarkRange config option #61830, which added the existing tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange config surface that this PR needs to extend consistently. (role: current narrow SSRF-policy introducer; confidence: medium; commits: 9ed448088b6a; files: src/agents/tools/web-fetch.ts, src/config/zod-schema.agent-runtime.ts, src/config/types.tools.ts)
  • steipete: Prior ClawSweeper history routes adjacent web_fetch SSRF/config work through this maintainer, and the current checkout’s recent main history is dominated by Peter Steinberger maintenance around shared runtime paths. (role: current-main maintainer and security-path router; confidence: medium; commits: 3059702687da, e583db63c602; files: src/agents/tools/web-fetch.ts, src/config/zod-schema.agent-runtime.ts, src/infra/net/ssrf.ts)
  • obviyus: Prior review history connects @obviyus to recent browser/SSRF strict-mode and transport-policy work, which is relevant to the naming and safety shape for another private/special-use network opt-in. (role: adjacent SSRF-policy maintainer; confidence: medium; commits: ac3999ac8c5a, 8023f4c701bc, e4825a0f9385; files: src/infra/net/ssrf.ts, src/agents/tools/web-fetch.ts)

Remaining risk / open question:

  • Merging as-is would leave the reported web_fetch failure unresolved because the proposed operator-facing option is neither accepted by config nor passed to the fetch guard.
  • The IPv6 ULA exemption is security-sensitive even when opt-in; exposing it should include schema/help/docs and tests that preserve strict defaults and redirect/DNS checks.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 3059702687da.

jeffrey701 and others added 2 commits April 29, 2026 20:29
Closes openclaw#74351. AI-assisted, fully tested.

Sing-box / Clash / Surge fake-ip proxy stacks resolve foreign domains
to BOTH IPv4 198.18.0.0/15 AND IPv6 fc00::/7 simultaneously. Setting
`tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange: true` already
exempted the IPv4 leg, but the IPv6 ULA range stayed unconditionally
blocked, so every web_fetch through a fake-ip proxy still failed with
"Blocked: resolves to private/internal/special-use IP address".

## Approach

Adds a separate, opt-in `allowIpv6UniqueLocalRange` flag rather than
extending `allowRfc2544BenchmarkRange`'s semantics. Reasons:

- No silent behavior change for existing `allowRfc2544BenchmarkRange:
  true` users — their IPv6 surface stays exactly as restrictive as it
  was.
- Operators can mix and match: only IPv4 fake-ip ranges, only IPv6
  ULA, or both, depending on which proxy they actually run.
- Matches the issue's "Alternatively, provide a separate configuration
  option for exempting the IPv6 ULA range" suggestion, which is the
  conservative of the two presented options.

## Implementation

- `src/shared/net/ip.ts`: new `Ipv6SpecialUseBlockOptions` type;
  `isBlockedSpecialUseIpv6Address` now takes optional opts and returns
  false for `range() === "uniqueLocal"` only when
  `allowUniqueLocalRange === true`. Loopback (`::1`), unspecified
  (`::`), multicast (`ff00::/8`), discard, reserved, and the
  deprecated site-local `fec0::/10` keep their unconditional block —
  the exemption is scoped to ULA, not "any reserved IPv6 range".
- `src/infra/net/ssrf.ts`: new `allowIpv6UniqueLocalRange` field on
  `SsrFPolicy`, mirrored into `normalizeSsrFPolicyForComparison` so
  `isSameSsrFPolicy` participates in policy-cache invalidation. New
  `resolveIpv6SpecialUseBlockOptions` helper threaded through the
  `isPrivateIpAddress` path. The `media/parse.ts` call site keeps the
  default options (no opt-in), so media URL safety stays unchanged.

## Tests

- `src/shared/net/ip.test.ts` — 2 new unit tests covering the wrapper
  contract and the explicit "exemption is scoped to ULA only" invariant
  (loopback / multicast / fec0:: stay blocked even with the new flag).
- `src/infra/net/ssrf.test.ts` — 7 new `it.each` rows covering the
  policy-threading: ULA blocked by default; exempt with the new flag;
  other reserved ranges still blocked; the new flag is independent of
  `allowRfc2544BenchmarkRange` (neither implies the other). Plus a new
  `isSameSsrFPolicy` case asserting the new field participates in
  semantic equality.

`pnpm test src/shared/net/ip.test.ts src/infra/net/ssrf.test.ts
src/infra/net/ssrf.pinning.test.ts src/infra/net/fetch-guard.ssrf.test.ts`
— 108 passed across 4 files.

`pnpm exec oxfmt --check` — clean. `pnpm exec oxlint` — 0 warnings,
0 errors.

## AI-assisted PR

- [x] Mark as AI-assisted (Claude). Lightly tested via targeted Vitest
  shards on the four ssrf/ip-policy files; not exercised end-to-end
  against a live fake-ip proxy stack — operator confirmation welcome
  if a maintainer has that environment handy.
- [x] Confirm I understand what the code does: yes — the SSRF gate
  is delegating to `isBlockedSpecialUseIpv6Address`, and the new flag
  is a per-call, per-policy opt-out for one specific IPv6 range.
@steipete
steipete force-pushed the fix/ssrf-allow-ipv6-unique-local-range-74351 branch from 7a074f8 to 3b744bf Compare April 29, 2026 19:31
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling labels Apr 29, 2026
@steipete
steipete merged commit 9b6670d into openclaw:main Apr 29, 2026
12 of 13 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Thanks @jeffrey701, landed in 9b6670d.

I kept the low-level IPv6 ULA SSRF policy from this PR and added the missing public plumbing: tools.web.fetch.ssrfPolicy.allowIpv6UniqueLocalRange is now accepted by config/schema/docs, merged through the plugin SDK policy helper, included in web_fetch cache keys, and covered by a DNS fake-IP regression test.

Verification:

  • pnpm test src/shared/net/ip.test.ts src/infra/net/ssrf.test.ts src/infra/net/ssrf.pinning.test.ts src/infra/net/fetch-guard.ssrf.test.ts src/agents/tools/web-fetch.ssrf.test.ts src/config/schema.test.ts src/config/schema.base.generated.test.ts src/config/schema.help.quality.test.ts src/plugin-sdk/ssrf-policy.test.ts -- --reporter=verbose
  • pnpm config:schema:check
  • pnpm config:docs:check
  • pnpm exec oxfmt --check --threads=1 ...
  • git diff --check
  • pnpm check:changed in Blacksmith Testbox on the rebased branch

zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 3, 2026
…rt SSRF guard

The model transport guarded fetch passes `{ allowPrivateNetwork: true }` to
`fetchWithSsrFGuard` only when the operator opts in via
`models.providers.<id>.request.allowPrivateNetwork`. That covers RFC1918
private networks, but not the RFC 2544 benchmark range (198.18.0.0/15) or
IPv6 ULA (fc00::/7) that fake-IP DNS proxies (sing-box / Clash / Surge)
hand back for foreign provider hostnames.

Result: every model API call (LiteLLM gateway, api.openai.com,
generativelanguage.googleapis.com, api.x.ai, api.anthropic.com, etc) on a
fake-IP setup fails with:

  [security] blocked URL fetch (url-fetch) target=https://api.openai.com/...
    reason=Blocked: resolves to private/internal/special-use IP address

…even though those hostnames are reachable just fine through the proxy.
The schema on `models.providers.<id>.request` doesn't currently accept
`allowRfc2544BenchmarkRange` / `allowIpv6UniqueLocalRange` either, so
users have no way to opt in via config.

Fix: thread a fake-IP-only narrow exemption
(`{ allowRfc2544BenchmarkRange: true, allowIpv6UniqueLocalRange: true }`)
into the model transport guard policy. Same pattern the public
`tools.web.fetch` policy uses (openclaw#74571) and the trusted/self-hosted
web-tools endpoint policy in `agents/tools/web-guarded-fetch.ts` (openclaw#76530).

The narrow exemption only un-blocks the two fake-IP-specific special-use
ranges — loopback, RFC1918 private networks, link-local (including
169.254.169.254 cloud metadata), and `metadata.google.internal` stay
blocked unless the operator separately opts in via
`allowPrivateNetwork`. This is a strict subset of the
`ssrfPolicyFromHttpBaseUrlAllowedHostname` allowlist path used by
adjacent plugins, addressing the codex review concern that an
`allowedHostnames` bypass would be broader than the reported fake-IP
failure.

Adds regression coverage in `provider-transport-fetch.test.ts` asserting
that:
  * the policy threaded into `fetchWithSsrFGuard` only contains the
    fake-IP flags (no `allowedHostnames`, no
    `dangerouslyAllowPrivateNetwork`, no `allowPrivateNetwork`)
  * `allowPrivateNetwork: true` from the resolved provider request
    config still merges into the policy when the operator opts in

Refs openclaw#74351 (the original fake-IP IPv6 ULA report) and openclaw#74571 (the
`tools.web.fetch` companion fix). Together with openclaw#76530 (the trusted-web-
tools-endpoint companion), this closes the remaining major fake-IP
user-visible failure path.
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 4, 2026
…rt SSRF guard

The model transport guarded fetch passes `{ allowPrivateNetwork: true }` to
`fetchWithSsrFGuard` only when the operator opts in via
`models.providers.<id>.request.allowPrivateNetwork`. That covers RFC1918
private networks, but not the RFC 2544 benchmark range (198.18.0.0/15) or
IPv6 ULA (fc00::/7) that fake-IP DNS proxies (sing-box / Clash / Surge)
hand back for foreign provider hostnames.

Result: every model API call (LiteLLM gateway, api.openai.com,
generativelanguage.googleapis.com, api.x.ai, api.anthropic.com, etc) on a
fake-IP setup fails with:

  [security] blocked URL fetch (url-fetch) target=https://api.openai.com/...
    reason=Blocked: resolves to private/internal/special-use IP address

…even though those hostnames are reachable just fine through the proxy.
The schema on `models.providers.<id>.request` doesn't currently accept
`allowRfc2544BenchmarkRange` / `allowIpv6UniqueLocalRange` either, so
users have no way to opt in via config.

Fix: thread a fake-IP-only narrow exemption
(`{ allowRfc2544BenchmarkRange: true, allowIpv6UniqueLocalRange: true }`)
into the model transport guard policy. Same pattern the public
`tools.web.fetch` policy uses (openclaw#74571) and the trusted/self-hosted
web-tools endpoint policy in `agents/tools/web-guarded-fetch.ts` (openclaw#76530).

The narrow exemption only un-blocks the two fake-IP-specific special-use
ranges — loopback, RFC1918 private networks, link-local (including
169.254.169.254 cloud metadata), and `metadata.google.internal` stay
blocked unless the operator separately opts in via
`allowPrivateNetwork`. This is a strict subset of the
`ssrfPolicyFromHttpBaseUrlAllowedHostname` allowlist path used by
adjacent plugins, addressing the codex review concern that an
`allowedHostnames` bypass would be broader than the reported fake-IP
failure.

Adds regression coverage in `provider-transport-fetch.test.ts` asserting
that:
  * the policy threaded into `fetchWithSsrFGuard` only contains the
    fake-IP flags (no `allowedHostnames`, no
    `dangerouslyAllowPrivateNetwork`, no `allowPrivateNetwork`)
  * `allowPrivateNetwork: true` from the resolved provider request
    config still merges into the policy when the operator opts in

Refs openclaw#74351 (the original fake-IP IPv6 ULA report) and openclaw#74571 (the
`tools.web.fetch` companion fix). Together with openclaw#76530 (the trusted-web-
tools-endpoint companion), this closes the remaining major fake-IP
user-visible failure path.
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 5, 2026
…rt SSRF guard

The model transport guarded fetch passes `{ allowPrivateNetwork: true }` to
`fetchWithSsrFGuard` only when the operator opts in via
`models.providers.<id>.request.allowPrivateNetwork`. That covers RFC1918
private networks, but not the RFC 2544 benchmark range (198.18.0.0/15) or
IPv6 ULA (fc00::/7) that fake-IP DNS proxies (sing-box / Clash / Surge)
hand back for foreign provider hostnames.

Result: every model API call (LiteLLM gateway, api.openai.com,
generativelanguage.googleapis.com, api.x.ai, api.anthropic.com, etc) on a
fake-IP setup fails with:

  [security] blocked URL fetch (url-fetch) target=https://api.openai.com/...
    reason=Blocked: resolves to private/internal/special-use IP address

…even though those hostnames are reachable just fine through the proxy.
The schema on `models.providers.<id>.request` doesn't currently accept
`allowRfc2544BenchmarkRange` / `allowIpv6UniqueLocalRange` either, so
users have no way to opt in via config.

Fix: thread a fake-IP-only narrow exemption
(`{ allowRfc2544BenchmarkRange: true, allowIpv6UniqueLocalRange: true }`)
into the model transport guard policy. Same pattern the public
`tools.web.fetch` policy uses (openclaw#74571) and the trusted/self-hosted
web-tools endpoint policy in `agents/tools/web-guarded-fetch.ts` (openclaw#76530).

The narrow exemption only un-blocks the two fake-IP-specific special-use
ranges — loopback, RFC1918 private networks, link-local (including
169.254.169.254 cloud metadata), and `metadata.google.internal` stay
blocked unless the operator separately opts in via
`allowPrivateNetwork`. This is a strict subset of the
`ssrfPolicyFromHttpBaseUrlAllowedHostname` allowlist path used by
adjacent plugins, addressing the codex review concern that an
`allowedHostnames` bypass would be broader than the reported fake-IP
failure.

Adds regression coverage in `provider-transport-fetch.test.ts` asserting
that:
  * the policy threaded into `fetchWithSsrFGuard` only contains the
    fake-IP flags (no `allowedHostnames`, no
    `dangerouslyAllowPrivateNetwork`, no `allowPrivateNetwork`)
  * `allowPrivateNetwork: true` from the resolved provider request
    config still merges into the policy when the operator opts in

Refs openclaw#74351 (the original fake-IP IPv6 ULA report) and openclaw#74571 (the
`tools.web.fetch` companion fix). Together with openclaw#76530 (the trusted-web-
tools-endpoint companion), this closes the remaining major fake-IP
user-visible failure path.
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 5, 2026
…rt SSRF guard

The model transport guarded fetch passes `{ allowPrivateNetwork: true }` to
`fetchWithSsrFGuard` only when the operator opts in via
`models.providers.<id>.request.allowPrivateNetwork`. That covers RFC1918
private networks, but not the RFC 2544 benchmark range (198.18.0.0/15) or
IPv6 ULA (fc00::/7) that fake-IP DNS proxies (sing-box / Clash / Surge)
hand back for foreign provider hostnames.

Result: every model API call (LiteLLM gateway, api.openai.com,
generativelanguage.googleapis.com, api.x.ai, api.anthropic.com, etc) on a
fake-IP setup fails with:

  [security] blocked URL fetch (url-fetch) target=https://api.openai.com/...
    reason=Blocked: resolves to private/internal/special-use IP address

…even though those hostnames are reachable just fine through the proxy.
The schema on `models.providers.<id>.request` doesn't currently accept
`allowRfc2544BenchmarkRange` / `allowIpv6UniqueLocalRange` either, so
users have no way to opt in via config.

Fix: thread a fake-IP-only narrow exemption
(`{ allowRfc2544BenchmarkRange: true, allowIpv6UniqueLocalRange: true }`)
into the model transport guard policy. Same pattern the public
`tools.web.fetch` policy uses (openclaw#74571) and the trusted/self-hosted
web-tools endpoint policy in `agents/tools/web-guarded-fetch.ts` (openclaw#76530).

The narrow exemption only un-blocks the two fake-IP-specific special-use
ranges — loopback, RFC1918 private networks, link-local (including
169.254.169.254 cloud metadata), and `metadata.google.internal` stay
blocked unless the operator separately opts in via
`allowPrivateNetwork`. This is a strict subset of the
`ssrfPolicyFromHttpBaseUrlAllowedHostname` allowlist path used by
adjacent plugins, addressing the codex review concern that an
`allowedHostnames` bypass would be broader than the reported fake-IP
failure.

Adds regression coverage in `provider-transport-fetch.test.ts` asserting
that:
  * the policy threaded into `fetchWithSsrFGuard` only contains the
    fake-IP flags (no `allowedHostnames`, no
    `dangerouslyAllowPrivateNetwork`, no `allowPrivateNetwork`)
  * `allowPrivateNetwork: true` from the resolved provider request
    config still merges into the policy when the operator opts in

Refs openclaw#74351 (the original fake-IP IPv6 ULA report) and openclaw#74571 (the
`tools.web.fetch` companion fix). Together with openclaw#76530 (the trusted-web-
tools-endpoint companion), this closes the remaining major fake-IP
user-visible failure path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants