Skip to content

fix(runtime): validate private state paths before access - #481

Open
mldangelo-oai wants to merge 15 commits into
mainfrom
agent/explain-unsafe-output-ancestors
Open

fix(runtime): validate private state paths before access#481
mldangelo-oai wants to merge 15 commits into
mainfrom
agent/explain-unsafe-output-ancestors

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Validate configured Codex Security state before history, authentication,
publication, or workbench code can access it. Unsafe parent errors now identify
the offending permission mode and explain how to choose a safe location.

Changes

  • Require private state roots and trusted lexical and resolved parents, then
    retain the validated canonical path through scan setup and worker processes.
  • Create missing state directories privately without changing existing paths.
    On Windows, inspect existing access rules without rewriting them and protect
    only directories created by the current operation.
  • Apply the same boundary in the direct Python workbench. Validation is scoped
    to the state root, SQLite files, scan directories, and completion locks when
    they are accessed, so workbench commands do not rescan unrelated history.
  • Bind temporary Windows credential-lock read retries to the lock directory's
    filesystem identity. A replacement lock receives its own retry window, even
    when replacement happens during the failing read.
  • Keep dry runs non-mutating while checking the existing lexical and canonical
    ancestors of a missing Windows state path.
  • Isolate API tests from real local state, preserve stdin-based workbench
    registration, and keep internal dependency-injection helpers out of public
    TypeScript declarations.
  • Merge current main and keep the bundled plugin markers paired at 0.1.24.

Testing

  • Focused runtime and direct-workbench suite: 154 passed, 17 platform skips,
    zero failures.
  • API suite: 122 passed, 2 platform skips, zero failures.
  • State, publication, CLI, and Windows-compatibility matrix: 506 passed,
    20 platform skips, zero failures before the final bounded follow-ups.
  • Seed 12345 full suite: 1,620 passed and 34 skipped. Two test fixtures used
    non-private state directories; both were corrected, and the affected compact
    diff-scan file then passed all 9 tests.
  • TypeScript types, Prettier, Ruff, build, and Git diff checks passed.
  • Packed and checked the npm artifact, then passed the installed-package smoke
    test, strict NodeNext consumer, CLI, bundled plugin, and nested worker checks.
  • Fresh exact-tree correctness, security, disclosure, and simplification
    reviews found no remaining actionable issues.

Native Windows ACL cases remain covered by the exact-head CI run started by the
push. This update does not wait for that run before the next PR is processed.

Risk and rollout

This adds no command, flag, environment variable, or root SDK export. It makes
the existing CODEX_SECURITY_STATE_DIR contract stricter. On macOS and Linux,
an existing state root must be owned by the current user, use private mode, and
have trusted parents. On Windows, it must use a protected private ACL and have
parents that cannot be used to replace it.

Existing paths are rejected rather than silently repaired. Selecting a new
state directory does not move history, results, or credentials. The bundled
plugin version change refreshes the direct-workbench checks for existing
installations. No package publication or deployment is included.

The macOS ACL advisory remains outside this change: the documented macOS and
Linux contract is based on owner, mode, and parent permissions. A separate
hardening change can broaden that contract without coupling it to this fix.

Public disclosure review

The branch, title, description, commits, diff, tests, logs, and links added by
this update were reviewed. Existing automated review comments still contain
access-restricted report links, so the second attestation remains unchecked.

  • 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.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review commit 8f4c05113d6b4dc7e7a3b4df642c899d3fe3da0f.

@github-actions github-actions Bot added the bug Something isn't working label Aug 16, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 8f4c05113d

ℹ️ 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: 8f4c05113d

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
mldangelo-oai marked this pull request as ready for review August 16, 2026 07:02

@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: 8f4c05113d

ℹ️ 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/api.ts Outdated
Comment thread sdk/typescript/src/api.ts Outdated
@mldangelo-oai mldangelo-oai changed the title fix(runtime): explain unsafe output ancestors fix: validate private state before access Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head: 5254d5f.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 5254d5fcf0

ℹ️ 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: 5254d5fcf0

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 deployment gap that prevents the new workbench security checks from reaching existing plugin installations.

Comment thread sdk/typescript/_bundled_plugin/scripts/workbench_db.py
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current head df0ad83fb167c739936ed27be8a4cffefa76a933. The latest commit only synchronizes the two bundled-plugin version markers. Please review critically for correctness and unnecessary complexity.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: df0ad83fb1

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.

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

ℹ️ 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/api.ts Outdated

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 5e7dc18478a1d1074ca99aafb505e0abfee9486a after the main-branch reconciliation and canonical state-path fix.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 5e7dc18478

ℹ️ 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: 5e7dc18478

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.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head b11c8815575c6d0a98e2fc0a98994be9201c0e9b. The CI follow-up bounds Windows credential-lock read retries, rechecks the current lock on each attempt, and releases the parallel-scan test barrier when a scan fails.

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

ℹ️ 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/runtime.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: b11c881557

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.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review current head 92188af7784f1e82109dfbe56b5a3240a50feb46. This additive update reconciles the shared session setup, preserves private-state validation, and removes explicitly internal helpers from the public TypeScript declarations. Both full local suites and the strict installed-package consumer pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 92188af778

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.

@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: 92188af778

ℹ️ 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/runtime.ts

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 16a41d596a39d7dd59199142c64f71dbdddaba05, including the current-main integration. The normal and seed-12345 full suites each passed 1,379 tests with 14 skipped. Types, formatting, the installed-package smoke test, and a strict NodeNext consumer passed. Three fresh native review passes and an independent verifier are clean. Earlier review findings and advisories remain visible for maintainer disposition.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 16a41d596a

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

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review the current head 16a41d596a39d7dd59199142c64f71dbdddaba05.

@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: 16a41d596a

ℹ️ 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/runtime.ts Outdated
@mldangelo-oai mldangelo-oai changed the title fix: validate private state before access fix(runtime): validate private state paths before access Aug 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 22, 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-08-22T05:16:05.261372Z 3ba5a2c 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.

@mldangelo-oai

mldangelo-oai commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 3ba5a2c. This update merges current main, validates private state before access, preserves the canonical state path, hardens Windows ACL and lock replacement handling, and narrows direct-workbench checks to accessed paths. Focused suites, types, formatting, Ruff, build, package checks, and installed-package smoke passed.

@mldangelo-oai

mldangelo-oai commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Please review exact head 3ba5a2c, especially state-path ancestry and canonicalization, Windows ACL handling, credential-lock replacement, SQLite sidecar validation, and worker environment propagation.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 3ba5a2ca5f

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

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.

2 participants