fix(talk): do not follow HTTP redirects on SDP POST - #32
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 7, 2026, 3:16 PM ET / 19:16 UTC. ClawSweeper reviewWhat this changesThe PR disables redirects for Talk’s authenticated SDP POST and adds mocked regression checks plus a source-checking CI test. Merge readiness⛔ Blocked before merge - 7 items remain The hardening remains necessary on main, but this branch introduces two test-suite defects and still lacks proof through the real ESP-IDF HTTP client. Priority: P2 Review scores
Verification
How this fits togetherTalk connects ESP firmware to Gateway-managed voice sessions. It receives an offer URL and single-use token from the Gateway, posts local session-description data, and passes the returned answer to WebRTC. flowchart LR
A[Gateway session response] --> B[Offer URL and token]
C[Local WebRTC offer] --> D[Authenticated HTTP POST]
B --> D
D --> E{HTTP response}
E -->|Redirect or error| F[Fail exchange]
E -->|Valid SDP answer| G[WebRTC signaling]
Decision needed
Why: This narrows credential forwarding but intentionally removes an existing transport behavior; source inspection cannot establish whether deployed proxies depend on it. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep credentials confined to the configured offer endpoint, with approved redirect-rejection semantics, documented proxy configuration, and real-client proof for direct success and redirected failure. Do we have a high-confidence way to reproduce the issue? Yes, source inspection establishes both test defects: the selected host struct lacks the new field, and begin_signaling clears preconfigured failure injection. No tests or real-client reproduction were executed during this read-only review. Is this the best way to solve the issue? The production flag is a narrow, supported way to prevent redirect forwarding, but the complete patch is not ready: its test integration needs repair and its compatibility contract needs approval. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 3294af3aaa94. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
exchange_sdp sends Authorization: Bearer <clientSecret> and left disable_auto_redirect unset. ESP-IDF follows 3xx by default, so a Location hop can send the broker secret off the offer host. Set disable_auto_redirect so the exchange fails closed on 3xx. Replayed onto upstream/main 3294af3. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
c84b574 to
d4d3002
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Talk signaling POSTs the local SDP to the Gateway broker
offerUrlwithAuthorization: Bearer <clientSecret>.exchange_sdpnever setdisable_auto_redirecton thatesp_http_client. ESP-IDF follows 3xx by default and keeps request headers, so aLocationhop can send the single-use broker secret (and the SDP body) off the offer host.This PR sets
disable_auto_redirect = trueon that client only. A 3xx response fails the exchange (status >= 300) instead of following. Canvas image GET already chooses its own redirect policy and does not send this Bearer token.Evidence
Unfixed
exchange_sdponupstream/mainhas no redirect flag next to the Bearer POST:Host compile of the new check against that unfixed file fails (expected):
Same binary against the patched source passes, and the config now pins the flag:
Live IDF-model hop (copy Authorization onto
Location, which is what ESP-IDF does when auto-redirect stays on):Node
fetchon the same 302 pair follows but drops Authorization (Fetch cross-origin policy). ESP-IDF does not do that drop, which is why the firmware flag is required:Real behavior proof
Authorization: Bearer <clientSecret>.ccApple clang, Node v22, worktree/tmp/oc-pr-esp-F003onfix/talk-sdp-no-redirectfromupstream/main6f5c8e8.cc -std=c11 -Wall -Wextra -Werror components/esp-openclaw-talk/tests/test_talk_sdp_http_redirect.c -o /tmp/talk_sdp_http_redirect_testthen
/tmp/talk_sdp_http_redirect_teston the unfixedgit showdump and on the patched sourcethen
ccof/tmp/sdp-redirect-idf-demo.cwithfollowandnofollowthen
node /tmp/sdp-redirect-demo.mjsexchange_sdpconfig contains.disable_auto_redirect = true. The host check fails onupstream/mainand passes on the patched file. The IDF-model client sends the Bearer token to the hop only when following is allowed.exchange_sdpalready rejectsstatus >= 300, so a 302 now ends the exchange on the offer host.offerUrl.Summary
exchange_sdp(Talk signaling send path) POSTs SDP with the brokerclientSecretand left ESP-IDF's default redirect-follow on. That can leak the secret to aLocationhost. This change setsdisable_auto_redirect = trueon that client only.Introduced in
a1b324ad(#5, 2026-07-29). Present for 31 days.Same-repo open PRs #28 and #31 are different findings (destroy timeout;
make_parents_safelywalk). No open PR already sets this flag.Related prior art (same class: credentials must not ride a redirect hop):
Authorizationon cross-origin redirect)esp_http_client_config_t.disable_auto_redirect(fail closed instead of following)