Skip to content

D3 network-egress purity — lexical binding enforcement - #64

Open
LogicDuke wants to merge 35 commits into
cockpit/d3-readonly-dashboard-hostfrom
repair/d3-network-egress-purity
Open

D3 network-egress purity — lexical binding enforcement#64
LogicDuke wants to merge 35 commits into
cockpit/d3-readonly-dashboard-hostfrom
repair/d3-network-egress-purity

Conversation

@LogicDuke

@LogicDuke LogicDuke commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Stacked validation PR — OPEN / READY / unmerged. Merge is out of scope for this reconciliation gate.

Stack

  • Protected parent: PR Cockpit D3 — Read-only dashboard host (Stage A) #55cockpit/d3-readonly-dashboard-host
  • Parent (base) SHA: 5ae2b786ad6dc4653286d4c2b50e1fd705daa974 (untouched)
  • This branch: repair/d3-network-egress-purity
  • Current exact HEAD: a6781d8a2859cce8282a61724770fedf3967972d
  • Changed file across the whole stack (only): tests/cockpit-host/purity.test.ts

Scope

Bounded static source-policy enforcement for the D3 read-only cockpit host boundary (src/cockpit-host/): a single-parse, finite AST guard that decides importless network globals (fetch/WebSocket), the node:http positive model (only createServer allowed), runtime code-generation (RC), and hidden-builtin acquisition (HA) by lexical binding identity, not identifier text. This is a development-time source policy, not a runtime sandbox.

History (condensed)

The detector began by replacing name-text decisions with a bounded lexical environment/scope-stack model (fixing shadowing false-positives NET-S1 and the missed-egress false-negative NET-S2), then closed a long series of laundering variants surfaced by review: node:http client/Agent/ClientRequest members, dynamic-import bindings, nested/assignment destructuring, computed & template-substitution socket-registrar keys, statically-folded global self-reference hops (globalThis.globalThis, globalThis['global'+'This']), reflective reads (Reflect.get), and — most recently — forwarding of a recognized free-global self-reference value (const g = [globalThis.globalThis][0]; g.fetch(…)), closed by the RC v4 global-object self-reference forwarding closure in the head commit a6781d8 ("fix(cockpit): reject forwarded global authority").

Latest exact-head evidence

  • CI: run #206 (run ID 33443908648), head_sha a6781d8…, job verifySUCCESS.
  • Normal Codex review: completed on a6781d8 (Manual request).
  • Committed candidate file tests/cockpit-host/purity.test.ts: SHA256 25d1115c774555be5d546ba2a1407f0333cdabde5ef756968438e5f7deae063e, 452778 bytes.
  • Local validation at HEAD: full suite 2628 passed / 8 skipped / 0 failed; typecheck, lint, build, git diff --check all PASS.

Review-thread reconciliation (exact HEAD a6781d8)

All 45 review threads resolved (0 unresolved). Of the 17 previously-unresolved threads, 14 are FIXED — each witness was re-run through the current detectors and is now rejected (usesOutboundNetwork/usesRuntimeCodeGeneration = true), covered by the committed regression suite. BLOCKING_CURRENT_IN_BOUNDARY_COUNT = 0 — no current, in-boundary blocking egress defect remains.

Explicit carried obligations (non-blocking, deferred)

  • valueOf CallExpression identityglobalThis.valueOf().fetch(…): CURRENT / P2, but outside the frozen finite boundary. Sound closure needs CallExpression / intrinsic method-return semantic modeling (an open-ended family, defeated by monkey-patching), which the adopted bounded source policy excludes. Deferred; the .call/.apply identity variants are already closed by the forwarding rule.
  • TypeQuery HTTP value-read precision — a type-only import type { request } + typeof request is over-rejected: CURRENT / P3, a false-positive precision item (not an egress path), used by no production host source. Deferred.
  • EventSourcenot reproducible on the actual default Node v24.12.0 runtime (typeof EventSource === 'undefined' unless --experimental-eventsource, which the cockpit-host/CI launch paths do not enable). The finite network-global surface tracks only runtime-present importless globals; adding it on the @types/node declaration alone would exceed the actual runtime. Flag-conditional / deferred.

All in-boundary blocking findings have been repaired; remaining items are the explicitly-scoped carried obligations above. This PR remains unmerged.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: a7044130-0a27-4907-b14b-988369319133

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 28, 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-09-02T10:37:12.630191Z 3b86319 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6dd6a36411

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba636b23ae

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@LogicDuke
LogicDuke marked this pull request as ready for review August 29, 2026 00:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c71f3266c7

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 86e4b9fffe

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9c0dc665c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2b4387cbc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6bf1d64764

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment thread tests/cockpit-host/purity.test.ts Outdated
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ag7ZrUfkkKnbh6YxLU1fLQ
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ca0a1fdc5

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts
Comment thread tests/cockpit-host/purity.test.ts
Comment thread tests/cockpit-host/purity.test.ts
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ag7ZrUfkkKnbh6YxLU1fLQ
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6bff9a4081

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
@LogicDuke

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6781d8a28

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
// rejects a shadowed `const g = globalThis`, and the escaped alias is never traced.
if (
(ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
isGlobalReceiver(node) &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fold static keys before forwarding global authority

Fresh evidence beyond the earlier direct constructed-hop fix is that this new forwarding branch still relies on the literal-only isGlobalReceiver: const g = globalThis['global' + 'This']; g.fetch('https://example.com') makes NET, RC, and HA all return false while g is the real global object and the call performs outbound egress. The computed key is considered statically harmless by the other checks, and the later local receiver g is not tracked, so apply the same bounded static-key resolution used by NET when recognizing a forwarded self-reference.

Useful? React with 👍 / 👎.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138GjJx3nbN2K7NhuMU2poe
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4835b19798

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment on lines +1398 to +1401
if (isCreateServerCall(node)) {
for (const arg of (node as ts.CallExpression).arguments) {
const handler = binderUnwrap(arg);
if (ts.isArrowFunction(handler) || ts.isFunctionExpression(handler)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Track sockets passed to custom IncomingMessage constructors

When createServer receives an IncomingMessage class in its options, Node constructs that class with the live connection socket, but this pass records only parameters of function arguments passed directly to createServer. Consequently, http.createServer({ IncomingMessage: Capture } as any, ...) can use Capture's constructor parameter to call destroy() and then connect() outbound without mentioning any banned socket property, and all three current purity detectors accept the source. Treat the custom request constructor as another socket-delivery entry point.

Useful? React with 👍 / 👎.

@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e40e8c9d81

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
if (isCreateServerCall(node)) {
for (const arg of (node as ts.CallExpression).arguments) {
const handler = binderUnwrap(arg);
if (ts.isArrowFunction(handler) || ts.isFunctionExpression(handler)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Inspect named createServer request handlers

When the request listener is passed by reference, this collector ignores its parameters because it only recognizes inline arrow/function expressions. For example, function handler(req) { const key = (req.url ?? '').slice(1); const s = req[key]; s.destroy(); setTimeout(() => s.connect(80, 'example.com'), 50) } http.createServer(handler) passes all three purity detectors; a request for /socket then recovers the live inbound socket and reconnects it outbound. Resolve binder-visible function declarations used as listeners, or reject non-inline listeners so Rule A2 cannot be bypassed.

Useful? React with 👍 / 👎.

Comment thread tests/cockpit-host/purity.test.ts Outdated
Comment on lines +1488 to +1489
const optionsObject = binderUnwrap(arg);
if (!ts.isObjectLiteralExpression(optionsObject)) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject aliased createServer constructor options

Fresh evidence beyond the prior direct-object constructor comment is that storing the options first still bypasses the new rule: const options = { IncomingMessage: Capture }; http.createServer(options as any, ...) passes NET, RC, and HA because the argument is an identifier rather than an object literal, while Node still invokes Capture with the live socket and its constructor can destroy and reconnect it outbound. Trace binder-resolved constant option objects, or fail closed on non-literal createServer options.

Useful? React with 👍 / 👎.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CdLcbXZMib9vDjZ7Lgr8gy
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 430f11d370

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
const optionsObject = resolveCreateServerArgument(arg);
if (!ts.isObjectLiteralExpression(optionsObject)) continue;
for (const prop of optionsObject.properties) {
if (!ts.isPropertyAssignment(prop) && !ts.isShorthandPropertyAssignment(prop)) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Inspect constructor-option accessors

Fresh evidence beyond the earlier direct/aliased constructor-option reports is that this property-kind filter skips getters: http.createServer({ get IncomingMessage() { return Capture; } } as any, () => {}) passes all three purity detectors. Node reads the getter and constructs the returned class with the live connection socket, so Capture can destroy and reconnect that socket outbound; inspect accessor keys such as IncomingMessage and ServerResponse alongside ordinary property assignments.

Useful? React with 👍 / 👎.

@LogicDuke
LogicDuke marked this pull request as draft September 1, 2026 06:31
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168Ff8rrLX6K8yWx8WhwrUY
@LogicDuke
LogicDuke marked this pull request as ready for review September 1, 2026 07:14
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 345b9e34a2

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/cockpit-host/purity.test.ts Outdated
// resolve to an ObjectLiteralExpression and stays outside the proof (frozen positive model).
const optionsObject = resolveCreateServerArgument(arg);
if (!ts.isObjectLiteralExpression(optionsObject)) continue;
for (const prop of optionsObject.properties) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject inherited createServer constructor options

Fresh evidence after the direct, aliased, and getter option fixes is that http.createServer({ __proto__: { IncomingMessage: Capture } } as any, ...) still passes usesOutboundNetwork: this loop examines only the top-level object properties, while Node reads the inherited options.IncomingMessage and constructs Capture with the live connection socket. The constructor can then destroy and reconnect that socket outbound, so reject prototype-bearing option shapes or inspect statically supplied prototypes for the reserved constructor keys.

Useful? React with 👍 / 👎.

Comment thread tests/cockpit-host/purity.test.ts Outdated
for (const arg of (node as ts.CallExpression).arguments) {
const handler = resolveCreateServerArgument(arg);
if (ts.isArrowFunction(handler) || ts.isFunctionExpression(handler) || ts.isFunctionDeclaration(handler)) {
for (const param of handler.parameters) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Track request objects accessed through arguments

When a non-arrow request listener has no declared parameters and reads arguments[0], this collector records no request/response symbol because it only iterates handler.parameters. For example, createServer(function () { const req = arguments[0]; const s = req[(req.url ?? '').slice(1)]; ... }) passes usesOutboundNetwork, yet a request for /socket recovers the live socket and can reconnect it outbound. Treat the listener's arguments binding as another request-delivery source or reject this access form.

Useful? React with 👍 / 👎.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0121zTdfx8cyXQCQLJtN6Uzq
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4569d6e37c

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1355 to +1359
const SOCKET_DELIVERY_MEMBERS: ReadonlySet<string> = new Set([
'on',
'once',
'addListener',
'prependListener',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reserve emit as a socket-delivery member

When code can mutate the returned http.Server, overriding server.emit intercepts the internal emit('connection', socket) call without using any name in this set. For example, saving const emit = server.emit, replacing it with a function that takes values[0] when the event is 'connection', and then destroying/reconnecting that socket performs outbound TCP; I verified that usesOutboundNetwork, usesRuntimeCodeGeneration, and acquiresHiddenBuiltin all return false for this witness. Include emit in the socket-delivery reservation (and its existing member/destructuring coverage) so the permitted server cannot expose its delivered socket this way.

Useful? React with 👍 / 👎.

@LogicDuke
LogicDuke marked this pull request as draft September 2, 2026 07:50
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AiozMuvvnzkYJgStQH6Qdo
@LogicDuke
LogicDuke marked this pull request as ready for review September 2, 2026 07:53
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e99d12a1c4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

'prependListener',
'prependOnceListener',
'setTimeout',
'emit',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject reflective emit replacement

Fresh evidence beyond the earlier direct-assignment report is that adding emit to this member-name set only catches syntactic accesses: Object.defineProperty(server, 'emit', { value(event, ...args) { /* use args[0] on 'connection' */ } }) contains no server.emit node, and usesOutboundNetwork, usesRuntimeCodeGeneration, and acquiresHiddenBuiltin all return false. Node invokes this replacement for its internal connection event and supplies the live socket, which can then be destroyed and reconnected outbound, so reflective mutation APIs such as Object.defineProperty/Reflect.defineProperty must receive equivalent coverage.

Useful? React with 👍 / 👎.

@LogicDuke
LogicDuke marked this pull request as draft September 2, 2026 10:28
Add one canonical, target-gated meta-mutation circuit breaker to the D3
cockpit-host purity analyzer: a free built-in meta-mutation API
(Object.defineProperty/defineProperties/assign/setPrototypeOf,
Reflect.defineProperty/setPrototypeOf/set) applied to a proven privileged
target (a createServer result — direct or via the bounded unique-const
spine — or a tracked req/res root) is denied. The gate is on the target,
never the member key, so future member names deny identically without any
emit/on/constructor enumeration. Reads, capability-removing APIs, and
unprovable targets stay allowed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EczoNDvhWL5HRnF5CTPcHz
@LogicDuke
LogicDuke marked this pull request as ready for review September 2, 2026 10:30
@LogicDuke

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b863191ad

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1363 to +1370
const SOCKET_DELIVERY_MEMBERS: ReadonlySet<string> = new Set([
'on',
'once',
'addListener',
'prependListener',
'prependOnceListener',
'setTimeout',
'emit',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Block legacy accessor mutation of privileged servers

When host code calls server.__defineGetter__('emit', () => replacement), the inherited Object.prototype.__defineGetter__ installs an accessor directly on the proven http.Server. Node's subsequent internal server.emit('connection', socket) invokes the getter and then passes the live socket to replacement, which can destroy and reconnect it outbound. Unlike the already-covered Object.defineProperty form, this is accepted because __defineGetter__ is absent from the reserved member family and the meta-mutation branch only recognizes direct Object/Reflect APIs; reserve this mutator or otherwise apply the privileged-target check to it.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant