Skip to content

[codex] Fix OAuth client reference_id updates - #181

Merged
salasebas merged 1 commit into
mainfrom
codex/fix-oauth-reference-id-update
Jul 1, 2026
Merged

[codex] Fix OAuth client reference_id updates#181
salasebas merged 1 commit into
mainfrom
codex/fix-oauth-reference-id-update

Conversation

@salasebas

Copy link
Copy Markdown
Owner

Summary

Reject attempts to update an OAuth client's reference_id through the update-client endpoint and stop persisting that field from update payloads.

Root Cause

UpdateClientBody.update accepted a full OAuthClient, including reference_id. The update path merged and persisted that value. Later, the client_credentials token flow copied the stored client reference_id into access token storage, allowing an authenticated client owner to spoof the tenant or organization reference used by downstream authorization.

Changes

  • Return invalid_client_metadata when update-client receives reference_id.
  • Keep reference_id out of the merge and update record paths.
  • Add a regression test that proves the stored client and issued client-credentials token keep the original server-derived reference.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo nextest run -p rustauth-oauth-provider --all-features
  • cargo test -p rustauth-oauth-provider --features test-util update_client_rejects_reference_id_changes_and_preserves_token_reference -- --nocapture

@salasebas
salasebas force-pushed the codex/fix-oauth-reference-id-update branch from 290e1d3 to 094b80e Compare July 1, 2026 06:25
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rustauth-docs-site Canceled Canceled Jul 1, 2026 6:29am

@salasebas
salasebas marked this pull request as ready for review July 1, 2026 06:30
@salasebas
salasebas merged commit bf0f80c into main Jul 1, 2026
23 checks passed
This was referenced Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant