Skip to content

fix(javascript): follow actual receivers in nested intrinsic calls - #1912

Merged
morluto merged 1 commit into
mainfrom
fix/javascript-call-receivers
Oct 11, 2026
Merged

morluto merged 1 commit into
mainfrom
fix/javascript-call-receivers

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Nested Function.prototype.call.call.call(...) consumes an extra argument layer and misses a visible Object.create overwrite. REA then attributes the helper-derived constructor to Electron. Follow the actual callable receiver at each generic invocation, preserving bound arguments and the original bound receiver. Fixes #1909; follow-up to #1857.

Problem and expected behavior

A property's depth does not define how many calls occurred. Retain the actual function receiver and consume arguments once per invocation, so visible intrinsic replacement makes helper-derived identity unresolved while fresh local targets preserve legitimate findings.

Change and scope

Replace path-segment stripping with receiver propagation. Reuse the existing binding-factory and intrinsic-read checks. Correct detached call/apply alias fixtures to supply an actual receiver; creating an alias does not preserve JavaScript's implicit this. Keep the fixture setup outside the CLI/MCP test body.

Contract and boundary impact

  • Semantic owner and earliest changed stage: static JavaScript intrinsic invocation normalization.
  • CLI/MCP/tool catalog: unchanged schemas; incorrect inferred window attribution is removed.
  • Provider/bridge/platform compatibility: none; shared static workflow.
  • Evidence/provenance: preserve original anchors, preload expressions and unresolved identity.
  • Execution/authorization/cleanup: none; target source remains inert.
  • Generated metadata/package/install impact: none; generated outputs remain ignored.

Evidence and regression coverage

  • Pinned main e4ac7bbfc: triple-call and bound nested-call source cases fail. Both actual CLI/stdio MCP regressions report eight windows instead of seven. An apply/apply control already passes on main.

  • After the fix: the public fixture parses 12 files, retains all seven legitimate source anchors and preload uncertainty, and excludes ten intrinsic-poisoned modules plus the fake helper.

  • Source controls retain generic binding, capture timing, opaque arguments and fresh targets. Exact duplicate controls are omitted.

  • Remaining proof gap: arbitrary cross-call side effects are not evaluated.

  • Observed, derived and inferred claims remain distinguishable.

  • Artifact identity, source provenance and failed attempts remain preserved.

  • Uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- … — 488 tests across 11 files pass: 189 interop, 295 adjacent source/RPC and four production CLI/stdio MCP cases.
  • npm run docs:check — six tasks pass.
  • Normal pre-commit formatting/lint and pre-push check:fast typecheck/lint — pass.
  • Independent final-diff review and automated review on f80e2b7 — no remaining blocker. The PR was merged while CI was running. Its eventual sole test failure was the static Wasm/Harmony wording audit; #1917 fixes that audit omission. The focused receiver regressions passed.
  • Public T3 nightly boot/main source subset (main SHA-256 e566055ab42d104b413575920bb62ea7f43677e014ad840fd7319d69fc83cf1f) — four windows, zero parse failures, both dynamic preload expressions preserved. This is a source subset, not full ASAR/runtime verification.
  • Bounded Flameox producer profile — 2,997 samples, 555 rows examined; invocation normalization accounts for nine self samples. CPU and RSS receipts retained locally; no speedup claim.

Compatibility, safety, and release

  • Breaking changes/migration: none; correct static attribution with existing interfaces.
  • Real coverage: Linux x64 CLI/production stdio MCP; no target runtime or deep provider involved.
  • Package/release metadata: none.
  • Security/privacy/process: no target execution or expanded authority; fixture inputs throw if executed.

Review checklist

  • Concrete problem, focused outcome and conventional title.
  • Related issue linked.
  • Observable regressions and uncertainty/fresh-target controls covered.
  • Owning documentation updated.
  • Representative CLI/MCP output verified.
  • Final diff checked for secrets, unrelated changes and unsupported claims.

Consume arguments per generic function invocation rather than property-chain
depth. Preserve the callable receiver through call/apply, Reflect.apply and
bound invocation. Cover nested mutations and fresh targets through source
analysis and inert production CLI/MCP fixtures.

Fixes #1909.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
@N0zoM1z0 N0zoM1z0 added bug Something isn't working area: evidence Evidence, artifacts, and reconstruction labels Oct 11, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T17:21:58.597361Z f80e2b7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto
morluto merged commit 9d8e42b into main Oct 11, 2026
23 of 24 checks passed
@morluto
morluto deleted the fix/javascript-call-receivers branch October 11, 2026 17:22
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

The receiver fix passes 488 focused tests, including production CLI/stdio MCP regressions. The public T3 boot/main source subset retains four windows and both unresolved preload expressions, with zero parse failures.

The sole eventual CI test failure was the separate static Wasm/Harmony wording audit; #1917 is merged with all four shards and CI required passing, fixing that omission. Verification covers Linux static workflows, without target runtime or GUI provider execution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Nested Function.prototype.call chains bypass Electron intrinsic mutation checks

2 participants