Repository navigation
test: guard shipped source against raw TLS clients - #41
Merged
Merged
Conversation
This was referenced Oct 10, 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.
AST repair after the H1/H2 review
Head: a5cba3b. This section supersedes the historical detector and gate details below.
Summary
Add a tracked-shipped-source guard against unreviewed raw TLS clients for CVE-2026-48618, and collect it in both explicit CI runner lists.
Fixes #40
Related: code-yeongyu/senpi#3078, code-yeongyu/oh-my-openagent#9892. Detector precedents: senpi#3099 and oh-my-openagent#9893.
Changes
test/no-raw-tls-client.test.mjsscansgit ls-filesJavaScript/TypeScript, includingsrc, CLI and extension source; tests, fixtures and declarations are excluded.export ... from,process.getBuiltinModule, andBun.connect. Comment and literal-prose controls avoid false hits in the existing generated source. The positive matrix exercises 95 input forms.package.jsonadds the guard exactly once totestandtest:node. The existing CI invokes both scripts.Built dependency trace and verdict
The downstream bundle's
tls.connect(options)belongs to ws@8.21.3.OmO's
packages/shared-skills/stage-omowright-runtime.mjs:39-47builds OmOWright'ssrc/index.jswith Bun,--target=node --format=esm --minify-whitespace. A local rebuild with those settings and an external source map identifiesnode_modules/ws/lib/websocket.js. The installed runtime and rebuilt runtime have byte-identicalrequire_websocketmodules (22,560 bytes), and the mapped source matches the locked dependency's source.Host/SNI provenance:
src/connection.js:99-104passes the user's CDP endpoint intoCdpClient.src/core.js:93selects the directws:/wss:endpoint or an HTTP discovery response'swebSocketDebuggerUrl, and callsnew WebSocket(Vn, { headers: jn }). No proxy,servername,agent, or customcreateConnectionoption is passed.ws/lib/websocket.js:703-707accepts a URL object or parsesnew URL(address).:752-758selectstlsConnectand derivesopts.hostfromparsedUrl.hostname.:1083-1090setsoptions.servernameto that host (or empty for an IP) beforetls.connect(options).Verdict: URL-derived and safe for this CVE. The built bundle is acceptable because the reachable host and SNI are normalized by the dependency before TLS. No runtime patch is needed. This conclusion is about the reviewed OmOWright call site, not arbitrary consumers supplying custom
wsTLS options.QA and RED -> GREEN
Local-only TLS measurement, Bun 1.4.2
Run the exported
connect()path withclient.reconnectDelaysMs: [0]. Intercepttls.connectbefore any external socket is opened; use a loopback-only HTTP server for the discovery case. Both installed and rebuilt runtimes produced the following results and exited 0:a.b.example.coma.b.example.coma.b.example.coma.b.example.coma.b.example.coma.b.example.coma.b.example.coma.b.example.comThe same Bun 1.4.2 process confirms the vulnerability control against synthetic
DNS:*.example.com: rawa\uFF0Eb.example.comis accepted, whilenew URL("https://a\uFF0Eb.example.com").hostnameis rejected withERR_TLS_CERT_ALTNAME_INVALID.RED: temporarily add and stage
src/tls-guard-negative-control.jscontaining:bun test test/no-raw-tls-client.test.mjsexits 1: 3 pass, 1 fail, reporting:GREEN: remove the owned negative control from file and index, then:
Independent collection check confirms the new file occurs exactly once in each explicit runner list, and
.github/workflows/ci.ymlinvokes both scripts. CI uses its existing Bun 1.4.3 / Node 24 configuration; this PR does not revert PR #39.Evidence and the executable local-only probe are held locally under
artifacts/omowright-tls-20261010/, outside the repository. Neither the probe, source maps nor the negative control is committed.Probe SHA-256:
0485eeff76d26cab8783358b0106af44cc6b0a045d613112f95a1c50e0c6403e.Limitations / delivery state
Summary by cubic
Adds a CI guard that fails when tracked shipped JS/TS source introduces an unreviewed direct
tls/https/http2client, closing regression risk for CVE-2026-48618 (fixes #40). The old scripts ran without this scan; no runtime behavior changes.test/no-raw-tls-client.test.mjsruns the detector overgit ls-filesshipped source; tests, fixtures, and declarations are excluded.test/tls-client-detector.mjsparses source with the Acorn AST (acorn@8.15.0added as a dev dependency) to catch direct clients and all module acquisition forms, including globalBunaccess, destructuring assignment, andprocess.getBuiltinModule, ignoring comments and literal prose and counting call and member occurrences exactly.testandtest:node; the bundledtls.connectinws@8.21.3is URL-derived and safe here, so no runtime patch is needed.Written for commit 8cf443f. Summary will update on new commits.