Skip to content

fix(twilio): redact webhook turnToken diagnostics - #102089

Merged
steipete merged 3 commits into
openclaw:mainfrom
Alix-007:alix/twilio-turn-token-redact
Jul 9, 2026
Merged

steipete merged 3 commits into
openclaw:mainfrom
Alix-007:alix/twilio-turn-token-redact

Conversation

@Alix-007

@Alix-007 Alix-007 commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Twilio signature failures included the full verification URL in diagnostics. Because Twilio signs the exact callback URL, including query parameters, that URL can contain turnToken or other sensitive callback state. The provider also logged the same URL twice.

Why This Change Was Made

The maintainer rewrite keeps signature verification and diagnostic rendering as separate contracts:

  • verification still uses the original exact URL and form parameters required by Twilio;
  • valid, query-bearing signed requests retain the original verified URL on the success result;
  • failed results contain only a sanitized diagnostic URL: username, password, fragment, and every query value are redacted;
  • malformed configured URLs use a fixed <invalid verification URL> placeholder rather than a regex fallback that could echo secrets;
  • the Twilio adapter emits one actionable verification warning instead of logging the URL a second time.

This is the bounded fix at the webhook-security owner boundary. It does not change Twilio signature inputs, webhook routing, call state, or provider configuration.

User Impact

Failed Twilio webhook diagnostics remain useful without exposing callback tokens or other URL values in logs. Valid signatures, including signatures over callback URLs with query parameters, continue to pass unchanged.

Evidence

  • Official Twilio webhook-security documentation confirms signature validation uses the exact request URL and parameters: https://www.twilio.com/docs/usage/webhooks/webhooks-security
  • Sanitized public-network AWS Crabbox proof on exact SHA d36fb89f479389490be907bb60b2b4773ecf4203; no Tailscale, instance profile, or hydrated credentials.
  • Crabbox run_c43be9d22666: focused webhook-security and Twilio provider suites, 2 files / 56 tests passed.
  • Crabbox run_9160006a7c56: extension/test typechecks, lint, and changed-file repository guards passed.
  • Source-blind behavior contract: 5 passed, 0 failed, 0 blocked (valid exact URL, fail-closed behavior, secret redaction, one warning, malformed-URL placeholder).
  • Fresh autoreview: clean after two repair cycles; correctness 0.95.
  • git diff --check: clean.

The root changelog is release-owned. Release-note context and contributor credit are retained here for @Alix-007.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: S labels Jul 8, 2026
@clawsweeper

clawsweeper Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 6:07 AM ET / 10:07 UTC.

Summary
The PR redacts failed Twilio webhook verification URL diagnostics, removes the extra Twilio verification URL warning, and adds focused tests for redacted failure output and preserved success verification URLs.

PR surface: Source +12, Tests +80. Total +92 across 4 files.

Reproducibility: yes. Source inspection of current main shows invalid Twilio signatures return and log the unredacted verification URL, and the PR body provides live adapter output for the redacted failure path.

Review metrics: none identified.

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] The PR is mergeable but behind current main, so maintainers should use a fresh exact-head gate or rebase before landing.

Maintainer options:

  1. Decide the mitigation before merge
    Land the diagnostic-only redaction after exact-head maintainer handling, keeping original URLs for Twilio signature verification and replay keys while redacting failed diagnostic output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is indicated; the PR has no blocking findings and should stay in ordinary maintainer merge handling.

Security
Cleared: No security or supply-chain regression was found; the diff reduces sensitive diagnostic exposure without changing dependencies, workflows, permissions, signature inputs, or credential handling.

Review details

Best possible solution:

Land the diagnostic-only redaction after exact-head maintainer handling, keeping original URLs for Twilio signature verification and replay keys while redacting failed diagnostic output.

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

Yes. Source inspection of current main shows invalid Twilio signatures return and log the unredacted verification URL, and the PR body provides live adapter output for the redacted failure path.

Is this the best way to solve the issue?

Yes. Redacting only after all signature and replay checks fail keeps Twilio verification on the original URL while preventing failed diagnostics from exposing query values.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: The PR fixes a narrow Twilio failed-diagnostic token exposure with limited blast radius and no broad runtime regression evidence.
  • 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 (live_output): The PR body includes live output from the exported Twilio provider verification adapter showing invalid verification still fails closed while warning output and the returned reason redact turnToken.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes live output from the exported Twilio provider verification adapter showing invalid verification still fails closed while warning output and the returned reason redact turnToken.
Evidence reviewed

PR surface:

Source +12, Tests +80. Total +92 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 18 6 +12
Tests 2 86 6 +80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 104 12 +92

What I checked:

Likely related people:

  • steipete: Peter Steinberger restored voice-call plugin parity, added query handling and hardening in Twilio webhook verification, and authored the PR head commit that contains the current diagnostic containment shape. (role: feature-history owner and recent PR head contributor; confidence: high; commits: 42c17adb5e4d, fa1079214b90, 97200984f818; files: extensions/voice-call/src/webhook-security.ts, extensions/voice-call/src/providers/twilio.ts, extensions/voice-call/src/providers/twilio/webhook.ts)
  • vincentkoc: The live PR is assigned to vincentkoc, and recent history shows Vincent Koc touching the same voice-call and extension boundary surfaces. (role: current assignee and recent area contributor; confidence: medium; commits: e085fa1a3ffd, 4a275cf6b1c6; files: extensions/voice-call/src/webhook-security.ts, extensions/voice-call/src/providers/twilio.ts, extensions/voice-call/src/providers/twilio/webhook.ts)
  • Harjoth Khara: Current-main blame for the Twilio verification function and adapter points at commit 85aa26d, though that commit appears broad and not specifically a Twilio diagnostics ownership signal. (role: recent current-line carrier; confidence: low; commits: 85aa26d34f8b; files: extensions/voice-call/src/webhook-security.ts, extensions/voice-call/src/providers/twilio.ts, extensions/voice-call/src/providers/twilio/webhook.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 (6 earlier review cycles)
  • reviewed 2026-07-08T07:28:26.421Z sha 725797a8b5f6f0e66d1ab7de7d007a52a4c9d79f :: needs maintainer review before merge. :: none
  • reviewed 2026-07-08T07:44:55.873Z sha 8b369674d77f80dc678eef59dc7b79811bb78ef3 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T06:35:33.115Z sha 7da61af09408d2427cd42401150536ec5e46c6f8 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T08:38:36.219Z sha 791819e57a82c2f9073a418dd9945233363b6cb6 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T08:46:52.932Z sha 791819e57a82c2f9073a418dd9945233363b6cb6 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T09:25:12.398Z sha 70a5c9e08c20249d1701aa7ea418a6cd95814db0 :: needs maintainer review before merge. :: none

@vincentkoc vincentkoc self-assigned this Jul 8, 2026
@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. P2 Normal backlog priority with limited blast radius. labels Jul 8, 2026
@steipete
steipete force-pushed the alix/twilio-turn-token-redact branch from 70a5c9e to d36fb89 Compare July 9, 2026 09:58
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Land-ready after maintainer rewrite and native prepare validation.

What changed:

  • kept Twilio verification on the exact callback URL and form parameters;
  • limited the original verification URL to successful results;
  • redacted every query value, URL username/password, and fragment in failure diagnostics;
  • replaced malformed-URL fallback echoing with a fixed placeholder;
  • removed the provider's duplicate verification-URL warning.

Evidence:

  • sanitized public-network AWS Crabbox on exact SHA d36fb89f479389490be907bb60b2b4773ecf4203, with no Tailscale, instance profile, or hydrated credentials;
  • run_c43be9d22666: 2 focused files / 56 tests passed;
  • run_9160006a7c56: extension/test typechecks, lint, and changed guards passed;
  • source-blind behavior contract: 5 passed, 0 failed, 0 blocked;
  • fresh autoreview: clean, correctness 0.95;
  • exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/29010013343;
  • native review-validate-artifacts and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 102089: passed.

No webhook configuration, routing, or signature contract changed.

@steipete
steipete merged commit b37476a into openclaw:main Jul 9, 2026
103 checks passed
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 10, 2026
* fix(twilio): redact webhook turnToken diagnostics

* chore(twilio): rerun ci

* fix(twilio): contain webhook URL diagnostics

Co-authored-by: Alix-007 <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
* fix(twilio): redact webhook turnToken diagnostics

* chore(twilio): rerun ci

* fix(twilio): contain webhook URL diagnostics

Co-authored-by: Alix-007 <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit b37476a)
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: 🦞 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.

3 participants