Fix custom scheme origin allowlist matching#94132
Conversation
|
I noticed #73511 addresses the same root cause. I’m happy for maintainers to merge whichever PR they prefer. I opened this one because I had live ClawControl proof for app://localhost and added focused validation. |
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 8:20 AM ET / 12:20 UTC. Summary PR surface: Source +13, Tests +27. Total +40 across 2 files. Reproducibility: yes. Current source compares configured entries against Review metrics: 1 noteworthy metric.
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:
Proof guidance:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this or an equivalent current-main parser fix after redacted Gateway proof and clean relevant checks, preserving exact allowlist semantics while rejecting literal, malformed, and unlisted custom origins. Do we have a high-confidence way to reproduce the issue? Yes. Current source compares configured entries against Is this the best way to solve the issue? Yes for the parser layer, with merge-readiness caveats. Reconstructing only hosted opaque origins is narrower than wildcard, config, or Host-header policy changes, but the PR still needs redacted Gateway proof and clean relevant checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against af2b0a6118bc. Label changesLabel justifications:
Evidence reviewedPR surface: Source +13, Tests +27. Total +40 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
|
|
Superseded by #38290, landed as fa0349a. The landed fix preserves the same exact-match behavior for Verification covered 146 focused validator and real Gateway-auth tests, a live WebSocket connect handshake for an exact custom origin, fresh autoreview, and exact-head CI/CodeQL/OpenGrep. Thanks for reproducing this in a real ClawControl deployment and documenting the user impact. |
Summary
app://localhost, used by ClawControl.URL.originreturns"null"for non-special schemes, so OpenClaw was comparing"null"instead of the configured origin, causinggateway.controlUi.allowedOrigins = ["app://localhost"]to fail."*".app://localhostmatching only when explicitly listed inallowedOrigins, while existing HTTP/HTTPS origin behavior remains unchanged.url.origin === "null"and whether the added test coverage captures the intended security boundary.Linked context
Closes #46520
Related #28172
Was this requested by a maintainer or owner?
No direct maintainer request. This was investigated after reproducing the ClawControl connection failure on a real OpenClaw gateway setup.
Real behavior proof (required for external PRs)
Behavior or issue addressed:
gateway.controlUi.allowedOriginswas set to["app://localhost"].["*"]worked, but that is broader than necessary.Real environment tested:
Exact steps or command run after this patch:
Restarted the gateway.
Connected from the Windows ClawControl app via WSS.
Evidence after fix:
allowedOriginsto["app://localhost"].Observed result after fix:
gateway.controlUi.allowedOrigins = ["app://localhost"].["*"]is no longer required for this app-origin case.What was not tested:
tauri://localhostorelectron://localhostin a live app.Proof limitations or environment constraints:
Before evidence:
origin not allowedgateway.controlUi.allowedOriginswas set to["*"].Tests and validation
Which commands did you run?
Result:
What regression coverage was added or updated?
app://localhost.What failed before this fix, if known?
app://localhostdid not matchallowedOrigins: ["app://localhost"]becausenew URL("app://localhost").originevaluates to"null".If no test was added, why not?
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes.
Did config, environment, or migration behavior change? (
Yes/No)No.
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)Yes.
What is the highest-risk area?
How is that risk mitigated?
url.origin."null"origins are still rejected.Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?