Skip to content

fix: block unspecified DNS targets in trusted network fetches [AI]#103075

Merged
pgondhi987 merged 2 commits into
openclaw:mainfrom
pgondhi987:fix/fix-851
Jul 10, 2026
Merged

fix: block unspecified DNS targets in trusted network fetches [AI]#103075
pgondhi987 merged 2 commits into
openclaw:mainfrom
pgondhi987:fix/fix-851

Conversation

@pgondhi987

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where trusted hostname network requests could continue after DNS returned an unspecified address for the target. That address family can route to local interfaces on common platforms, so the trusted-host recheck needs to reject it before creating a pinned dispatcher.

Why This Change Was Made

The trusted-host DNS recheck now rejects unspecified IPv4 and IPv6 answers, including mapped and transition-embedded IPv4 forms. Existing explicit loopback behavior is preserved for localhost-style origins, and private configured provider origins remain unchanged.

AI-assisted change.

User Impact

Operators can keep using explicitly configured local and private provider origins, while rebinding to unspecified DNS answers is blocked consistently across direct fetch, SDK policy, and pinned dispatcher paths.

Evidence

  • AWS Crabbox focused validation on current branch: provider=aws, lease=cbx_bdfdd4d10376, run=run_0021b134260c.
  • corepack pnpm test src/infra/net/ssrf.pinning.test.ts src/plugin-sdk/ssrf-policy.test.ts src/infra/net/fetch-guard.ssrf.test.ts src/infra/net/ssrf.dispatcher.test.ts
  • Result: 2 Vitest shards passed, 194 tests passed.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Jul 9, 2026
@clawsweeper

clawsweeper Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 4:49 PM ET / 20:49 UTC.

Summary
The PR adds an unspecified IPv4/IPv6 DNS-answer check to trusted-host SSRF revalidation and covers guarded fetch, resolver pinning, pinned dispatcher, and plugin SDK policy paths.

PR surface: Source +18, Tests +97. Total +115 across 5 files.

Reproducibility: yes. at source level. Current main promotes exact-origin trust into allowedHostnames and then the trusted-host DNS recheck lacks an unspecified-address test, so a matching trusted origin can resolve to 0.0.0.0 or :: without hitting the generic private-IP classifier.

Review metrics: 1 noteworthy metric.

  • Trusted-host fail-closed class: 1 added address-class block. The PR newly blocks unspecified IPv4/IPv6 DNS answers on trusted-host paths, which is security-relevant and compatibility-sensitive.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] Existing trusted local/provider origins that resolve to unspecified IPv4/IPv6 answers, including 0.0.0.0/8-style local setups, will now fail closed; maintainers should explicitly accept that compatibility tradeoff.

Maintainer options:

  1. Land fail-closed hardening after maintainer acceptance (recommended)
    Accept that trusted origins resolving to unspecified addresses now fail closed because the PR proof and tests show intended private-origin and localhost controls still work.
  2. Add an owner-approved compatibility exception
    If existing 0.0.0.0-style trusted origins must remain supported, require a narrow explicit policy exception and tests before merge.
  3. Pause for broader SSRF policy
    If the trusted-host address-class policy is still unsettled, pause this PR until maintainers decide the wider boundary.

Next step before merge

  • No automated repair is needed; the remaining action is maintainer/security acceptance of the fail-closed compatibility change on a protected-label PR.

Maintainer decision needed

  • Question: Should OpenClaw land this fail-closed trusted-host DNS hardening so trusted origins that resolve to unspecified IPv4 or IPv6 answers are rejected?
  • Rationale: The code and proof support the security fix, but the change intentionally tightens a trusted-origin path that may affect existing operator configurations.
  • Likely owner: steipete — He has the strongest recent history signal for SSRF/net-policy security and compatibility decisions around this helper family.
  • Options:
    • Accept fail-closed hardening (recommended): Land the PR with release-note context that unspecified trusted-origin DNS answers are rejected while ordinary private-origin and localhost controls remain supported.
    • Require a compatibility exception: If 0.0.0.0-style trusted origins must keep working, require an explicit owner-approved policy exception and focused tests before merge.
    • Pause for broader SSRF policy: Hold the branch if maintainers want unspecified, loopback, and mixed-DNS trusted-host behavior decided together.

Security
Cleared: The diff hardens an SSRF boundary and does not add dependencies, secrets handling, workflow execution, or a concrete supply-chain regression.

Review details

Best possible solution:

Land the narrow trusted-host DNS recheck after maintainer/security acceptance, keeping explicitly configured private and localhost controls covered by tests and real guarded-fetch proof without adding new config or SDK surface.

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

Yes, at source level. Current main promotes exact-origin trust into allowedHostnames and then the trusted-host DNS recheck lacks an unspecified-address test, so a matching trusted origin can resolve to 0.0.0.0 or :: without hitting the generic private-IP classifier.

Is this the best way to solve the issue?

Yes, with maintainer acceptance. The fix belongs in the trusted-host resolved-address recheck rather than the general classifier, because the general path must still allow intentionally trusted RFC1918 and ULA provider origins.

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the contributor posted AWS Crabbox real Linux guarded-fetch logs for exact head dd4557e showing unspecified DNS answers denied before the sink and positive private/localhost controls still allowed.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): Sufficient: the contributor posted AWS Crabbox real Linux guarded-fetch logs for exact head dd4557e showing unspecified DNS answers denied before the sink and positive private/localhost controls still allowed.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P0: The PR addresses an SSRF security-boundary bypass in trusted hostname DNS handling.
  • merge-risk: 🚨 compatibility: Existing trusted local/provider origins that resolve to unspecified addresses can stop working after this fail-closed change.
  • merge-risk: 🚨 security-boundary: The diff changes the SSRF guard's trusted-host DNS decision boundary and needs maintainer/security acceptance.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): Sufficient: the contributor posted AWS Crabbox real Linux guarded-fetch logs for exact head dd4557e showing unspecified DNS answers denied before the sink and positive private/localhost controls still allowed.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient: the contributor posted AWS Crabbox real Linux guarded-fetch logs for exact head dd4557e showing unspecified DNS answers denied before the sink and positive private/localhost controls still allowed.
Evidence reviewed

PR surface:

Source +18, Tests +97. Total +115 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 18 0 +18
Tests 4 97 0 +97
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 115 0 +115

What I checked:

  • Repository policy read: Root AGENTS.md and src/plugin-sdk/AGENTS.md were read fully; the review applied the SSRF security-boundary, SDK-boundary, compatibility-risk, proof, and dependency-contract guidance. (AGENTS.md:1, 4b869091356d)
  • Current-main trusted-host gap: Current main promotes a matching allowedOrigin into allowedHostnames, then the trusted-host DNS recheck blocks loopback, link-local, and cloud metadata answers but does not reject unspecified DNS answers. (src/infra/net/ssrf.ts:237, 4b869091356d)
  • Runtime guarded-fetch caller path: fetchWithSsrFGuard resolves the URL-specific SSRF policy inside the redirect loop, then calls resolvePinnedHostnameWithPolicy and createPinnedDispatcher before the fetch sink. (src/infra/net/fetch-guard.ts:493, 4b869091356d)
  • Pinned dispatcher override path: createPinnedDispatcher validates pinnedHostname override addresses through the same trusted-host resolved-address helper before building a dispatcher lookup. (src/infra/net/ssrf.ts:630, 4b869091356d)
  • PR implementation: The PR adds isUnspecifiedIpAddressIncludingEmbeddedIpv4 and calls it inside assertAllowedTrustedHostnameResolvedAddressesOrThrow before trusted DNS answers are accepted. (src/infra/net/ssrf.ts:425, dd4557efe77b)
  • Regression coverage: The diff adds unspecified-address tests for guarded fetch, resolvePinnedHostnameWithPolicy, pinned dispatcher overrides, and the plugin SDK allowed-origin safety path. (src/infra/net/fetch-guard.ssrf.test.ts:860, dd4557efe77b)

Likely related people:

  • steipete: Recent GitHub commit history and PR comments show Peter Steinberger doing SSRF/net-policy refactors, docs, and the maintainer follow-up/landing work around adjacent trusted-host hardening. (role: recent area contributor and likely decision owner; confidence: high; commits: f4331d175a6a, 53aa5232bc00, f4c6c0aec49e; files: src/infra/net/ssrf.ts, src/infra/net/fetch-guard.ts, packages/net-policy/src/ip.ts)
  • machine3at: Authored the merged trusted-host loopback hardening work that changed assertAllowedTrustedHostnameResolvedAddressesOrThrow and nearby tests this PR extends to unspecified addresses. (role: adjacent feature contributor; confidence: high; commits: 8013b0f6eb2f, eb64c036bb88, a00e9fc228db; files: src/infra/net/ssrf.ts, src/infra/net/ssrf.dispatcher.test.ts, src/plugin-sdk/ssrf-policy.test.ts)
  • Kaspre: Authored the merged exact-origin SSRF trust model that promotes allowedOrigins into request-scoped allowedHostnames and made the trusted-host resolver the enforcement point. (role: origin-trust feature-history contributor; confidence: high; commits: 44840007d42d, d4f2bdacf692, f8a4c161f237; files: src/infra/net/ssrf.ts, src/infra/net/fetch-guard.ts, src/plugin-sdk/ssrf-policy.ts)
  • pgondhi987: Beyond this PR, the author has prior merged OpenClaw guarded-fetch and DNS-pinning work on adjacent network surfaces. (role: recent adjacent network contributor; confidence: medium; commits: 3c6259ebb70c, 9497629c1e89; files: src/infra/net/fetch-guard.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

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.
Review history (2 earlier review cycles)
  • reviewed 2026-07-09T18:54:52.448Z sha dd4557e :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-09T19:01:24.678Z sha dd4557e :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 9, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head dd4557efe77b055dd0cb5557ebfd99ff3ecae99f

Real environment and entry point: AWS Crabbox real Linux runner using OpenClaw's production fetchWithSsrFGuard adapter from PR head dd4557efe77b055dd0cb5557ebfd99ff3ecae99f. Provider aws; lease cbx_bdfdd4d10376; slug pearl-hermit; machine c7a.8xlarge; run run_ad84f800dea5; Node v24.18.0; pnpm 11.2.2.

Behavior proved: trusted guarded-fetch requests now block unspecified DNS answers before the protected network request sink is reached, while intended configured private-origin and explicit localhost flows still work.

Protected boundary/sink result: the guarded DNS decision before fetchWithSsrFGuard calls the supplied network request sink. Denied scenario network call=0, because both denied cases reported sinkReached=false; the protected sink was not called.

Fixed/denied scenario proving the protected sink is not reached:

  • PROOF_DENIED ipv4-unspecified address=0.0.0.0 blocked=true sinkReached=false message="Blocked: resolves to private/internal/special-use IP address".
  • PROOF_DENIED ipv6-unspecified address=:: blocked=true sinkReached=false message="Blocked: resolves to private/internal/special-use IP address".

Positive/benign control showing intended behavior still works:

  • Configured private-origin control: network request reached; PROOF_ALLOWED_SINK trusted-private-origin sinkReached=true dispatcherAttached=true and PROOF_ALLOWED trusted-private-origin status=200 sinkReached=true text="ok:trusted-private-origin".
  • Explicit localhost control: network request reached; PROOF_ALLOWED_SINK explicit-localhost-origin sinkReached=true dispatcherAttached=true and PROOF_ALLOWED explicit-localhost-origin status=200 sinkReached=true text="ok:explicit-localhost-origin".

Exact command/artifact evidence:

  • node scripts/crabbox-wrapper.mjs run --provider aws --id cbx_bdfdd4d10376 --timing-json --script /tmp/openclaw-851-guarded-fetch-proof-prhead.sh.
  • Crabbox run run_ad84f800dea5: exit code 0, run status succeeded, sync 3.041s, command 4.661s, total 8.305s.
  • Overall marker: PROOF_RESULT passed guarded-fetch adapter denied unspecified DNS before sink and preserved allowed controls.

Compatibility/operator note: the behavior change is limited to trusted guarded-fetch targets whose DNS resolves to unspecified IPv4/IPv6 answers. Configured private-origin and explicit localhost flows still attach a dispatcher and reach the network request sink. No auth, approval, sandbox, config, migration, storage, provider, plugin, channel, or wire-format surface changed.

Live gaps: this used the real OpenClaw guarded-fetch production adapter on AWS with deterministic DNS answers and a stubbed external network request sink, so it proves the OpenClaw DNS and dispatcher decision boundary without calling real private services or external provider credentials. It is not a full live third-party provider transcript.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 9, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 9, 2026
@pgondhi987
pgondhi987 merged commit c70f3d0 into openclaw:main Jul 10, 2026
8 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 10, 2026
RomneyDa added a commit that referenced this pull request Jul 22, 2026
* fix: gate diagnostics command to owners

(cherry picked from commit 170bf72)

* fix(agent): replace self-wait with deferred release in retained-lock abort cleanup (#96100)

* fix(agent): wait for retained session write before releasing held lock on abort

* fix(agent): replace self-wait with deferred release in retained-lock abort cleanup

* fix(test): reject fallback acquire with SessionWriteLockTimeoutError in active-scope cleanup test

* fix(agent): trim retained-lock comments

Signed-off-by: sallyom <[email protected]>

---------

Signed-off-by: sallyom <[email protected]>
Co-authored-by: sallyom <[email protected]>
(cherry picked from commit 0a042f6)

* fix(gateway): resume channel after pending task recovery

(cherry picked from commit 6039da3)

* fix(gateway): resume channel after pending task recovery

(cherry picked from commit ecd29fe)

* fix(outbound): ignore empty delivery receipts (#79811)

(cherry picked from commit 9a735be)

* fix(agents): guard delivery-evidence attachment recursion against cycles (#97041)

* fix(agents): guard delivery-evidence attachment recursion against cycles

* fix(agents): guard delivery-evidence attachment recursion against cycles

* fix(agents): guard delivery-evidence attachment recursion against cycles

---------

Co-authored-by: Pick-cat <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 4985671)

* fix(opencode-go): re-arm idle timer on block-boundary events to prevent false stalled-stream abort (#97128)

* fix(opencode-go): re-arm idle timer on block-boundary events to prevent false stalled-stream abort

When the opencode-go model finalizes a tool call and deliberates before
the next one, the provider emits real block-boundary SSE events
(text_end, thinking_end, toolcall_start, toolcall_end) that prove the
socket is alive, but the watchdog's isProviderProgressEvent only
returned true for token deltas (text_delta, thinking_delta,
toolcall_delta). This caused the idle timer to fire and falsely abort a
live stream, replacing a completed answer with a stalled error and
dropping the provider's real done event.

Fix: include block-boundary events in isProviderProgressEvent so the
idle timer is re-armed on any forward-progress provider event.
text_start and thinking_start are intentionally excluded because they
are synthetic preamble events that should not shorten the first-event
window.

Closes #96518

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* test(opencode-go): satisfy lint in stream regression

* test(opencode-go): satisfy lint in stream regression

* test(opencode-go): satisfy lint in stream regression

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 552ec2b)

* fix(model-fallback): don't rethrow provider-side AbortErrors as user cancellations (#90908)

* fix(model-fallback): don't rethrow provider-side AbortErrors as user cancellations

When the LLM API closes the connection mid-stream, the fetch layer
surfaces AbortError("This operation was aborted") with no external
abort signal triggered. The old guard `shouldRethrowAbort()` returned
false for these errors (because isTimeoutError matched the message),
so they fell through to the fallback loop but were never retried —
the error propagated up and produced SILENT_REPLY_TOKEN in group
sessions, permanently silencing the topic.

Replace the guard with a direct check: only rethrow AbortError when
the external abort signal is actually set (user/gateway cancellation).
Provider-side AbortErrors without an external signal now fall through
to the next fallback candidate, giving the system a chance to recover.

* fix(cron): forward abort signal into runWithModelFallback

Thread the cron executor's abort signal into the shared
runWithModelFallback call so that cron timeouts and cancellations
stop the fallback chain instead of retrying with the next candidate.

Previously, the run callback checked params.abortSignal?.aborted and
threw, but runWithModelFallback itself had no signal — so the new
guard in model-fallback.ts could not distinguish a caller abort from
a provider-side AbortError and would retry silently.

Also adds a focused regression test verifying the signal is forwarded.

---------

Co-authored-by: Shengting Xie <[email protected]>
Co-authored-by: yayu <[email protected]>
(cherry picked from commit 98ed83f)

* fix(browser): block node routes when sandbox host control is disabled (#97958)

(cherry picked from commit 2cf765f)

* fix(exec): bind Windows allowlist execution path (#98260)

* fix(exec): bind windows allowlist execution path

* fix(exec): add windows shadow execution proof

* fix(exec): preserve wildcard allowlist behavior

* fix(exec): correct blocked plan test fixture

(cherry picked from commit 3811001)

* fix(mcp): suppress unhandled error on stderr pipe in stdio transport (#99803)

* fix(mcp): suppress unhandled error on stderr pipe in stdio transport

When child.stderr is piped to stderrStream without an error
handler, a stream-level error (EPIPE, I/O failure) crashes the
process. Add a noop error handler before the pipe, consistent
with the error handlers already present on stdin and stdout.

Co-Authored-By: Claude <[email protected]>

* test(mcp): add regression test for stderr pipe error suppression

Co-Authored-By: Claude <[email protected]>

* fix(mcp): report stderr stream errors

* fix(mcp): report stderr stream errors

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit 1b84316)

* Harden macOS SQLite WAL checkpoints (#99067)

(cherry picked from commit f7f1be2)

* fix(secrets): suppress unhandled stdout/stderr stream errors in exec resolver (#100521)

* fix(secrets): suppress unhandled stdout/stderr stream errors in exec resolver

* proof(secrets): add real behavior proof script for exec resolver stream error catch

* proof(secrets): replace wrapper with real exec resolver stream error proof

* style: apply oxfmt to changed files

(cherry picked from commit c9a0783)

* fix(agents): retry transient filesystem races when reading workspace bootstrap files (#100910)

* fix(agents): retry transient filesystem races when reading workspace bootstrap files

* fix(agents): retry transient boundary resolution

---------

Co-authored-by: Vincent Koc <[email protected]>
(cherry picked from commit f36d170)

* fix(gateway): finish plugin HTTP responses after post-header failures (#102125)

* fix(gateway): finish plugin HTTP responses after post-header failures

* test(gateway): satisfy plugin HTTP regression lint

* fix(gateway): skip ending destroyed plugin responses

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 240d350)

* fix(gateway): validate exact custom browser origins (#38290)

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit fa0349a)

* fix: block unspecified trusted DNS targets (#103075)

(cherry picked from commit c70f3d0)

* fix(channels): make nack callbacks idempotent (#104919)

* fix(channels): make nack callbacks idempotent

* fix(channels): coalesce overlapping nack callbacks

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 02d307e)

* fix(channels): prevent base URL credentials in status output (#107754)

* fix(channels): redact credentials in account URLs

* fix(channels): sanitize final status summaries

(cherry picked from commit 210340f)

* fix(channels): prevent lifecycle listener buildup (#109108)

(cherry picked from commit 0e1fad7)

* fix(sandbox): use Buffer.byteLength for env var value size limit (#105017)

* fix(sandbox): use Buffer.byteLength for env var value size limit

validateEnvVarValue checked value.length (UTF-16 code units) against
the 32768-byte limit, so multi-byte CJK values like "值".repeat(11000)
passed the check despite exceeding 33 KB in UTF-8. Switch to
Buffer.byteLength(value, "utf8") so the limit matches the actual byte
count the OS and child processes see.

* test(sandbox): simplify env byte-limit coverage

Co-authored-by: 唐梓夷0668001293 <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 84fb48c)

* fix(gateway): guard process.kill ESRCH race in signalVerifiedGatewayPidSync (#109590)

* fix(gateway): guard process.kill ESRCH race in signalVerifiedGatewayPidSync

A verified gateway process can exit between the argv validation check and
the process.kill call, causing an unhandled ESRCH error. Wrap the kill in
try-catch and silently swallow ESRCH (process already gone = signal
already delivered).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

* docs(gateway): explain ESRCH signal race

Co-authored-by: 丁宇婷0668001435 <[email protected]>

---------

Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 853b1a8)

* fix(litellm): guard loopback hostname auto-allow with isIP to prevent DNS SSRF bypass (#110693)

* fix(litellm): guard loopback hostname auto-allow with isIP to prevent DNS bypass

The isAutoAllowedLitellmHostname helper auto-enables private-network access
for loopback-style hosts. Before this fix, lowered.startsWith("127.")
matched DNS hostnames like 127.evil.com, letting remote endpoints bypass
the explicit allowPrivateNetwork opt-in — a SSRF risk.

Add isIP(host)===4 guard so only literal IPv4 loopback addresses qualify.
Same canonical pattern as extensions/slack/src/monitor/relay-source.ts:271
and the codex loopback fix.

Co-Authored-By: Claude <[email protected]>

* test(litellm): cover loopback endpoint policy

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 3d03b60)

* fix(discord): sustained gateway bursts stop growing memory (#110954)

* fix(discord): sustained gateway bursts stop growing memory

* fix(discord): contain gateway queue overflow

* fix(discord): drop oldest saturated gateway sends

Co-authored-by: 张贵萍0668001030 <[email protected]>

* fix(discord): surface gateway overflow warnings

Co-authored-by: 张贵萍0668001030 <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 69aeba9)

* fix(gateway): bound busy channel health by real run age (#103793)

* fix(gateway): bound busy channel health by real run age

The channel health policy treats a channel as healthy-busy even while
disconnected, bounded only by a 25 minute stale ceiling measured from
lastRunActivityAt. The run-state heartbeat refreshes lastRunActivityAt
every 60 seconds for as long as any run is active, so a run that hangs
forever (for example a send blocking on a dead socket after the
transport already reported connected:false) keeps that timestamp fresh
and the stuck ceiling is never reached. The account is then reported
healthy forever by the health monitor, readiness probe, and health CLI,
and no restart ever fires.

createRunStateMachine now tracks each in-flight run's start time keyed by
an opaque run handle and publishes the oldest still-active run's start as
activeRunStartedAt. The health policy busy override keys its ceiling off
the real run age, so a run stuck longer than the threshold reports stuck
and the monitor can restart it. Because the reported start is the oldest
active run and advances to the next-oldest as runs complete, a channel
churning through many short overlapping runs (activeRuns above 1 across
concurrent queue keys) stays healthy; only a genuinely hung run breaches
the ceiling. Short and active runs stay healthy and the existing
lastRunActivityAt fallback is preserved for snapshots without a start
time.

* fix(channels): retain run-state callback compatibility

Keep the released zero-argument onRunEnd callback source-compatible while allowing internal queue callers to pass a run handle for exact concurrent-run accounting. The compatibility path closes the oldest active run, preserving existing lifecycle behavior for consumers that do not use handles.

* fix(channels): keep anonymous runs out of age tracking

The zero-argument lifecycle callbacks cannot identify which concurrent run completed, so they must not update the identity-sensitive run start used by channel health. Keep their busy count separately and reserve exact start tracking for the shared queue's handle-aware lifecycle path.

* fix(channels): keep tracked runs internal

Keep the public run-state lifecycle callbacks unchanged. The channel queue now owns opaque run identity and augments its status updates with the oldest active queue run, so implementation details do not expand the SDK surface.

* fix(channels): type queue run start status

Keep activeRunStartedAt in the internal status patch type so the queue can publish its private tracked-run age through the existing status sink.

* fix(channels): wrap isActive to satisfy unbound-method lint

* fix(gateway): gate busy run-age ceiling on disconnected transport

(cherry picked from commit 18b79d9)

* fix(deps): update fast-uri past advisory

(cherry picked from commit 1be9db0)

* fix(release): adapt maintenance-line hardening

Backport/adapt 18ec9ce, dea1fe1, 7f32b6c, 1da345e, 931ac3e, 89780d5, and c0d99ed for the 2026.6 extended-stable maintenance line.

* fix(deps): bump protobufjs to 7.6.5

Backport-adapted from a230f74.

* test(gateway): cover bounded macOS process probe

* chore(release): prepare 2026.6.34

* test(dotenv): share path override environment assertions

* fix(release): resolve 2026.6.34 CI blockers

---------

Signed-off-by: sallyom <[email protected]>
Co-authored-by: joshavant <[email protected]>
Co-authored-by: Peter Lee <[email protected]>
Co-authored-by: sallyom <[email protected]>
Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: Liu Wenyu <[email protected]>
Co-authored-by: pick-cat <[email protected]>
Co-authored-by: Pick-cat <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: weiqinl <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: shengting <[email protected]>
Co-authored-by: Shengting Xie <[email protected]>
Co-authored-by: yayu <[email protected]>
Co-authored-by: Agustin Rivera <[email protected]>
Co-authored-by: cxbAsDev <[email protected]>
Co-authored-by: ooiuuii <[email protected]>
Co-authored-by: Masato Hoshino <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: mushuiyu886 <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Bruno Wowk (Volky) <[email protected]>
Co-authored-by: Pavan Kumar Gondhi <[email protected]>
Co-authored-by: Glucksberg <[email protected]>
Co-authored-by: xingzhou <[email protected]>
Co-authored-by: tzy-17 <[email protected]>
Co-authored-by: krissding <[email protected]>
Co-authored-by: lsr911 <[email protected]>
Co-authored-by: Yuval Dinodia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant