fix(review): reject plain ws: in isSafeEndpointUrl, matching its own "secure" doc comment - #8131
Merged
Merged
Conversation
…"secure" doc comment
isSafeEndpointUrl's doc comment always said it permits "secure WebSocket
endpoints (wss:, ws:)" -- but ws: is the plaintext counterpart to wss:,
the same relationship http:/https: has, where isSafeHttpUrl already
rejects http: for exactly that reason. The registry-logic.ts error
message this guards ("must be a public HTTPS or WSS endpoint") already
only ever mentioned WSS, confirming ws: support was an oversight, not
an intentional carve-out.
Applied identically to both sides of the safe-url.ts twin pair
(content-lane + @loopover/engine).
Closes #8017.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
loopover-ui | a2dc21c | Jul 22 2026, 11:55 PM |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8131 +/- ##
==========================================
- Coverage 92.02% 92.02% -0.01%
==========================================
Files 760 760
Lines 77394 77394
Branches 23392 23392
==========================================
- Hits 71225 71221 -4
Misses 5061 5061
- Partials 1108 1112 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This was referenced Jul 23, 2026
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
isSafeEndpointUrl's (src/review/content-lane/safe-url.ts+ its@loopover/enginetwin) doc comment always said it "additionally permits secure WebSocket endpoints (wss:,ws:)" — butws:is the plaintext counterpart towss:, the same relationshiphttp:/https:has in this same module, whereisSafeHttpUrlalready rejectshttp:for exactly that reason.registry-logic.tserror message this guard backs ("Surface entry URL must be a public HTTPS or WSS endpoint") already only ever mentioned WSS, never WS — confirmingws:acceptance was an oversight in the original reviewbot port, not a deliberate carve-out for e.g. self-hosted operators pointing at a local unencrypted RPC node.ws:/wss:) — it's closing the transport-security/spec-consistency gap between what the doc comment claims and what the code allowed.safe-url.tsis a genuine hand-duplicated twin pair (SAFE_URL_TWIN_PAIRinscripts/check-engine-parity.ts) — applied the identical change to bothsrc/review/content-lane/safe-url.tsandpackages/loopover-engine/src/review/safe-url.ts.Closes #8017.
Test plan
test/unit/content-lane-safe-url.test.tsandtest/unit/safe-url-engine.test.ts(one per twin side):ws://...now assertsfalsealongside the existinghttp:/ftp:rejection cases;wss://acceptance and its SSRF host-guard coverage are unchanged.ws://node.example.comstill returnedtrue), then restored the fix and confirmed green.npm run build --workspace @loopover/enginenpx tsc --noEmitcontent-lane-safe-url,safe-url-engine,content-lane-registry-logic) — 199/199 passingnpm run test --workspace @loopover/engine(648/648 passing)npm run engine-parity:drift-check— clean, both twin-pair sides still agree