Skip to content

fix(audio): bind stored Direct account identity - #535

Closed
luvs01 wants to merge 2 commits into
devfrom
codex/fix-vulnerability-in-audio-transcription-api
Closed

fix(audio): bind stored Direct account identity#535
luvs01 wants to merge 2 commits into
devfrom
codex/fix-vulnerability-in-audio-transcription-api

Conversation

@luvs01

@luvs01 luvs01 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Prevent a data-plane caller from selecting or probing an arbitrary ChatGPT workspace by ensuring a caller-supplied chatgpt-account-id cannot survive when the proxy substitutes the operator-owned Direct bearer.
  • Add focused regression coverage for the new transcription ingress paths that accept x-opencodex-api-key / x-api-key so the preserved-header case is exercised.

Description

  • In materializeCodexUpstreamAuth remove any caller-supplied chatgpt-account-id before substituting the stored main bearer, and only restore the account header from the stored credential when it is present. (src/codex/auth-context.ts)
  • Add an integration regression that exercises dedicated-header and x-api-key admission with a stored Direct credential that lacks an account_id, asserting the caller header never reaches upstream. (tests/server/audio-transcriptions.test.ts)
  • Update documentation contracts to state that stored Direct account identity is derived exclusively from the stored credential and not from caller-controlled headers. (structure/data-planes/inbound-compat.md, structure/providers/openai-tiers.md)

Testing

  • Ran ./node_modules/.bin/bun test tests/server/audio-transcriptions.test.ts and the focused transcription tests passed (all assertions in that file succeeded).
  • Ran ./node_modules/.bin/bun run typecheck, ./node_modules/.bin/bun run structure:check, and ./node_modules/.bin/bun run privacy:scan, each of which completed successfully.
  • Ran a larger ./node_modules/.bin/bun run test; the new regression passed but the full repository suite returned unrelated environment-sensitive failures (host/proxy and process-group cleanup tests) that are not caused by this change.
  • Verified git diff shows only the intended changes to src/codex/auth-context.ts, the new test additions, and the documentation lines updated as part of this fix.

Codex Task

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 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-14T06:19:09.492239Z fff013a New commits
ℹ️ 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.

@github-actions github-actions Bot added the bug Something isn't working label Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6687a022-4833-499e-9791-33ae1da0cc37


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.

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

ℹ️ 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 src/codex/auth-context.ts

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

ℹ️ 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 src/codex/auth-context.ts
if (!stored?.accessToken || !isMainAccountTokenLive()) {
throw new CodexMainSubstitutionUnavailableError();
}
selected.delete("chatgpt-account-id");

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 Update every document that owns src/codex

This authentication change modifies src/codex/auth-context.ts, but checking structure/INDEX.md shows eight documents mapped to src/codex/, while this commit updates only structure/providers/openai-tiers.md; runtime.md, config.md, codex-home.md, catalog.md, subagents.md, gui-and-management-api.md, and ops/docs-and-release.md remain unchanged. Update every mapped document in the same change, or narrow the ownership map if those documents genuinely do not own this contract.

AGENTS.md reference: src/AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

@luvs01

luvs01 commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

The corrected change has been submitted for maintenance review, with its current validation evidence. Closing this development PR to keep one implementation and review queue and avoid repeating integration work later. This does not claim that the change has merged or shipped.

@luvs01 luvs01 closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant