Skip to content

fix(comparison): isolate restricted finding comparisons - #432

Open
mldangelo-oai wants to merge 9 commits into
mainfrom
mdangelo/codex/review-scan-comparison-approvals
Open

fix(comparison): isolate restricted finding comparisons#432
mldangelo-oai wants to merge 9 commits into
mainfrom
mdangelo/codex/review-scan-comparison-approvals

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Keep finding-comparison sessions read-only and noninteractive while preventing inherited MCP servers from bypassing their execution boundary.

Changes

  • Keep semantic comparison on approvalPolicy: "never" with its existing read-only sandbox, disabled network, and disabled web search.
  • Enumerate inherited MCP servers from the actual comparison repository with the selected Codex executable and disable every configured server before starting the real comparison session.
  • Preserve server names with spaces and Unicode, store overrides without an object prototype, and fail closed for malformed configuration or names the pinned SDK cannot encode safely.
  • Exercise the real pinned Codex process and SDK session against a synthetic local Responses API, demonstrating that user-configured, project-local, and __proto__ MCP servers start without isolation and never start in the restricted comparison.
  • Document the resulting comparison boundary accurately in the SDK and security guidance.

Testing

  • bun test --timeout 30000 tests-ts/scan-comparison.test.ts — 22 passed, 0 failed.
  • bun test --timeout 30000 tests-ts/scan-comparison.test.ts tests-ts/auth.test.ts — 32 passed, 0 failed.
  • bun test --timeout 30000 ./tests-ts — 1,124 passed, 11 skipped, 0 failed on the combined latest-main integration checkout.
  • pnpm run types
  • pnpm run format
  • pnpm exec prettier --check ../../SECURITY.md
  • pnpm run build

Risk and rollout

Comparison sessions retain their strict approval, filesystem, and network settings and additionally disable inherited MCP servers. If the selected executable cannot report its MCP configuration or a server name cannot be represented safely by the pinned SDK, comparison fails closed before creating a model session.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@github-actions github-actions Bot added the enhancement New feature or request label Aug 14, 2026

@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: 882a85ec31

ℹ️ 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 sdk/typescript/src/scan-comparison.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 882a85ec31

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3619fc8cd5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found a reproducible approval-boundary regression in the restricted finding-comparison session.

Comment thread sdk/typescript/src/scan-comparison.ts Outdated
@mldangelo-oai mldangelo-oai changed the title feat(comparison): review restricted session approvals test(comparison): guard read-only session boundaries Aug 14, 2026
@github-actions github-actions Bot added skip-release-notes Omit internal changes from generated release notes and removed enhancement New feature or request labels Aug 14, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

ianw-oai
ianw-oai previously approved these changes Aug 14, 2026

@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: 7e18491ff8

ℹ️ 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 sdk/typescript/tests-ts/scan-comparison.test.ts Outdated
Comment thread SECURITY.md Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 7e18491ff8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@mldangelo-oai mldangelo-oai changed the title test(comparison): guard read-only session boundaries fix(comparison): isolate restricted finding comparisons Aug 14, 2026
@github-actions github-actions Bot added bug Something isn't working and removed skip-release-notes Omit internal changes from generated release notes labels Aug 14, 2026

@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: d4bf8ab869

ℹ️ 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 sdk/typescript/src/scan-comparison.ts
Comment thread sdk/typescript/src/scan-comparison.ts
Comment thread sdk/typescript/src/scan-comparison.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 9d7b94c3ba

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9d7b94c3ba

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 8d5865fa1f

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 8d5865fa1f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 778f1b8c98

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

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 778f1b8c98

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Found a reproducible credential-exposure path during MCP inspection, before the restricted comparison session is created.

options.signal,
);
const command = resolveCodexCommand(environment);
const configuredServers = await runCodexCommand(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P1] Do not contact MCP servers before enforcing comparison isolation

Could we inspect MCP configuration without invoking networked mcp list, or enforce network isolation before this subprocess starts? The pinned Codex CLI performs OAuth discovery for configured HTTP MCP servers while executing mcp list --json, before the comparison's network-disabled sandbox or secret-filtering policy exists. A localhost-only reproduction generated eight requests, and a project-local MCP configuration using env_http_headers = { "X-Provider-Key" = "OPENAI_API_KEY" } sent the inherited API key with those requests. Please add a synthetic HTTP MCP regression proving that inspection performs no outbound requests and cannot disclose environment credentials.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants