Skip to content

fix(voice-call): pin Twilio webhook verification to the configured public path - #112800

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
masatohoshino:fix/twilio-webhook-verification-path
Jul 29, 2026
Merged

vincentkoc merged 3 commits into
openclaw:mainfrom
masatohoshino:fix/twilio-webhook-verification-path

Conversation

@masatohoshino

@masatohoshino masatohoshino commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Twilio signs the provider-facing webhook URL. When a reverse proxy maps a public path such as /proxy/voice/webhook to a different local serve.path, current OpenClaw overwrites the configured publicUrl path with the local request path before verification. A correctly signed Twilio request is then rejected.

Deployments where public and local paths already match are unchanged.

Why This Rewrite

The maintainer rewrite keeps the configured publicUrl scheme, host, and path and applies only the per-request query string. That is the narrow owner-boundary fix: publicUrl owns the provider-facing URL, while the incoming request owns request-specific query parameters.

The original PR was broader than needed. Its duplicate test cases were collapsed, and its documentation no longer implies that Telnyx signatures use request URLs.

User Impact

Twilio voice-call webhooks behind path-rewriting proxies verify against the URL configured with Twilio. No config, schema, or API changes are introduced.

Maintainer Rewrite

  • Exact head: d49601b17d37019b55683108f31a651df4fb3e13
  • Base: b4d14d78480650860423964b4b450e8a3f878150
  • Diff: 3 files, +21/-24
  • Contributor authorship preserved.

Changed surfaces:

  • extensions/voice-call/src/webhook-security.ts: preserve configured path; copy only request query.
  • extensions/voice-call/src/webhook-security.test.ts: prove the configured-path signature succeeds and the rewritten local-path signature fails.
  • docs/plugins/voice-call.md: document proxy mapping and provider-specific URL-signature behavior.

Evidence

The production entry path is extensions/voice-call/src/webhook.ts through the Twilio owner adapter in extensions/voice-call/src/providers/twilio/webhook.ts to verifyTwilioWebhook().

Current-main reproduction with the official Twilio Node SDK signing oracle:

  • signature for configured public path: rejected;
  • signature for rewritten local path: accepted.

After the fix:

  • signature for configured public path: accepted;
  • signature for rewritten local path: rejected;
  • ordinary matching-path deployment: unchanged.

This matches Twilio's documented contract: request validation signs the full configured URL, including its path and query, plus POST parameters.

Verification

  • Voice-call webhook security suite: 40/40 passed.
  • Targeted oxfmt, oxlint, MDX validation, and git diff --check: passed.
  • Fresh autoreview: no actionable findings, correctness 0.96.
  • Exact-head GitHub CI: pending.

No live Twilio account request was made; the official SDK was used as the signing oracle against the production verifier.

Docs

Public page: https://docs.openclaw.ai/plugins/voice-call

…blic path

buildTwilioVerificationUrl overwrote the configured publicUrl path with the
incoming request path, so behind a path-rewriting reverse proxy the
reconstructed verification URL no longer matched the URL Twilio signed and
valid webhooks were rejected. Use the configured public path (keep the request
query), mirroring the Plivo sibling fixed in openclaw#112559. Restores callback-path
binding and adds proxy-prefix accept + local-path reject regression tests.
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: voice-call Channel integration: voice-call size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 22, 2026
@masatohoshino
masatohoshino marked this pull request as ready for review July 23, 2026 00:11
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 23, 2026
@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. P1 High-priority user-facing bug, regression, or broken workflow. 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 24, 2026
@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 29, 2026, 12:29 PM ET / 16:29 UTC.

ClawSweeper review

What this changes

The PR makes Twilio webhook verification retain the configured public URL path while applying the inbound request query, with regression coverage and updated proxy/signature documentation.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for normal maintainer landing. The focused change appears to correct a real Twilio URL-signature mismatch behind path-rewriting proxies, preserves the intended configured public endpoint boundary, has targeted negative coverage, and has adequate provider-oracle proof; the remaining gate is review of the current-head CI result rather than a new code repair.

Priority: P1
Reviewed head: d49601b17d37019b55683108f31a651df4fb3e13

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-scoped authentication repair with direct provider-oracle evidence and no actionable patch defect found; current-head CI remains the final landing gate.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR supplies after-fix provider-contract evidence using Twilio’s official SDK as the signing oracle against the production verifier, including configured-path acceptance and rewritten-local-path rejection.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies after-fix provider-contract evidence using Twilio’s official SDK as the signing oracle against the production verifier, including configured-path acceptance and rewritten-local-path rejection.
Evidence reviewed 5 items Focused verification boundary: The proposed verifier keeps the configured public URL path and copies only the inbound query string, which matches the provider-facing versus local-routing boundary described in the PR.
Regression proof covers both directions: The changed test accepts a signature made for the configured proxy-prefixed public URL and rejects one made for the rewritten local path, preventing the prior path substitution from silently returning.
Provider contract and real-behavior evidence: The PR body reports a current-main before/after reproduction using Twilio’s official Node SDK as the signing oracle against OpenClaw’s production verifier; GitHub records the resulting proof as sufficient.
Findings None None.
Security None None.

How this fits together

The voice-call plugin receives provider webhooks and verifies their signatures before handing calls into OpenClaw. Twilio signs the externally configured webhook URL, so the verification layer must distinguish the public provider-facing path from a reverse proxy’s local request path.

flowchart LR
  A[Twilio webhook request] --> B[Reverse proxy]
  B --> C[Voice-call webhook handler]
  C --> D[Twilio signature verifier]
  E[Configured public URL] --> D
  D --> F[Accept or reject webhook]
  F --> G[Voice-call processing]
Loading

Before merge

  • Resolve merge risk (P1) - Webhook signature verification is an authentication boundary: merge only after the current-head checks complete and the final merge result still preserves the configured public path while rejecting signatures for the rewritten local path.
  • Resolve merge risk (P1) - Existing proxy deployments whose provider configuration does not actually match publicUrl will correctly fail verification after this change; the updated documentation should remain the operator-facing recovery path.
  • Complete next step (P2) - No concrete repair remains; the assigned reviewer should evaluate the completed current-head CI and land the already-focused patch if the merge result is clean.
Agent review details

Security

None.

PR surface

Source +1, Tests -6, Docs +2. Total -3 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 14 20 -6
Docs 1 5 3 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 21 24 -3

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Finish current-head verification (recommended)
    Let the in-progress checks complete on the exact head, then land if the merge result retains the configured-path acceptance and local-path rejection behavior.
  2. Pause if operator contract is disputed
    If maintainers intend proxies to make local paths authoritative, pause this PR and resolve that documented authentication contract before changing accepted webhook signatures.

Technical review

Best possible solution:

Land the narrow verifier change after current-head CI confirms the exact merge result, retaining publicUrl as the provider-facing authority and using request data only for request-specific query parameters.

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

Yes in source, with medium confidence: the documented path-rewriting proxy case reaches the Twilio verifier with a local path that previously replaced the configured public path, and the PR provides before/after official-SDK signing-oracle results. I did not independently execute the reproduction in this read-only review.

Is this the best way to solve the issue?

Yes. Preserving the configured provider-facing URL path and applying only the request query is the narrowest maintainable repair; it avoids changing configuration, provider APIs, or unrelated webhook routing.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 6dc13c63b6be.

Labels

Label justifications:

  • P1: A valid Twilio webhook can be rejected for proxy deployments that rewrite the public callback path before it reaches OpenClaw.
  • merge-risk: 🚨 compatibility: The accepted signature URL changes for existing proxy deployments, so configured provider URLs and publicUrl must remain aligned through upgrade.
  • merge-risk: 🚨 security-boundary: The changed code constructs the URL used by Twilio webhook authentication, directly affecting which signed callbacks are accepted.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies after-fix provider-contract evidence using Twilio’s official SDK as the signing oracle against the production verifier, including configured-path acceptance and rewritten-local-path rejection.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies after-fix provider-contract evidence using Twilio’s official SDK as the signing oracle against the production verifier, including configured-path acceptance and rewritten-local-path rejection.

Evidence

What I checked:

  • Focused verification boundary: The proposed verifier keeps the configured public URL path and copies only the inbound query string, which matches the provider-facing versus local-routing boundary described in the PR. (extensions/voice-call/src/webhook-security.ts:320, d49601b17d37)
  • Regression proof covers both directions: The changed test accepts a signature made for the configured proxy-prefixed public URL and rejects one made for the rewritten local path, preventing the prior path substitution from silently returning. (extensions/voice-call/src/webhook-security.test.ts:732, d49601b17d37)
  • Provider contract and real-behavior evidence: The PR body reports a current-main before/after reproduction using Twilio’s official Node SDK as the signing oracle against OpenClaw’s production verifier; GitHub records the resulting proof as sufficient. (d49601b17d37)
  • Prior review continuity: The preceding completed ClawSweeper review at 5c37183 found no actionable patch defects and asked only for refresh against current main; the latest head is the narrowed maintainer rewrite. (extensions/voice-call/src/webhook-security.ts:320, 5c37183aef55)
  • Landing state: The PR remains open and its current-head workflow still has required checks in progress, so it is neither implemented on main nor ready for a cleanup close. (d49601b17d37)

Likely related people:

  • vincentkoc: Assigned to this PR and authored the current-main anchoring commit immediately before the narrowed final head, making this the strongest visible routing signal for the landing decision. (role: recent area contributor and assigned reviewer; confidence: medium; commits: 992d19a1e3dc; files: extensions/voice-call/src/webhook-security.ts, extensions/voice-call/src/webhook-security.test.ts)
  • pgondhi987: The review context identifies the Plivo public-path verification fix as the closest sibling implementation, so this contributor is relevant for the shared URL-verification invariant rather than as an owner of this Twilio patch. (role: adjacent provider-path contributor; confidence: medium; commits: c5c9f482; files: extensions/voice-call/src/webhook-security.ts)

Rank-up moves

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

  • Wait for the in-progress current-head checks, then confirm the merge result still exercises the proxy-rewrite regression coverage.

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 (2 earlier review cycles)
  • reviewed 2026-07-24T21:51:28.546Z sha 5c37183 :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-25T13:30:08.126Z sha 5c37183 :: needs maintainer review 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 25, 2026
@vincentkoc vincentkoc self-assigned this Jul 29, 2026
@vincentkoc
vincentkoc merged commit 458bb58 into openclaw:main Jul 29, 2026
124 of 128 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

vincentkoc added a commit to ZengWen-DT/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (446 commits)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  fix(sms): isolate validated webhook quotas per sender (openclaw#104862)
  fix(sessions): recover deleted chats without endless retries (openclaw#115974)
  fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847)
  feat(ui): enable tool-loop detection from Labs (openclaw#115983)
  fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998)
  fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
  fix(ui): derive cron timezone suggestions (openclaw#115973)
  fix(scripts): bound dependency pin git lookups (openclaw#110570)
  fix(skills): preserve configless workshop apply upgrades (openclaw#115982)
  fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236)
  fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800)
  fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004)
  fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501)
  fix(channels): mark durable webhook acceptance on Zalo, Google Chat, SMS, Feishu, Nextcloud Talk, and Synology Chat (openclaw#115586)
  fix(test): restore stdin TTY descriptors (openclaw#115985)
  fix(plugins): remove incorrect modifying hook timeout fallback in getClaimingHookTimeoutMs (openclaw#107996)
  ...

# Conflicts:
#	extensions/openai/realtime-quicksilver-wire.ts
vincentkoc added a commit to nvtoroy/openclaw that referenced this pull request Jul 29, 2026
* origin/main: (683 commits)
  fix(discord): bound webhook send body reads (openclaw#109076)
  fix(ui): preserve initials for missing user avatars (openclaw#115976)
  feat(ui): add provider icons to coding catalogs (openclaw#115956)
  fix(daemon): refuse duplicate launchd gateway managers (openclaw#97285)
  fix(memory-lancedb): share the recall cooldown with the auto-recall prompt-build hook (openclaw#112927)
  fix(test): isolate plugin install fixtures (openclaw#116008)
  fix(feishu): guard Object.assign against prototype pollution in webhook payload merge (openclaw#111729)
  fix(sms): isolate validated webhook quotas per sender (openclaw#104862)
  fix(sessions): recover deleted chats without endless retries (openclaw#115974)
  fix(restart): log errors from restart hook callbacks instead of swallowing (openclaw#108847)
  feat(ui): enable tool-loop detection from Labs (openclaw#115983)
  fix(telegram): catch unhandled rejections in webhook and ingress worker shutdown (openclaw#100998)
  fix(memory): keep rollbacks compatible after recall metadata upgrade (openclaw#116003)
  fix(ui): derive cron timezone suggestions (openclaw#115973)
  fix(scripts): bound dependency pin git lookups (openclaw#110570)
  fix(skills): preserve configless workshop apply upgrades (openclaw#115982)
  fix(gateway): cancel unread cron webhook bodies before SSRF release (openclaw#111236)
  fix(voice-call): pin Twilio webhook verification to the configured public path (openclaw#112800)
  fix(memory): make legacy session backfill rollback re-applicable (openclaw#116004)
  fix(security): fence external hook job name in isolated-agent prompts (openclaw#112501)
  ...

# Conflicts:
#	CHANGELOG.md
#	src/agents/tool-search-catalog.ts
#	src/agents/tool-search.test-support.ts
#	src/agents/tool-search.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
…blic path (openclaw#112800)

* fix(voice-call): pin Twilio webhook verification to the configured public path

buildTwilioVerificationUrl overwrote the configured publicUrl path with the
incoming request path, so behind a path-rewriting reverse proxy the
reconstructed verification URL no longer matched the URL Twilio signed and
valid webhooks were rejected. Use the configured public path (keep the request
query), mirroring the Plivo sibling fixed in openclaw#112559. Restores callback-path
binding and adds proxy-prefix accept + local-path reject regression tests.

* fix(voice-call): pin Twilio verification to public URL path

---------

Co-authored-by: Vincent Koc <[email protected]>
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 docs Improvements or additions to documentation 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. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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