Skip to content

fix: pin Plivo callback URLs to public webhook path [AI] - #112559

Merged
pgondhi987 merged 2 commits into
openclaw:mainfrom
pgondhi987:fix/fix-871
Jul 22, 2026
Merged

pgondhi987 merged 2 commits into
openclaw:mainfrom
pgondhi987:fix/fix-871

Conversation

@pgondhi987

@pgondhi987 pgondhi987 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Plivo voice-call callbacks could reuse an accepted request path when building later call-control callback URLs, even when operators configured a public webhook URL with the intended path.

Why This Change Was Made

The Plivo provider now treats publicUrl as the trusted callback path for both stored callback bases and webhook signature URL construction. Per-call query parameters still come from the incoming callback so existing Plivo answer, speech, and listen flows can continue to route normally.

User Impact

Operators using a configured Plivo public webhook URL get stable follow-up Plivo callback URLs on that configured path. Host, auth, config, storage, provider selection, and non-Plivo voice-call behavior are unchanged.

Evidence

  • node scripts/run-vitest.mjs extensions/voice-call/src/providers/plivo.test.ts extensions/voice-call/src/webhook-security.test.ts
  • Result: 2 test files passed, 35 tests passed.

AI-assisted.

@pgondhi987 pgondhi987 added channel: voice-call Channel integration: voice-call maintainer Maintainer-authored PR size: S labels Jul 22, 2026
@pgondhi987

Copy link
Copy Markdown
Contributor Author

clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: pin Plivo callback URLs to public webhook path [AI] This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

ClawSweeper proof for current head fc2dabd726a28d7cdc8c7ddeb3510d6d0daa2ce1

Behavior proved: Plivo callback handling keeps the configured public webhook path as the trusted path for verification and later call-control transfer URLs.

Environment: local PR checkout using the real Plivo provider and webhook verifier; outbound Plivo API call was stubbed so no live provider credentials or external phone call were used. GitHub Actions CI reruns are green for the same head.

Command/artifact:

  • node scripts/run-vitest.mjs extensions/voice-call/src/providers/plivo.test.ts extensions/voice-call/src/webhook-security.test.ts
  • node --import tsx --eval '<local production-adapter proof>' | tee /tmp/behavior-proof-871.json
  • GitHub Actions reruns: CI and Workflow Sanity completed successfully for fc2dabd726a28d7cdc8c7ddeb3510d6d0daa2ce1.

Evidence:

  • fixed/denied: a V3-signed callback for /admin returned verificationOk=false; the verifier used https://voice.openclaw.ai/voice/webhook?flow=answer&callId=internal-call-id; protected sink/source result: no provider API call used or exposed the alternate /admin callback path, and the captured Plivo transfer URL was https://voice.openclaw.ai/voice/webhook?provider=plivo&flow=xml-speak&callId=internal-call-id.
  • control: a V3-signed callback for /voice/webhook returned verificationOk=true with version=v3; intended behavior still works: the provider issued a stubbed POST /Call/call-uuid/ transfer operation.
  • focused tests: 2 files passed, 35 tests passed.

Compatibility/operator note: this changes only Plivo publicUrl path handling. Auth, provider selection, config schema, storage, non-Plivo providers, and outbound Plivo API host allowlisting are unchanged.

Live gaps: no live Plivo credentials or public phone-call callback were available in this environment, so the external Plivo service was represented by a stub at the API boundary while the OpenClaw provider and verifier code paths were real.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Verification before merge:

Behavior addressed: Plivo callback handling now keeps the configured public webhook path as the trusted path for verification and later call-control transfer URLs.
Real environment tested: local PR checkout, GitHub Actions PR CI reruns, and local ClawSweeper proof review for head fc2dabd726a28d7cdc8c7ddeb3510d6d0daa2ce1.
Exact steps or command run after this patch:

  • node scripts/run-vitest.mjs extensions/voice-call/src/providers/plivo.test.ts extensions/voice-call/src/webhook-security.test.ts
  • node --import tsx --eval '<local production-adapter proof>' | tee /tmp/behavior-proof-871.json
  • local ClawSweeper source review helper for PR 112559
  • local ClawSweeper proof review helper with /tmp/clawsweeper-proof-871.md
  • validation dry-run: passed
  • final validation gate: passed
    Evidence after fix:
  • Focused Vitest passed: 2 files, 35 tests.
  • Production-adapter proof passed: V3-signed /admin callback returned verificationOk=false, no provider API call used /admin, and the captured transfer URL stayed on /voice/webhook.
  • Positive control passed: V3-signed /voice/webhook callback returned verificationOk=true, and the provider issued a stubbed POST /Call/call-uuid/ transfer operation.
  • review-pr status: passed for fc2dabd726a28d7cdc8c7ddeb3510d6d0daa2ce1.
  • autoreview status: Claude autoreview passed for fc2dabd726a28d7cdc8c7ddeb3510d6d0daa2ce1.
  • ClawSweeper source/proof status: local source review clean; local proof review clean with no findings.
  • CI status: initial checkout/fetch transient failures were rerun; CI and Workflow Sanity completed successfully for the same head.
    Observed result after fix: alternate request path data no longer changes the trusted Plivo callback path, while the intended configured-path Plivo flow still works.
    What was not tested: no live Plivo credentials or public phone-call callback were available, so the external Plivo service was represented by a stub at the provider API boundary.

Regression Risk:
Low. The changed boundary is Plivo publicUrl path handling in the voice-call plugin. The patch does not change auth, provider selection, config schema, storage, migrations, non-Plivo providers, or outbound Plivo API host allowlisting; the main compatibility effect is that deployments must use the configured public webhook path instead of relying on request-path rewriting.

Best fix verdict: best. The fix is at the Plivo provider/verifier boundary where the trusted callback path is derived, which avoids adding broader server routing policy or a runtime fallback that would preserve the same path-confusion behavior.

User behavior change:
Before, a Plivo request accepted on a different path could influence later Plivo callback URLs when publicUrl was configured. After, Plivo follow-up callback URLs use the configured public webhook path; query parameters for flow and call routing still work, and other voice-call providers are unchanged.

@pgondhi987

pgondhi987 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review: needs maintainer review before merge. Reviewed July 22, 2026, 12:23 PM UTC.

Summary
Keep this PR open for maintainer merge handling: current main still has the Plivo path-reuse behavior, and the patch is a focused fix with matching regression coverage and proof. The only merge-visible question is the intentional exact-path publicUrl compatibility tradeoff for existing Plivo operators.

PR surface: Source -3, Tests +80. Total +77 across 4 files.

Reproducibility: Yes, source inspection gives a high-confidence reproduction path: current main copies the request pathname over configured Plivo publicUrl in both callback-base storage and signature verification. The new tests model the alternate-path case, though I did not run them in this read-only review.

Review metrics:

  • Plivo publicUrl path uses: 2 tightened - Both signature verification and stored call-control callback bases now keep the configured path, which is the compatibility-relevant behavior change.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: needs maintainer review before merge.

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

Risk before merge

  • [P0] Merging intentionally tightens Plivo publicUrl path semantics: operators whose Plivo console or proxy path differs from configured publicUrl may see callback verification fail or follow-up transfer callbacks use the configured path instead of the incoming request path.

Maintainer decision needed

  • Question: Should this PR intentionally enforce the configured Plivo publicUrl path for verification and transfer callbacks even if mismatched existing operator setups fail closed after upgrade?
  • Rationale: The patch fixes a security-sensitive path trust bug, but it also tightens behavior that current users with mismatched Plivo callback paths may have been relying on despite the documented exact-path contract.
  • Likely owner: steipete - steipete has the strongest recent history across voice-call webhook hardening, docs, and operator-facing contracts.
    Options:
  1. Accept exact-path contract (recommended)
    Land this security fix and treat any mismatched Plivo provider-console or proxy path as operator configuration that must be corrected to match publicUrl.
  2. Add transitional diagnostics
    Before merge, add a targeted warning or troubleshooting note for Plivo path mismatches while keeping the stricter runtime behavior.

Next step before merge

  • Record maintainer acceptance of the exact-path Plivo publicUrl behavior before merge.

Security
Cleared: The diff is bounded Plivo webhook hardening and introduces no dependency, workflow, credential, or supply-chain changes.

Review details

Best possible solution:

Land the focused Plivo fix after maintainer acknowledgement that publicUrl is an exact scheme/host/path contract; no config migration appears needed because docs already require that match.

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

Yes, source inspection gives a high-confidence reproduction path: current main copies the request pathname over configured Plivo publicUrl in both callback-base storage and signature verification. The new tests model the alternate-path case, though I did not run them in this read-only review.

Is this the best way to solve the issue?

Yes, this is the best narrow fix: both the verifier and later Plivo transfer URL builder need the same configured-path invariant. A host-only allowlist or verifier-only change would leave path drift in one side of the call-control flow.

AGENTS.md: found_applied

Codex review notes: model internal, reasoning high; reviewed against 74de1a2.

Label details

Label justifications:

  • P0: The PR fixes a Plivo webhook signature/callback path security boundary tied to GHSA tracking context.
  • merge-risk: 🚨 compatibility: Existing Plivo setups with provider callback paths that differ from configured publicUrl can fail closed after this stricter path handling lands.
Evidence reviewed

PR surface:

Area Files Added Removed Net
Source 2 0 3 -3
Tests 2 80 0 +80
Docs 0 0 0 +0
Config 0 0 0 +0
Generated 0 0 0 +0
Other 0 0 0 +0
Total 4 80 3 +77

@pgondhi987
pgondhi987 merged commit 5c9d59a into openclaw:main Jul 22, 2026
27 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 23, 2026
vincentkoc added a commit that referenced this pull request Jul 29, 2026
…blic path (#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 #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]>
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 maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant