Skip to content

fix(oauth2): validate Firebase issuer/subject and warn on omitted audience in verify_firebase_token - #18777

Merged
macastelaz merged 10 commits into
mainfrom
fix/verify-firebase-token-issuer
Nov 6, 2026
Merged

macastelaz merged 10 commits into
mainfrom
fix/verify-firebase-token-issuer

Conversation

@macastelaz

@macastelaz macastelaz commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Validates that the decoded Firebase ID token contains non-empty string aud and sub claims and that iss matches https://securetoken.google.com/<aud>, and emits a UserWarning when audience is omitted in verify_firebase_token() (both sync and async).

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request enhances security in both the synchronous and asynchronous implementations of verify_firebase_token by validating the token's audience (aud) and issuer (iss) claims. It also introduces a warning when the function is called without an audience, as this can be insecure. Comprehensive unit tests have been added to verify these validations and warnings. I have no additional feedback to provide as the changes are well-implemented and properly tested.

@macastelaz macastelaz changed the title fix(oauth2): validate Firebase issuer and warn on omitted audience in verify_firebase_token fix(oauth2): validate Firebase issuer/subject and warn on omitted audience in verify_firebase_token Oct 22, 2026

@daniel-sanche daniel-sanche 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.

LGTM, with a docstring suggestion

@macastelaz
macastelaz enabled auto-merge (squash) November 6, 2026 21:05
@macastelaz
macastelaz merged commit 1851b9c into main Nov 6, 2026
120 checks passed
@macastelaz
macastelaz deleted the fix/verify-firebase-token-issuer branch November 6, 2026 21:17
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.

2 participants