Skip to content

feat: add codeVerifierTTL to the OIDC SecurityPolicy - #9645

Open
zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:feat-oidc-code-verifier-ttl
Open

feat: add codeVerifierTTL to the OIDC SecurityPolicy#9645
zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:feat-oidc-code-verifier-ttl

Conversation

@zhaohuabing

@zhaohuabing zhaohuabing commented Aug 3, 2026

Copy link
Copy Markdown
Member

Adds spec.oidc.codeVerifierTTL to SecurityPolicy, mapping to the oauth2 filter's code_verifier_token_expires_in.

csrfTokenTTL already bounds the lifetime of the nonce cookie Envoy sets when it starts an authorization flow, but there was no equivalent for the PKCE code verifier cookie, which stayed pinned at Envoy's 600s default.

Both cookies are only consumed on the callback endpoint, so a flow that is started but never completed leaves them in the browser until they expire. This lets an operator bound that window for the code verifier the same way csrfTokenTTL already does for the nonce.

Independent of #9644, which fixes the same underlying problem from the other direction and is deliberately kept API-free so it can be cherry-picked to release branches.

@zhaohuabing
zhaohuabing requested a review from a team as a code owner August 3, 2026 07:09
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 498f2b9
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a7151c52c9fdb0008ebefb6
😎 Deploy Preview https://deploy-preview-9645--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zhaohuabing
zhaohuabing force-pushed the feat-oidc-code-verifier-ttl branch 3 times, most recently from fa0d5ae to 2751b6c Compare August 3, 2026 08:03
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.07%. Comparing base (10d4726) to head (498f2b9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/securitypolicy.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9645   +/-   ##
=======================================
  Coverage   76.07%   76.07%           
=======================================
  Files         260      260           
  Lines       43446    43453    +7     
=======================================
+ Hits        33051    33057    +6     
- Misses       8191     8192    +1     
  Partials     2204     2204           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

csrfTokenTTL already bounds the lifetime of the nonce cookie Envoy sets when
it starts an authorization flow, but there was no equivalent for the PKCE code
verifier cookie, which stayed pinned at the oauth2 filter's 600s default.

Both cookies are only consumed on the callback endpoint, so a flow that is
started but never completed leaves them in the browser until they expire.
Exposing code_verifier_token_expires_in lets an operator bound that window for
the code verifier the same way csrfTokenTTL already does for the nonce.

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing
zhaohuabing force-pushed the feat-oidc-code-verifier-ttl branch from 2751b6c to 498f2b9 Compare August 4, 2026 02:43
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