Skip to content

Preserve first-party plugin execution context - #31850

Closed
kmbroai wants to merge 2 commits into
mainfrom
dev/kyleb/plugin-script-identity-v3
Closed

kmbroai wants to merge 2 commits into
mainfrom
dev/kyleb/plugin-script-identity-v3

Conversation

@kmbroai

@kmbroai kmbroai commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Preserve trusted first-party plugin roots in turn and review contexts for later lifecycle attribution.
  • Recognize both local curated and API-curated synced catalogs.
  • Reject spoofed or symlink-aliased curated marketplace install paths.

Why

Phase 1 lifecycle metrics must attribute scripts only to installed, trusted first-party plugins. Accepting arbitrary same-named or symlink-aliased marketplace paths could produce false attribution or copy attacker-controlled plugin sources.

This slice is identity/context plumbing only; it does not emit lifecycle events yet.

Enhancement design: Codex Plugin Metrics

Related backend stack: openai/openai#1111389 → openai/openai#1111392.

How

  • Mark loaded plugins first-party only when their root matches the current synced cache SHA and the plugin appears in the matching curated catalog.
  • Carry deduplicated active first-party roots into turn and review contexts.
  • Require curated installs to use the exact synced marketplace path before resolving relative plugin sources.

I tested this

  • just fmt — passed
  • just fix -p codex-core-plugins -p codex-plugin -p codex-analytics -p codex-core -p codex-features -p codex-app-server -p codex-windows-sandbox — passed (stack-wide scoped lint gate)
  • just argument-comment-lint — passed
  • just test -p codex-core-plugins — passed (321/321)
  • just test -p codex-plugin — passed (4/4)
  • just test — attempted; the local workspace build stopped before tests because the runner lacks system libcap for unrelated codex-bwrap. Exact-head CI provides the full Linux/macOS/Windows matrix.

@kmbroai
kmbroai force-pushed the dev/kyleb/plugin-script-identity-v3 branch 2 times, most recently from 5bb246b to fd57476 Compare July 9, 2026 22:27
@kmbroai
kmbroai force-pushed the dev/kyleb/plugin-script-identity-v3 branch from fd57476 to 912c70f Compare July 9, 2026 22:54
@kmbroai
kmbroai marked this pull request as ready for review July 9, 2026 23:13
@kmbroai
kmbroai requested a review from a team as a code owner July 9, 2026 23:13

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 912c70ff70

ℹ️ 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 codex-rs/core-plugins/src/manager.rs Outdated
let expected_path = AbsolutePathBuf::try_from(expected_path)
.ok()
.and_then(|path| path.canonicalize().ok());
let requested_path = marketplace_path.canonicalize().ok();

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 Badge Reject symlinked curated marketplace paths

When marketplace_path is a symlink to the synced curated marketplace, this canonical-path comparison passes, but find_installable_marketplace_plugin has already resolved local plugin sources relative to the caller-provided symlink path. A caller can therefore point /tmp/spoof/.agents/plugins/marketplace.json at the real curated marketplace while placing a different plugin under /tmp/spoof/plugins/...; the install then copies that spoofed plugin into the openai-curated cache version and later treats it as first-party. Validate the original path/layout or canonicalize before resolving marketplace-local sources so symlinks cannot change the source root.

Useful? React with 👍 / 👎.

kmbroai commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by openai/codex-internal#1385 after the Codex source-of-truth migration. The internal replacement preserves this stack position and carries the validated review fixes.

@kmbroai kmbroai closed this Jul 10, 2026
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