Repository navigation
fix(voice-call): redact credential material from provider error bodies - #117304
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 7, 2026, 6:49 PM ET / 22:49 UTC. ClawSweeper reviewWhat this changesThe PR redacts sensitive content from bounded voice-call provider error responses and adds a regression test for reflected Basic credentials and API-key parameters. Merge readiness✅ Ready for maintainer review Keep this PR open for landing: current main still surfaces raw voice-call provider error text, while the patch applies the supported shared redaction contract at the boundary used by all three providers. No actionable patch finding was found. Priority: P1 Review scores
Verification
How this fits togetherVoice-call providers make authenticated REST requests through shared helpers. On failure, the shared response reader supplies bounded provider text to thrown diagnostics used by callers and logs. flowchart LR
A[Voice-call providers] --> B[Authenticated REST request]
B --> C[Non-success provider response]
C --> D[Shared bounded response reader]
D --> E[Sensitive-text redaction]
E --> F[Provider diagnostic error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +36. Total +41 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Land the shared-reader redaction so all Twilio, Telnyx, and Plivo error paths retain useful bounded diagnostics without retaining reflected credentials. Do we have a high-confidence way to reproduce the issue? Yes: on current main, a non-2xx response body is returned verbatim and interpolated into a thrown error; a local HTTP endpoint that reflects an Authorization value exercises the path described in the PR proof. Is this the best way to solve the issue? Yes: redacting once at the shared bounded response-reader boundary covers every voice-call provider consumer without losing status or non-sensitive provider diagnostics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e8da40010a33. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
Bind bounded error diagnostics to the actual outgoing request headers for shared web tools and both Perplexity transports. Preserve caller cancellation and replace case-insensitive owned headers without combining credentials. Reuse the provider error redactor and remove duplicate xAI parser-only test paths while retaining real HTTP and sibling coverage. Production -18 lines; total -14 lines including regression tests and documentation. Refs openclaw#120200, openclaw#117304, openclaw#119536. Co-authored-by: zenglingbiao <[email protected]>
…and reason phrase (#120200) * fix(web): redact request credentials from provider errors Bind bounded error diagnostics to the actual outgoing request headers for shared web tools and both Perplexity transports. Preserve caller cancellation and replace case-insensitive owned headers without combining credentials. Reuse the provider error redactor and remove duplicate xAI parser-only test paths while retaining real HTTP and sibling coverage. Production -18 lines; total -14 lines including regression tests and documentation. Refs #120200, #117304, #119536. Co-authored-by: zenglingbiao <[email protected]> * fix(tooling): install managed signals before spawning children Prevent early SIGTERM from orphaning a detached compiler before its supervisor registers the child. Retain shared handlers for concurrent commands and clean them up after synchronous or asynchronous spawn failure. Reproduce the race at the real process boundary and consolidate stale type comments and one-use registration wrappers. --------- Co-authored-by: Peter Steinberger <[email protected]>
…and reason phrase (openclaw#120200) * fix(web): redact request credentials from provider errors Bind bounded error diagnostics to the actual outgoing request headers for shared web tools and both Perplexity transports. Preserve caller cancellation and replace case-insensitive owned headers without combining credentials. Reuse the provider error redactor and remove duplicate xAI parser-only test paths while retaining real HTTP and sibling coverage. Production -18 lines; total -14 lines including regression tests and documentation. Refs openclaw#120200, openclaw#117304, openclaw#119536. Co-authored-by: zenglingbiao <[email protected]> * fix(tooling): install managed signals before spawning children Prevent early SIGTERM from orphaning a detached compiler before its supervisor registers the child. Retain shared handlers for concurrent commands and clean them up after synchronous or asynchronous spawn failure. Reproduce the race at the real process boundary and consolidate stale type comments and one-use registration wrappers. --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
Redact credential-bearing content from voice-call provider error bodies before they reach thrown error messages, so Twilio/Telnyx/Plivo REST failures cannot leak Authorization headers, API keys, or tokens into logs and user-facing diagnostics.
What Problem This Solves
All three voice-call telephony providers (Twilio, Telnyx, Plivo) send authenticated REST requests through the shared client
guardedJsonApiRequest(extensions/voice-call/src/providers/shared/guarded-json-api.ts:48), each carrying anAuthorizationheader with account credentials (Twilio/Plivo:Basic base64(authId:authToken), Telnyx:Bearer <apiKey>).When the provider answers non-2xx, the client throws
new Error(${errorPrefix}: ${status} ${errorText})whereerrorTextis the raw provider response body. Provider error bodies frequently echo request details — the Authorization header value, account identifiers, signed URLs, or the offendingapi_keyparameter — and that body flowed unredacted intoError.message, gateway logs, and user-facing error surfaces. This is the same shape as the Discord REST credential leak fixed in #116805.Code evidence:
readProviderErrorResponseSnippetinextensions/voice-call/src/providers/shared/response-body.tsreturned the bounded body text verbatim; the throw site atguarded-json-api.ts:48embedded it directly into the error.Root Cause
api_key=query parameters, signed media URLs).Why This Fix
readProviderErrorResponseSnippetwith the repo-standardredactSensitiveText, forced totoolsmode so redaction cannot be switched off by logging config. One change at the shared choke point covers Twilio, Telnyx, and Plivo uniformly.User Impact
***).Evidence
Authorization: Basic …header and anapi_key=…parameter → the thrown error message contains both secrets verbatim → FAILapi_key=***→ PASSReal Behavior Proof
Before (on main)
$ node --import tsx proof.mjs caught provider error message: Twilio API error: 401 {"message":"Authentication failed","detail":"Authorization: Basic QUMxMjM6c3VwZXItc2VjcmV0LWF1dGgtdG9rZW4 rejected; retry with api_key=sk-live-1234567890abcdef"} FAIL: error message leaks credential materialAfter (with fix)
$ node --import tsx proof.mjs caught provider error message: Twilio API error: 401 {"message":"Authentication failed","detail":"Authorization: Basic QUMxMj…rZW4 rejected; retry with api_key=***"} PASS: credential material redacted from error messageTests and Validation
pnpm checkpassedextensions/voice-call/src/providers/shared/guarded-json-api.test.ts: a 401 body echoing the Basic credential and anapi_keyparameter must surface with both masked; all 8 cases in that file pass