Files
codex/codex-rs/core/tests
viyatb-oai 65b82cdf96 Prevent brokered credential aliases from bypassing MITM hooks (#52661)
## 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
2026-10-09 18:04:48 +00:00
..