Skip to content

[urgent]: fix v1beta authz bypass - #5274

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.40from
rdself:coder/v40-authz-v1beta-minimal
Jun 29, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.40from
rdself:coder/v40-authz-v1beta-minimal

Conversation

@rdself

@rdself rdself commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the authz gap where /v1beta/* Gemini-compatible aliases were rewritten to /api/v1beta/* without first entering the central proxy/authz pipeline.
  • Classifies both /v1beta/* aliases and /api/v1beta/* routes as CLIENT_API, so the existing clientApiPolicy enforces Bearer auth when REQUIRE_API_KEY is enabled.
  • Updates the authz inventory and guide so the security surface matches runtime behavior.

Root Cause

next.config.mjs already rewrote /v1beta/:path* to /api/v1beta/:path*, but src/proxy.ts did not match /v1beta before rewrite and classifyRoute() did not classify /api/v1beta/* as client API. As a result, unauthenticated /v1beta/models/...:generateContent traffic could reach the model-serving route without the central client API auth policy.

Validation

  • node --import tsx/esm --test tests/unit/authz/classify.test.ts
  • node --import tsx/esm --test tests/unit/authz/proxy-contract.test.ts
  • node --import tsx/esm --test tests/unit/authz/pipeline.test.ts
  • node --import tsx/esm --test tests/unit/api/authz-inventory.test.ts
  • npm run check:fabricated-docs
  • git diff --check
  • Push hook: npm run check:any-budget:t11, npm run check:tracked-artifacts

Copilot AI review requested due to automatic review settings June 28, 2026 23:48
@rdself
rdself requested a review from diegosouzapw as a code owner June 28, 2026 23:48
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rdself rdself changed the title urgent: fix v1beta authz bypass on v3.8.40 [urgent]: fix v1beta authz bypass Jun 28, 2026
@diegosouzapw
diegosouzapw merged commit 1fd19c4 into cheaper-inference:release/v3.8.40 Jun 29, 2026
7 checks passed
@rdself
rdself deleted the coder/v40-authz-v1beta-minimal branch June 29, 2026 02:48
@diegosouzapw diegosouzapw mentioned this pull request Jun 29, 2026
tkgo11 pushed a commit to tkgo11/OmniRoute that referenced this pull request Sep 23, 2026
Security: close /v1beta authz bypass — classify /v1beta + /api/v1beta aliases as CLIENT_API so Bearer auth is enforced. Validated authz TDD suite (classify/proxy-contract/pipeline/inventory). Integrated into release/v3.8.40.
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.

3 participants