Skip to content

feat: add codeVerifierTTL to the OIDC SecurityPolicy - #9645

Open
zhaohuabing wants to merge 2 commits into
envoyproxy:mainfrom
zhaohuabing:feat-oidc-code-verifier-ttl
Open

feat: add codeVerifierTTL to the OIDC SecurityPolicy#9645
zhaohuabing wants to merge 2 commits 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 be19100
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a957a3314bcfc00086fd5bb
😎 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 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.28%. Comparing base (3b80726) to head (be19100).

Files with missing lines Patch % Lines
internal/gatewayapi/securitypolicy.go 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9645      +/-   ##
==========================================
- Coverage   81.29%   81.28%   -0.01%     
==========================================
  Files         263      263              
  Lines       40859    40865       +6     
==========================================
+ Hits        33216    33219       +3     
- Misses       7643     7646       +3     

☔ 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.

@zhaohuabing
zhaohuabing force-pushed the feat-oidc-code-verifier-ttl branch from 2751b6c to 498f2b9 Compare August 4, 2026 02:43
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 498f2b9 to e7677ef Compare August 17, 2026 04:08
# Conflicts:
#	internal/xds/translator/testdata/out/xds-ir/oidc.routes.yaml
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

3 similar comments
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

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