Skip to content

fix(voice-call): bracket IPv6 webhook hosts - #115135

Merged
steipete merged 2 commits into
openclaw:mainfrom
IWhatsskill:agent/fix-voice-call-ipv6-webhook-host
Jul 28, 2026
Merged

steipete merged 2 commits into
openclaw:mainfrom
IWhatsskill:agent/fix-voice-call-ipv6-webhook-host

Conversation

@IWhatsskill

@IWhatsskill IWhatsskill commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

[AI-assisted]

What Problem This Solves

Voice Call webhook reconstruction removed brackets from a valid IPv6 Host header for comparison and then inserted the bare colon-containing address into the URL authority. The resulting value, such as https://2001:db8::1/voice/webhook, was not a valid public webhook URL for the existing verification path.

Failure mode

A bracketed IPv6 Host was normalized to a bare address, then concatenated after https:// without restoring brackets. Malformed bracket contents or trailing text were also accepted by the bracket branch instead of falling through safely.

Why This Change Was Made

Bracketed Host values are now accepted only when their contents are an IPv6 literal that the native URL owner can serialize and any suffix is an optional numeric port. The normalized bare address remains available for allowed-host comparison, while URL serialization restores the required brackets.

Root Cause

The same normalized hostname representation was used for both allowlist comparison and URL serialization even though an IPv6 URL authority requires brackets.

Runtime ownership

Voice Call's reconstructWebhookUrl continues to own trusted header selection and path reconstruction. extractHostname owns validation and normalized comparison keys; the new formatter owns only URL-authority serialization.

User Impact

Voice Call deployments using a direct or trusted forwarded IPv6 Host now supply a valid bracketed public URL to the existing signature verifier. Existing forwarding trust, domain and IPv4 handling, port stripping, fallback order, redacted diagnostics, and replay behavior remain unchanged.

Evidence

Validated at exact head 126ffc1b78bec68178b196d7e852ceb72f2bcef4: a running Voice Call webhook accepted a valid Plivo V3 HMAC through a trusted IPv6 proxy/Host path with HTTP 200 and rejected the invalid-signature control with HTTP 401; 40/40 focused tests also passed.

Inspect exact-head proof ledger

Provenance

  • Base: f4da74a0af4e2390551e637f42e1693182f372a9
  • Proof head: 126ffc1b78bec68178b196d7e852ceb72f2bcef4
  • Revalidated: after merging current upstream main

Direct behavior

  • Running IPv6 webhook and trusted-proxy observation (MEASURED) — Observed: a production VoiceCallWebhookServer and PlivoProvider ran behind an HTTP proxy bound to [::1]; the trusted loopback proxy forwarded the expanded host [2001:0db8:0000:0000:0000:0000:0000:0001]:8443, while the HMAC was signed for the canonically equivalent URL https://[2001:db8::1]/voice/webhook?flow=xml-listen&callId=ipv6-proof. Result: the valid signed request returned HTTP 200 with a Plivo XML response, while the deliberately corrupted signature returned HTTP 401; the HMAC secret was ephemeral and redacted and no external provider request occurred. Proves a running after-fix Voice Call webhook accepts a valid signature through the configured trusted proxy and equivalent IPv6 Host spellings, and still fails closed for an invalid signature. Preserves signature enforcement, trustedProxyIPs gating, allowed-host validation, provider response handling, and the no-external-network proof boundary.

Redacted exact-head IPv6 webhook runtime output

$ git rev-parse HEAD
126ffc1b78bec68178b196d7e852ceb72f2bcef4

$ <isolated production Voice Call webhook + IPv6 proxy runtime>
[plivo] Webhook verification failed: Invalid Plivo V3 signature
{
  "exact_head": "126ffc1b78bec68178b196d7e852ceb72f2bcef4",
  "runtime": "running VoiceCallWebhookServer + production PlivoProvider",
  "test_runner": "none",
  "webhook_listener": "http://127.0.0.1:<ephemeral-port>/voice/webhook",
  "proxy_listener": "http://[::1]:<ephemeral-port>",
  "proxy_client_remote_address": "::1",
  "proxy_upstream_local_address": "127.0.0.1",
  "trusted_proxy_ips": ["127.0.0.1"],
  "configured_allowed_host": "[2001:db8::1]",
  "forwarded_host_received": "[2001:0db8:0000:0000:0000:0000:0000:0001]:8443",
  "signed_canonical_url": "https://[2001:db8::1]/voice/webhook?flow=xml-listen&callId=ipv6-proof",
  "valid_signed_request_status": 200,
  "valid_response_is_xml": true,
  "invalid_signature_control_status": 401,
  "ephemeral_hmac_secret_redacted": true,
  "external_provider_network_calls": 0
}

Automated verification

Focused Voice Call webhook security

node scripts/run-vitest.mjs extensions/voice-call/src/webhook-security.test.ts --run --reporter=verbose
  • node scripts/run-vitest.mjs extensions/voice-call/src/webhook-security.test.ts --run --reporter=verbose — 1 test file and 40 tests passed with 0 failures and 0 skips. Proves native IPv6 URL parsing, canonical allowlist comparison, Twilio and Plivo HMAC integration, malformed-host fallback, trusted-proxy matching, replay behavior, and diagnostic redaction remain correct. Preserves Twilio, Telnyx, and Plivo verification; forwarding trust; replay handling; port variants; and domain-host behavior.

Focused static verification

git diff --check origin/main...HEAD
  • git diff --check origin/main...HEAD — completed with exit code 0 and no output. Proves the refreshed Base-to-HEAD patch has no whitespace errors. Preserves the exact two-file PR surface.

Preserved boundaries

  • Forwarding headers remain ignored unless allowedHosts or explicit forwarding trust enables them.
  • trustedProxyIPs still restrict forwarding-header use when configured.
  • Domain and IPv4 validation, lowercasing, and existing port stripping remain unchanged.
  • Malformed direct hosts continue to use the context-URL fallback; invalid signatures continue to fail closed.
  • No provider credentials, configuration schema, replay-cache lifetime, or public API changes.

Proof gap

A live external carrier delivery was not run because no carrier credentials are used in the proof environment. The actual production webhook server and provider verifier processed real HTTP through a real IPv6-bound trusted proxy with an ephemeral HMAC secret, proving the changed local security boundary. No external carrier interoperability or deployment claim is made.

Artifacts

  • A redacted exact-head runtime transcript is embedded under Direct behavior; no separate binary artifact is attached.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: S labels Jul 28, 2026
@IWhatsskill
IWhatsskill marked this pull request as ready for review July 28, 2026 10:16
@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. P2 Normal backlog priority with limited blast radius. labels Jul 28, 2026
@clawsweeper

clawsweeper Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 8:27 AM ET / 12:27 UTC.

ClawSweeper review

What this changes

The PR validates bracketed IPv6 webhook hosts, canonicalizes them for allowlist comparison, and restores brackets when rebuilding the URL used by Voice Call provider signature verification.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary: current main still extracts an IPv6 literal to a bare hostname and interpolates it into the webhook verification URL without brackets, yielding an invalid URL authority. The refreshed PR adds narrow parsing and serialization boundaries, has credible exact-head runtime proof, and has no supported patch defect; it should proceed through its normal current-base/CI merge gate. Likely related people: IWhatsskill is the only identified active contributor for this path in the available PR provenance (low confidence for longer-term ownership).

Priority: P2
Reviewed head: 126ffc1b78bec68178b196d7e852ceb72f2bcef4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned security-path repair with strong direct runtime proof and targeted coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): The PR body contains redacted exact-head after-fix runtime output from a running Voice Call webhook behind an IPv6 proxy, including a valid Plivo HMAC acceptance and invalid-signature rejection control.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The PR body contains redacted exact-head after-fix runtime output from a running Voice Call webhook behind an IPv6 proxy, including a valid Plivo HMAC acceptance and invalid-signature rejection control.
Evidence reviewed 4 items Current-main behavior: Current main extracts the contents of a bracketed IPv6 Host header into a bare hostname and returns ${proto}://${host}${path}; an IPv6 host therefore reaches URL reconstruction without the required authority brackets.
Focused patch boundary: The branch validates bracketed hosts as IPv6 literals with an optional numeric port, canonicalizes them through the native URL parser for host comparison, and brackets only IPv6 values when serializing the reconstructed URL.
Regression coverage and real behavior proof: The supplied PR evidence adds focused malformed-host and IPv6 reconstruction coverage and reports an exact-head running Voice Call/Plivo webhook behind an IPv6 proxy: valid HMAC returned HTTP 200 and the invalid-signature control returned HTTP 401.
Findings None None.
Security None None.

How this fits together

The Voice Call plugin receives webhook requests from providers and may reconstruct their public URL from direct or trusted forwarded host headers before validating a provider signature. The reconstructed URL feeds Twilio and Plivo verification and determines whether a signed inbound call is accepted.

flowchart LR
  A[Inbound provider webhook] --> B[Host and forwarding headers]
  B --> C[Trusted-host selection]
  C --> D[Hostname normalization]
  D --> E[Public webhook URL reconstruction]
  E --> F[Twilio or Plivo signature verification]
  F --> G[Accept or reject call webhook]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +20, Tests +116. Total +136 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 22 2 +20
Tests 1 116 0 +116
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 138 2 +136

Review metrics

None.

Merge-risk options

  • The branch is behind current main and several required checks were still in progress in the supplied snapshot, so merge should use a refreshed head with completed required checks.

Maintainer options:

  1. Decide the mitigation before merge
    Rebase or merge the current main into this focused branch, retain the strict IPv6 parsing plus URL-only bracketing split, and merge after the exact refreshed head completes its required checks.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase or merge the current main into this focused branch, retain the strict IPv6 parsing plus URL-only bracketing split, and merge after the exact refreshed head completes its required checks.

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

Yes, from source: a valid bracketed IPv6 Host is reduced to a bare literal and then concatenated after https:// on current main. The PR also supplies exact-head runtime evidence for the affected trusted-proxy and Plivo verification path.

Is this the best way to solve the issue?

Yes. Separating normalized hostname comparison from URL-authority serialization is the narrowest maintainable fix: allowlist checks retain canonical bare IPv6 values while generated URLs use the required brackets.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains redacted exact-head after-fix runtime output from a running Voice Call webhook behind an IPv6 proxy, including a valid Plivo HMAC acceptance and invalid-signature rejection control.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body contains redacted exact-head after-fix runtime output from a running Voice Call webhook behind an IPv6 proxy, including a valid Plivo HMAC acceptance and invalid-signature rejection control.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, 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:

  • P2: This is a bounded Voice Call webhook verification correctness fix affecting deployments that use bracketed IPv6 hosts or trusted IPv6 forwarding.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body contains redacted exact-head after-fix runtime output from a running Voice Call webhook behind an IPv6 proxy, including a valid Plivo HMAC acceptance and invalid-signature rejection control.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains redacted exact-head after-fix runtime output from a running Voice Call webhook behind an IPv6 proxy, including a valid Plivo HMAC acceptance and invalid-signature rejection control.

Evidence

What I checked:

  • Current-main behavior: Current main extracts the contents of a bracketed IPv6 Host header into a bare hostname and returns ${proto}://${host}${path}; an IPv6 host therefore reaches URL reconstruction without the required authority brackets. (extensions/voice-call/src/webhook-security.ts:133, 2c5aff01f62d)
  • Focused patch boundary: The branch validates bracketed hosts as IPv6 literals with an optional numeric port, canonicalizes them through the native URL parser for host comparison, and brackets only IPv6 values when serializing the reconstructed URL. (extensions/voice-call/src/webhook-security.ts:134, 126ffc1b78be)
  • Regression coverage and real behavior proof: The supplied PR evidence adds focused malformed-host and IPv6 reconstruction coverage and reports an exact-head running Voice Call/Plivo webhook behind an IPv6 proxy: valid HMAC returned HTTP 200 and the invalid-signature control returned HTTP 401. (extensions/voice-call/src/webhook-security.test.ts:356, 126ffc1b78be)
  • Prior review continuity: The prior completed ClawSweeper cycle requested real behavior proof and reported no code findings. The PR body was subsequently updated with exact-head runtime output, so that blocker is addressed rather than re-raised. (126ffc1b78be)

Likely related people:

  • IWhatsskill: The supplied PR provenance identifies this contributor as the author of both commits and the after-fix Voice Call IPv6 proof; longer-term current-main ownership could not be established from the available read-only provenance. (role: proposed patch author; confidence: low; commits: efe3c2fb4451, 126ffc1b78be; files: extensions/voice-call/src/webhook-security.ts, extensions/voice-call/src/webhook-security.test.ts)

Rank-up moves

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

  • Refresh the branch against current main and allow the required checks for that exact merge head to finish.

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 (1 earlier review cycle)
  • reviewed 2026-07-28T10:20:47.593Z sha efe3c2f :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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: 🦪 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 28, 2026
@steipete
steipete merged commit 3d4d2b7 into openclaw:main Jul 28, 2026
105 of 111 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
…etwork-none

* origin/main: (24 commits)
  refactor(sessions): isolate legacy transcript fixtures (#115231)
  fix(discord): clear pending launch watchdog (#115100)
  fix(agents): stop quadratic subagent prompt rendering (#115263)
  fix(memory-core): recover dreaming cron reconciliation (#115174)
  fix(qa-lab): filter incompatible channel scenarios (#115087)
  fix(android): respect locale in compact labels
  test(i18n): prove iOS discovery catalog ownership
  chore(i18n): refresh gateway discovery catalogs
  fix(i18n): include shared discovery copy in macOS catalog
  fix(apple): localize gateway discovery status
  chore(i18n): drop release-owned changelog entry
  fix(macos): localize privacy permission prompts
  fix(voice-call): bracket IPv6 webhook hosts (#115135)
  test(ci): split control UI scope coverage
  fix(ui): detect composed accessibility copy
  fix(ci): run localization checks for UI changes
  test(ui): catch untranslated accessibility labels
  fix(ui): localize chat action labels
  fix(ui): localize chat status indicators
  fix(ui): sync document locale metadata
  ...
vincentkoc added a commit that referenced this pull request Jul 28, 2026
…-20260728

* origin/main: (21 commits)
  refactor(sessions): isolate legacy transcript fixtures (#115231)
  fix(discord): clear pending launch watchdog (#115100)
  fix(agents): stop quadratic subagent prompt rendering (#115263)
  fix(memory-core): recover dreaming cron reconciliation (#115174)
  fix(qa-lab): filter incompatible channel scenarios (#115087)
  fix(android): respect locale in compact labels
  test(i18n): prove iOS discovery catalog ownership
  chore(i18n): refresh gateway discovery catalogs
  fix(i18n): include shared discovery copy in macOS catalog
  fix(apple): localize gateway discovery status
  chore(i18n): drop release-owned changelog entry
  fix(macos): localize privacy permission prompts
  fix(voice-call): bracket IPv6 webhook hosts (#115135)
  test(ci): split control UI scope coverage
  fix(ui): detect composed accessibility copy
  fix(ci): run localization checks for UI changes
  test(ui): catch untranslated accessibility labels
  fix(ui): localize chat action labels
  fix(ui): localize chat status indicators
  fix(ui): sync document locale metadata
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

2 participants