Skip to content

docs: replace retired hostnameAllowlist with allowedHostnames in SSRF docs - #114610

Closed
AAliKKhan wants to merge 2 commits into
openclaw:mainfrom
AAliKKhan:docs/fix-ssrf-hostname-allowlist
Closed

AAliKKhan wants to merge 2 commits into
openclaw:mainfrom
AAliKKhan:docs/fix-ssrf-hostname-allowlist

Conversation

@AAliKKhan

Copy link
Copy Markdown
Contributor

What Problem This Solves

The browser SSRF policy docs in docs/gateway/security/index.md reference hostnameAllowlist as an active config key, but it was renamed to allowedHostnames.

Why This Change Was Made

browser.ssrfPolicy.hostnameAllowlist is listed as a dead config key in dead-config-keys.test.ts:51. The zod schema at zod-schema.root-shape.ts:149 only accepts allowedHostnames. Doctor strips the old key.

Evidence

  • src/config/dead-config-keys.test.ts:51: "browser.ssrfPolicy.hostnameAllowlist"
  • src/config/zod-schema.root-shape.ts:149: allowedHostnames: z.array(z.string()).optional()
  • src/commands/doctor/shared/legacy-config-migrations.runtime.retired-media.ts: strips hostnameAllowlist

@AAliKKhan
AAliKKhan requested a review from a team as a code owner July 27, 2026 14:29
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime security Security documentation size: XS triage: low-signal-docs Candidate: docs-only change looks low signal; maintainer review needed. labels Jul 27, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 3, 2026, 4:57 AM ET / 08:57 UTC.

ClawSweeper review

What this changes

The PR removes the retired browser.ssrfPolicy.hostnameAllowlist name from two SSRF documentation pages and replaces the examples with allowedHostnames.

Merge readiness

⚠️ Ready for maintainer review - 6 items remain

This documentation-only PR is still needed because current main still advertises the retired browser SSRF key, but the proposed replacement incorrectly says allowedHostnames supports wildcard patterns. Keep it open for a small correction before the explicitly armed automerge path can continue.

Priority: P2
Reviewed head: 8efaaf651588780653d91922b9dad7ec8dde21de

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR correctly targets stale configuration names but needs a small, security-sensitive documentation repair before merge.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required because this PR only changes files under docs/.
Evidence reviewed 6 items Canonical config surface: The strict shared SSRF config schema exposes allowedHostnames and does not accept hostnameAllowlist as an operator configuration key.
Exact-host enforcement: The browser SSRF check skips private-network blocking only when the normalized hostname is present in the allowedHostnames set.
Wildcard behavior is separate: Wildcard matching is implemented by matchesHostnameAllowlist, not by the exact-set lookup used for allowedHostnames.
Findings 2 actionable findings [P1] Use exact-only allowedHostnames examples
[P1] Remove wildcard semantics from the security guide
Security Needs attention Wildcard exception syntax is unsupported: The changed configuration-reference example puts *.example.com in allowedHostnames, but the runtime only exact-matches that setting; this can mislead operators configuring a sensitive navigation policy.
Security guidance overstates host matching: The security guide says allowedHostnames accepts patterns, contrary to the exact-set check in the browser SSRF policy.

How this fits together

Browser configuration supplies SSRF exceptions before OpenClaw navigates browser-controlled requests to private or special-use destinations. The canonical operator setting, allowedHostnames, is evaluated as an exact normalized hostname/IP exception; wildcard matching remains an internal hostnameAllowlist runtime mechanism.

flowchart LR
  A[Operator browser config] --> B[Strict config schema]
  B --> C[Browser SSRF policy]
  C --> D[Hostname exception check]
  D --> E[Browser navigation]
  F[Gateway security docs] --> A
Loading

Before merge

  • Use exact-only `allowedHostnames` examples (P1) - allowedHostnames is checked by exact normalized-host membership, while wildcard matching is limited to the internal hostnameAllowlist mechanism. This new *.example.com example promises a browser SSRF exception that the documented config cannot provide; use exact host or IP examples instead.
  • Remove wildcard semantics from the security guide (P1) - The changed sentence says allowedHostnames accepts patterns, but the runtime treats it as an exact-host set. Update the guide to describe exact hostname/IP exceptions so its security advice matches the enforced policy.
  • Resolve security concern: Wildcard exception syntax is unsupported - The changed configuration-reference example puts *.example.com in allowedHostnames, but the runtime only exact-matches that setting; this can mislead operators configuring a sensitive navigation policy.
  • Resolve security concern: Security guidance overstates host matching - The security guide says allowedHostnames accepts patterns, contrary to the exact-set check in the browser SSRF policy.
  • Resolve merge risk (P1) - Merging the new wildcard examples would make an operator expect *.example.com to exempt subdomains through allowedHostnames, although the browser SSRF policy accepts that setting only by exact normalized hostname membership.
  • Complete next step (P2) - The repair is mechanical, but the PR carries both security and explicit clawsweeper:human-review labels, so a human must clear that handling state before an automated branch repair or merge.

Findings

  • [P1] Use exact-only allowedHostnames examples — docs/gateway/configuration-reference.md:424
  • [P1] Remove wildcard semantics from the security guide — docs/gateway/security/index.md:494
  • [medium] Wildcard exception syntax is unsupported — docs/gateway/configuration-reference.md:424
  • [medium] Security guidance overstates host matching — docs/gateway/security/index.md:494
Agent review details

Security

Needs attention: The docs-only patch introduces a security-relevant discrepancy between the advertised SSRF exception syntax and the browser policy enforced at runtime.

PR surface

Docs -2. Total -2 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 2 4 6 -2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 4 6 -2

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Correct the documented exception syntax (recommended)
    Replace the wildcard claims and examples in both pages with exact hostname or IP examples that match the enforced browser policy.
  2. Pause for an explicit wildcard contract
    If wildcard browser exceptions are a product requirement, pause this docs correction until a separately reviewed runtime and configuration change defines and tests that contract.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Replace wildcard `allowedHostnames` wording and examples with exact hostname or IP examples on both SSRF documentation pages; verify against src/infra/net/ssrf.ts and src/config/schema.help.runtime.ts.

Technical review

Best possible solution:

Land a docs-only correction that removes the retired key while describing browser.ssrfPolicy.allowedHostnames as exact host/IP exceptions; do not introduce wildcard syntax unless maintainers separately approve and implement that runtime/config contract.

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

Yes. Source establishes the result: the browser policy checks allowedHostnames by exact normalized-set membership, while only hostnameAllowlist invokes wildcard matching; a configured *.example.com cannot match a subdomain through the documented setting.

Is this the best way to solve the issue?

No. Removing the retired key is correct, but describing its replacement as wildcard-capable contradicts the current schema help and runtime check; exact host/IP wording is the narrowest maintainable solution.

Full review comments:

  • [P1] Use exact-only allowedHostnames examples — docs/gateway/configuration-reference.md:424
    allowedHostnames is checked by exact normalized-host membership, while wildcard matching is limited to the internal hostnameAllowlist mechanism. This new *.example.com example promises a browser SSRF exception that the documented config cannot provide; use exact host or IP examples instead.
    Confidence: 0.99
  • [P1] Remove wildcard semantics from the security guide — docs/gateway/security/index.md:494
    The changed sentence says allowedHostnames accepts patterns, but the runtime treats it as an exact-host set. Update the guide to describe exact hostname/IP exceptions so its security advice matches the enforced policy.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded but operator-visible SSRF documentation defect: it affects how users configure browser access rather than changing the runtime directly.
  • merge-risk: 🚨 security-boundary: The proposed documentation would state a broader SSRF exception syntax than the browser policy actually enforces.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.

Evidence

Security concerns:

  • [medium] Wildcard exception syntax is unsupported — docs/gateway/configuration-reference.md:424
    The changed configuration-reference example puts *.example.com in allowedHostnames, but the runtime only exact-matches that setting; this can mislead operators configuring a sensitive navigation policy.
    Confidence: 0.99
  • [medium] Security guidance overstates host matching — docs/gateway/security/index.md:494
    The security guide says allowedHostnames accepts patterns, contrary to the exact-set check in the browser SSRF policy.
    Confidence: 0.99

What I checked:

Likely related people:

  • Peter Steinberger: Available blame resolves the SSRF exception behavior and its generated configuration help to commit f96fc529c3a99e64a856c6d605cc680b5431015a; the partial clone prevents a higher-confidence pre-boundary ownership trail. (role: current-source boundary author and recent area contributor; confidence: low; commits: f96fc529c3a9; files: src/infra/net/ssrf.ts, src/config/schema.help.runtime.ts, docs/gateway/security/index.md)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Replace wildcard allowedHostnames examples with exact host/IP examples in both changed pages.
  • Refresh the exact-head review after the documentation wording matches src/infra/net/ssrf.ts and src/config/schema.help.runtime.ts.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-07-27T14:35:28.023Z sha 5300899 :: needs changes before merge. :: [P2] Update the configuration reference with the canonical SSRF key
  • reviewed 2026-07-27T14:55:02.680Z sha 8efaaf6 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-27T15:02:53.821Z sha 8efaaf6 :: needs maintainer review before merge. :: none

@AAliKKhan

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 27, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper automerge is enabled.

  • Head: 8efaaf651588
  • Label: clawsweeper:automerge
  • Action: an exact-head review is already active; no duplicate review was queued.
  • Flow: review this head, repair/rebase only if needed, then re-review the exact repaired head before merge.

Draft PRs stay fix-only until GitHub marks them ready for review. Pause with /clawsweeper stop.

Automerge progress:

  • 2026-07-27 15:00:50 UTC active review reused 8efaaf651588 (waiting)

@clawsweeper clawsweeper Bot added clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. clawsweeper:human-review Needs maintainer review before ClawSweeper can continue and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 27, 2026
@clawsweeper

clawsweeper Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞✅
ClawSweeper is pausing this repair loop for human review.

Source: clawsweeper[bot]
Reason: - [ ] Use exact-only \allowedHostnames\ examples (P1) - allowedHostnames is checked by exact normalized-host membership, while wildcard matching is limited to the internal hostnameAllowlist mechanism. This new *.exa...; Review finding: [P1] Use exact-only allowedHostnames examples — docs/gateway/configuration-reference.md:424 - [P1] Remove wildcard semantics from the security guide — docs/gateway... (sha=8efaaf651588780653d91922b9dad7ec8dde21de)

Why human review is needed:
This item has security-sensitive risk. ClawSweeper is pausing instead of making an autonomous change that could affect trust, credentials, permissions, or exposure.

What the maintainer can do as a next step:
If the maintainer accepts the current risk and wants ClawSweeper to continue merge gates, comment @clawsweeper approve. If the security-sensitive detail still needs changes, describe the safe path or push the fix, then comment @clawsweeper automerge. If the risk should not be automated, keep the PR paused for manual review or comment @clawsweeper stop.

I added clawsweeper:human-review and left the final call with a maintainer.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Aug 3, 2026
@steipete

Copy link
Copy Markdown
Contributor

Closing as superseded on main. The hostnameAllowlist → allowedHostnames rewrites for docs/gateway/security/index.md and docs/gateway/configuration-reference.md landed via #121330 and the docs config-example sweep in #121336 (merge commit a0ad38e71ab7). Proof: git grep hostnameAllowlist origin/main -- docs/ now matches only the intentional doctor migration table (docs/gateway/doctor.md, documenting the old→new key move) and a historical release-notes entry — no teaching examples remain.

Thanks for flagging and fixing this @AAliKKhan! #121336 also added a CI gate that schema-validates docs config examples, so retired keys like this one now fail CI automatically.

@steipete steipete closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper:human-review Needs maintainer review before ClawSweeper can continue docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security Security documentation size: XS triage: low-signal-docs Candidate: docs-only change looks low signal; maintainer review needed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants