Skip to content

Prevent brokered credential aliases from bypassing MITM hooks - #52661

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/12be41654761cedcf87b170f7661d6566f7a864e
Oct 9, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/12be41654761cedcf87b170f7661d6566f7a864e

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Prevent brokered credential aliases from bypassing MITM hooks

Why

A credential bound to a host with MITM hooks could also be used at an alias without hooks, allowing the proxy to inject the real credential without enforcing hook policy.

What changed

Reject requests to unhooked aliases when their selected brokered credentials are also bound to a hooked host. Check both HTTP forwarding and MITM requests before replacing dummy credentials, returning 403 with blocked-by-mitm-hook for denied requests.

Use the same destination and credential-selection rules for alias checks and injection, including configured URL prefixes, safe paths, equivalent credentials, merged Basic authentication fields, and environment scope.

Testing

Add regression coverage for built-in and configured provider aliases, IPv6 destinations, credential selection, and unrelated credentials. Add an agent-started proxy test that verifies credential masking and alias denial.

## Why

A credential bound to a host with MITM hooks could also be used at an alias without hooks, allowing the proxy to inject the real credential without enforcing hook policy.

## What changed

Reject requests to unhooked aliases when their selected brokered credentials are also bound to a hooked host. Check both HTTP forwarding and MITM requests before replacing dummy credentials, returning `403` with `blocked-by-mitm-hook` for denied requests.

Use the same destination and credential-selection rules for alias checks and injection, including configured URL prefixes, safe paths, equivalent credentials, merged Basic authentication fields, and environment scope.

## Testing

Add regression coverage for built-in and configured provider aliases, IPv6 destinations, credential selection, and unrelated credentials. Add an agent-started proxy test that verifies credential masking and alias denial.

GitOrigin-RevId: 12be41654761cedcf87b170f7661d6566f7a864e
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/12be41654761cedcf87b170f7661d6566f7a864e branch from df75faf to 65b82cd Compare October 9, 2026 18:04
@copyberry
copyberry Bot merged commit 65b82cd into main Oct 9, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-09T18:05:01.211350Z 65b82cd PR opened
ℹ️ 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.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/12be41654761cedcf87b170f7661d6566f7a864e branch October 9, 2026 18:05
@busraoztrk8
busraoztrk8 deployed to issue-triage October 9, 2026 18:05 — with Image GitHub Actions Active
@busraoztrk8
busraoztrk8 deployed to issue-triage October 9, 2026 18:05 — with Image GitHub Actions Active
@busraoztrk8
busraoztrk8 deployed to issue-triage October 9, 2026 18:05 — with Image GitHub Actions Active
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
@soup31314
soup31314 deployed to issue-triage October 9, 2026 18:13 — with Image GitHub Actions Active
@soup31314
soup31314 deployed to issue-triage October 9, 2026 18:13 — with Image GitHub Actions Active
@soup31314
soup31314 deployed to issue-triage October 9, 2026 18:13 — with Image GitHub Actions Active
@Aniganesh
Aniganesh deployed to issue-triage October 9, 2026 18:17 — with Image GitHub Actions Active
@Aniganesh
Aniganesh deployed to issue-triage October 9, 2026 18:17 — with Image GitHub Actions Active
@Aniganesh
Aniganesh deployed to issue-triage October 9, 2026 18:17 — with Image GitHub Actions Active
@Fireotics
Fireotics deployed to issue-triage October 9, 2026 18:18 — with Image GitHub Actions Active
@Fireotics
Fireotics deployed to issue-triage October 9, 2026 18:18 — with Image GitHub Actions Active
@Fireotics
Fireotics deployed to issue-triage October 9, 2026 18:18 — with Image GitHub Actions Active
@Aniganesh
Aniganesh deployed to issue-triage October 9, 2026 18:18 — with Image GitHub Actions Active
@hugeJan
hugeJan deployed to issue-triage October 9, 2026 18:28 — with Image GitHub Actions Active
@hugeJan
hugeJan deployed to issue-triage October 9, 2026 18:28 — with Image GitHub Actions Active
@hugeJan
hugeJan deployed to issue-triage October 9, 2026 18:28 — with Image GitHub Actions Active
@hugeJan
hugeJan deployed to issue-triage October 9, 2026 18:29 — with Image GitHub Actions Active
@v-bohoslov
v-bohoslov deployed to issue-triage October 9, 2026 18:32 — with Image GitHub Actions Active
@v-bohoslov
v-bohoslov deployed to issue-triage October 9, 2026 18:32 — with Image GitHub Actions Active
@v-bohoslov
v-bohoslov deployed to issue-triage October 9, 2026 18:32 — with Image GitHub Actions Active
@v-bohoslov
v-bohoslov deployed to issue-triage October 9, 2026 18:33 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants