Repository navigation
fix(javascript): report EventSource and sendBeacon URLs as network endpoints - #3044
Merged
morluto merged 1 commit intoOct 14, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
This was referenced Oct 14, 2026
12 of 19 tasks
Owner
|
Thanks, @xpeng5278-web, for extending endpoint discovery to |
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
Fixes #3042
Literal
new EventSource(url)andnavigator.sendBeacon(url, data)URLs are now reported asnetworkendpoints, the same wayWebSocket,fetchandXMLHttpRequest.openURLs already are.Problem and expected behavior
Trigger:
new EventSource("/api/chat/stream")ornavigator.sendBeacon("/api/telemetry", payload). Before this change,endpointArgumenthad no case for either API, so static analysis and web-bundle analysis returned no endpoint for an app's server-sent-event stream or its beacon POST targets.Expected: the literal first argument is reported with mechanism
call:EventSource/call:window.EventSourceorcall:navigator.sendBeacon/call:window.navigator.sendBeacon. Dynamic arguments stay unreported.Change and scope
endpointArgument(src/domain/javascript/javascriptStaticAnalysisHelpers.ts) now:EventSource/*.EventSourcelikeWebSocketand returns the literal first argument;sendBeacon/*.sendBeacon.That helper is the single owner shared by
javascriptStaticAnalysisCallsandwebBundleAnalyzerInspection, so both consumers get the fix.Not included: the semantic request IR (
requestMethodinjavascriptSemanticDataEffects.ts). Adding methods to its enum would change the tool output schema, so that is left for a separate decision.This is additive next to the
fetch/WebSocketbranch that open PR #2878 also edits. If #2878 lands first, the rebase is a trivial merge of the condition.Follow the contribution scope.
Ordinary fix within existing boundaries; maintainer scope decision: not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage:
endpointArgument(static endpoint extraction)Contribution scope fit and linked maintainer decision: ordinary fix within existing boundaries; not applicable
CLI and MCP/tool-catalog contract: no schema change; additional endpoint findings only
Provider, bridge, target-format, or platform compatibility: none
Evidence, artifact, provenance, or reconstruction contract: none
Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable
Generated metadata (
docs/public/product-catalog.json), package, or installation impact: noneRead existing files or captured data.
Launch or attach to a process.
Inject instrumentation or run scripts/code.
Change process memory, registers, files, or configuration.
Contact network services.
Recover protected code or work around protections.
Documentation or usability only; no target interaction.
Not sure yet; investigation or maintainer guidance needed.
Evidence and regression coverage
src/domain/javascript/javascriptStaticAnalysis.event_source.test.tsandsrc/domain/javascript/javascriptStaticAnalysis.send_beacon.test.ts. They cover literal,window.-qualified and dynamic-URL cases.{ kind: "network", value: "/api/chat/stream", mechanism: "call:EventSource" }and{ kind: "network", value: "/api/telemetry", mechanism: "call:navigator.sendBeacon" }.For evidence-bearing changes:
Validation performed
npm run test:local -- src/domain/javascript/javascriptStaticAnalysis*.test.ts src/domain/javascript/javascriptRpcEndpoints.test.ts src/domain/webBundleAnalyzer.test.ts: 9 files, 116 tests passednpm run verify:test-discovery: discovered all 1184 test files exactly oncenpm run lint: passed, including module boundaries (1808 source files)npx oxfmt --check src: passedCompatibility, safety, and release
Before merge
type(scope): outcome.