Skip to content

Security: Strengthen Google ID token issuer validation - #23

Merged
Macktireh merged 1 commit into
mainfrom
develop
Nov 2, 2025
Merged

Macktireh merged 1 commit into
mainfrom
develop

Conversation

@Macktireh

Copy link
Copy Markdown
Owner

Description

This PR fixes a security vulnerability in the Google ID token validation. The current implementation uses a substring match (in operator) which could potentially allow tokens from malicious issuers like malicious-accounts.google.com.evil.com.

Vulnerability Explanation

Current vulnerable code:

if "accounts.google.com" not in id_info.get("iss", ""):

Problem: This check is too permissive and could match:

  • ✅ https://accounts.google.com (valid)
  • ✅ accounts.google.com (valid)
  • ❌ fake-accounts.google.com.attacker.com (INVALID - but would pass!)
  • ❌ malicious-accounts.google.com (INVALID - but would pass!)

@github-actions

github-actions Bot commented Nov 2, 2025 •

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/simplesocialauthlib
   __init__.py00100% 
   abstract.py37392%73, 89, 105
   exceptions.py140100% 
   types.py150100% 
   utils.py241442%26–39
src/simplesocialauthlib/providers
   __init__.py211148%7–8, 14–15, 19–25, 29–30, 34–35
   github.py431370%59–76, 81–89
   google.py501668%78–92, 97–123
TOTAL2045772% 

Tests Skipped Failures Errors Time
11 0 💤 0 ❌ 0 🔥 1.086s ⏱️

@Macktireh
Macktireh merged commit 3d7ab9b into main Nov 2, 2025
11 of 13 checks passed
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