fix(chutes): redact OAuth error response body#103569
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 9:21 AM ET / 13:21 UTC. Summary PR surface: Source +6, Tests 0. Total +6 across 2 files. Reproducibility: yes. Current main directly places bounded but unredacted non-2xx response text into both Chutes OAuth error messages, and the focused flow tests reach both branches. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch and land the existing shared-helper integration after normal auth/security-owner review, preserving the current timeout, bounded-read, cancellation, structured-detail, and redaction behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current main directly places bounded but unredacted non-2xx response text into both Chutes OAuth error messages, and the focused flow tests reach both branches. Is this the best way to solve the issue? Yes. Reusing the existing provider HTTP error parser is the narrowest maintainable fix because it centralizes bounded reads, cancellation, structured OAuth parsing, and redaction instead of adding a Chutes-specific security path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 328eaa3a23d6. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +6, Tests 0. Total +6 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
Review history (1 earlier review cycle)
|
66102d3 to
48da7d2
Compare
|
@clawsweeper re-review Rebased on latest main, resolved merge conflict on import block (retained |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
116408c to
23cf0a5
Compare
…efresh Replace readResponseTextLimited + raw body in error message with extractProviderErrorDetail for bounded, redacted structured error detail. Ref: openclaw#102953
…RROR_BODY_LIMIT_BYTES
23cf0a5 to
e01da19
Compare
|
Land-ready maintainer proof for
Known proof gaps: none for the changed failure path. A successful real-user OAuth grant was intentionally not attempted because it requires user credentials and does not exercise this non-2xx handling change. |
|
Merged via squash.
|
Verify that extractProviderErrorDetail bounds and redacts secrets in error responses — matching the maintainer-upgraded pattern in the merged chutes OAuth fix (openclaw#103569).
Same pattern as the exchange path and the merged chutes OAuth fix (openclaw#103569).
Verify that assertOkOrThrowProviderError bounds and redacts secrets in error responses — matching the merged pattern in openclaw#103569.
Same pattern as the exchange path and the merged chutes OAuth fix (openclaw#103569).
* fix(chutes): redact OAuth error response body in token exchange and refresh Replace readResponseTextLimited + raw body in error message with extractProviderErrorDetail for bounded, redacted structured error detail. Ref: openclaw#102953 * fix(chutes): update test assertions for extractProviderErrorDetail message format * fix(chutes): remove unused readResponseTextLimited and CHUTES_OAUTH_ERROR_BODY_LIMIT_BYTES * fix(chutes): normalize OAuth HTTP failures * test(chutes): assert redaction without fixed mask --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Chutes OAuth token failures were read under a byte limit but then embedded as raw provider response text. The submitted patch addressed the legacy/core token code, while the canonical bundled Chutes plugin login path still had the same disclosure risk.
Why This Change Was Made
Route all three Chutes token operations through the existing
assertOkOrThrowProviderErrorboundary:The shared boundary caps response reads, cancels oversized bodies, preserves HTTP/OAuth diagnostics, and stores only bounded redacted metadata. Regression tests cover structured OAuth JSON and oversized plain-text failures without calling
response.text().User Impact
Failed Chutes sign-in and refresh attempts retain actionable status and OAuth failure detail without exposing complete response bodies or credential-bearing text in thrown messages.
Evidence
e01da19e04a8fcc91a5f10ac869ef97a34f244a7cbx_97a094e99424, public network, no Tailscale): 30/30 focused tests passed andpnpm check:changedcompleted across core/plugin typecheck, lint, and guards in runrun_d4e1bc01837d. The run's final status reflects an initially over-strict live-proof assertion about optional OAuth metadata, not a code-gate failure.run_5cfabe9f9f53exercised the production bundled-plugin exchange and core refresh paths againsthttps://api.chutes.ai/idp/token; both returned normalized HTTP 400 failures with OAuth detail preserved, submitted values absent, and no raw JSON in the message.overall: patch is correct, confidence 0.86).Changed surface
@clawsweeper re-review