fix(browser): accept query-param token on relay /json endpoints#26015
Closed
Sid-Qin wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(browser): accept query-param token on relay /json endpoints#26015Sid-Qin wants to merge 1 commit intoopenclaw:mainfrom
Sid-Qin wants to merge 1 commit intoopenclaw:mainfrom
Conversation
The /json path auth guard only checked the x-openclaw-relay-token header, while the WebSocket endpoints (/extension, /cdp) also accepted ?token= query params via getRelayAuthTokenFromRequest. Use the same helper for /json so curl and browser clients can authenticate via either mechanism. Closes openclaw#25928 Co-authored-by: Cursor <[email protected]>
This was referenced Feb 25, 2026
steipete
added a commit
that referenced
this pull request
Feb 26, 2026
Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR #26015). Co-authored-by: SidQin-cyber <[email protected]>
Contributor
|
Landed on What I changed while landing:
SHA mapping:
Thanks for the fix, @Sid-Qin. |
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Feb 27, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
wanjizheng
pushed a commit
to wanjizheng/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 9b0cafc)
vincentkoc
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
vincentkoc
pushed a commit
to rylena/rylen-openclaw
that referenced
this pull request
Feb 28, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
steipete
added a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
thebenjaminlee
pushed a commit
to escape-velocity-ventures/openclaw
that referenced
this pull request
Mar 7, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]>
alexey-pelykh
pushed a commit
to remoteclaw/remoteclaw
that referenced
this pull request
Mar 12, 2026
… routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 42cf32c)
alexey-pelykh
added a commit
to remoteclaw/remoteclaw
that referenced
this pull request
Mar 12, 2026
… auth for /json relay routes (#1108) * fix(browser): land PR openclaw#26015 query-token auth for /json relay routes Align relay HTTP /json auth with websocket auth by accepting query-param tokens, add regression coverage, and update changelog. Landed from contributor @Sid-Qin (PR openclaw#26015). Co-authored-by: SidQin-cyber <[email protected]> (cherry picked from commit 42cf32c) * fix: adapt cherry-pick to rebranded relay-token header name The cherry-picked test used x-openclaw-relay-token but the fork has rebranded this header to x-remoteclaw-relay-token. --------- Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: SidQin-cyber <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/jsonpath auth guard only checks thex-openclaw-relay-tokenheader, while WebSocket endpoints (/extension,/cdp) also accept?token=query params. This causes all/json/versionrequests via curl or browser to get HTTP 401 if they use query-param auth./json/versionor/json/listunless they set the custom header — breaking curl-based debugging and some Chrome DevTools clients.getRelayAuthTokenFromRequest(req, url)which checks both the header and URL query param — the same helper already used by WebSocket endpoints.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
curl http://127.0.0.1:18792/json/version?token=<relay-token>now returns 200 instead of 401.Security Impact (required)
Repro + Verification
Steps
curl -s "http://127.0.0.1:18792/json/version?token=<relay-token>"Evidence
extension-relay.test.ts.Human Verification (required)
Compatibility / Migration
Failure Recovery (if this breaks)
src/browser/extension-relay.tsRisks and Mitigations
None — strictly additive; query-param auth was already supported on WS endpoints.
Greptile Summary
Made the
/jsonendpoint auth guard consistent with WebSocket endpoints by accepting both header and query-param tokens. Previously,/json/versionand/json/listonly accepted authentication via HTTP header, while/extensionand/cdpWebSocket endpoints accepted both header and query-string authentication. This inconsistency broke curl-based debugging and some Chrome DevTools clients that rely on query-param authentication.getRelayAuthTokenFromRequest(req, url)helper atsrc/browser/extension-relay.ts:370/jsonendpointsConfidence Score: 5/5
Last reviewed commit: b0f7167