Skip to content

[Codex Security] REST configuration overrides can redirect a retained OAuth client secret during token refresh - #21

Closed
manuzhang wants to merge 1 commit into
mainfrom
codex-security/arp_58d1a99827c52fa3a41aeaead8b257b3
Closed

manuzhang wants to merge 1 commit into
mainfrom
codex-security/arp_58d1a99827c52fa3a41aeaead8b257b3

Conversation

@manuzhang

Copy link
Copy Markdown
Owner

The patch defaults credential-bearing OAuth refreshes to the operator endpoint and keeps server endpoint selection as explicit opt-in.

  • kTrustServerOAuth2Uri now defaults to false, requiring a lowercase absolute HTTP(S) token endpoint for client credentials before any I/O.
  • RestCatalog::Make restores operator trust policy and token endpoint after server configuration merging, closing direct endpoint and catalog-base rebinding.
  • Explicit trust opt-in still accepts server overrides, while empty or absent client credentials avoid the new validation and pinning.
  • Regression source covers invalid endpoint rejection, the original refresh recipient, client-secret submission, and retained opted-in behavior.
  • The requested C++ layouts now match local style precedents; pinned clang-format 22.1.5 and pre-commit executables were unavailable without installation.
  • Runtime execution was outside the selected static verification scope.

Static Verification Checks

  • Operator endpoint pinning (Passed) — RestCatalog::Make restores the client token endpoint after MergeConfigs, preventing server overrides from redirecting retained secrets.

  • Absolute endpoint rejection (Passed) — RestCatalog::Make rejects missing, relative, non-HTTP, and uppercase-scheme endpoints before credential-bearing initialization, closing base-URI rebinding.

  • Refresh sink binding (Passed) — OAuth2Session::RefreshToken passes pinned refresh properties to OAuth2Util::FetchToken, closing secret-bearing endpoint rebinding.

  • Noncredential path compatibility (Passed) — RestCatalog::Make gates validation and pinning on nonempty credentials, preserving token-only and unauthenticated catalog behavior.

  • Regression behavior coverage (Passed) — rest_catalog_unit_test.cc asserts default pinning, invalid endpoint rejection, secret destination, and explicit trust opt-in behavior.

  • Formatting preserves semantics (Passed) — cmp matched whitespace-normalized reviewed and final files, preserving reviewed attack-path closure and legitimate behavior.

  • Patch whitespace integrity (Passed) — git diff HEAD --check reported no whitespace errors across all changed files, preserving legitimate source layout.

  • Finding: acf_f8f907964600e5519354244212161700

  • Patch: arp_58d1a99827c52fa3a41aeaead8b257b3

  • Base commit: cda824400a9032b72850d92df507009da80cebe5

  • Patch SHA-256: 0ca9ce3e7ea8ff2bc592befe8a95f80a163dcc2f4d45aa5b5e96e947c0da390e

Server-provided catalog configuration could override the OAuth token endpoint or catalog base URI and redirect a retained client secret during token refresh.

Disable trust in server-selected OAuth endpoints by default. When client credentials are configured, require an explicit absolute HTTP(S) token endpoint before any I/O and preserve the client endpoint and trust policy after merging server configuration.

Keep server endpoint overrides available through explicit opt-in, preserve token-only and unauthenticated behavior, and update regression tests to verify the refresh destination and client-secret submission.
@manuzhang
manuzhang force-pushed the codex-security/arp_58d1a99827c52fa3a41aeaead8b257b3 branch from cecf63c to 91e7ed8 Compare November 17, 2026 08:41
@manuzhang manuzhang closed this Nov 17, 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