Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

GoogleOidcVerifier treats string "false" as a verified email claim

未关闭 适合新手
#7,289 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

从 src/google/adk/cli/trigger_routes.py 中的 GoogleOidcVerifier 开始,检查 email_verified claim 的验证方式。复现列出的布尔值和字符串情况,然后确认 verifier 只接受实际的 True 值,同时保留 allowlist 邮箱检查。

由索引模型根据 Issue 内容生成。

描述

Summary

GoogleOidcVerifier currently checks the email_verified claim using Python truthiness:

if (
    not claims.get("email_verified")
    or claims.get("email") not in self._allowed_emails
):

A non-empty string such as "false" is truthy in Python, so it passes this check when the email is allowlisted.

Reproduction

Using the same condition as the current verifier:

email_verified=False   -> REJECT
email_verified="false" -> ACCEPT
email_verified=True    -> ACCEPT
email_verified=""      -> REJECT

The relevant implementation is in:

src/google/adk/cli/trigger_routes.py → GoogleOidcVerifier.

Expected behavior

The verifier should require an actual boolean True, for example:

claims.get("email_verified") is True

or otherwise validate the claim type explicitly before trusting it.

Context

This behavior was also publicly noted in google/adk-go commit 490f24cbc3aa7a9f9472175ba0d848530dc5b4f4, which states that ADK Python's truthiness check accepts non-empty strings including "false".

I have not identified a production Google-issued ID-token path that currently emits email_verified as the string "false", so I am reporting this as a correctness / defensive validation issue rather than claiming a demonstrated authentication bypass.

主要语言
Python
星标
21.6k
派生
4k
平均合并
8 小时 5 分钟
30 天内合并 PR
6

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/adk-python 的其他 Issue

查看 google/adk-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。