google-auth: Thread safety race condition during 401 client certificate rotation in transports
维护者通常 1 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- python
- 领域
- networking, security
调研方向
从 google.auth.transport.requests 和 google.auth.transport.urllib3 开始,重点关注在收到 401 响应后调用 configure_mtls_channel 的 HTTP 传输处理程序。跟踪 shared-session 和 pool-manager 的重新配置路径,然后验证并发证书轮换是否已串行化,以及 adapter 或 pool-manager 是否没有同时发生任何变更。
由索引模型根据 Issue 内容生成。
描述
When handling 401 Unauthorized responses, the HTTP transport interceptors in google.auth.transport.requests and google.auth.transport.urllib3 attempt to auto-rotate expired mTLS client certificates by calling configure_mtls_channel().
In multi-threaded environments, if multiple threads share an authorized session and hit a 401 concurrently, they will trigger the certificate rotation at the same time. Because there is no synchronization lock, this leads to race conditions. Multiple threads will redundantly read the updated certificates and concurrently mutate the underlying session's adapter mappings (requests.Session.adapters) or pool managers, which is not thread-safe and can cause runtime exceptions.
We should introduce a lock (e.g., using threading.Lock) around the configure_mtls_channel reconfiguration block inside the transport handlers to ensure that certificate rotation is performed serially.
- 主要语言
- Python
- 星标
- 5.4k
- 派生
- 1.8k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 121
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
googleapis/google-cloud-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
googleapis/google-cloud-python#18532 ·
维护者通常 1 天内回复
-
auth: call_client_cert_callback() discards passphrase for encrypted keys可能已有人在做 @kwy404 于 3 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 92/100
googleapis/google-cloud-python#18467 ·
维护者通常 1 天内回复
-
auth: `impersonated_credentials` loses `subject` on copy, so `with_scopes()` and `with_quota_project()` turn off domain wide delegation可能已有人在做 @Om-singhaI 于 15 天前认领。 未关闭auth priority: p2 type: bug
难度 2/5 1-3 小时 新手友好度 88/100
googleapis/google-cloud-python#18428 ·
维护者通常 1 天内回复
-
priority: p2 type: bug
难度 2/5 1-3 小时 新手友好度 72/100
googleapis/google-cloud-python#18375 · 1 条评论 ·
维护者通常 1 天内回复
-
ci: enable --strict flag in presubmit twine_check可能已有人在做 @ohmayr 于 4 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 76/100
googleapis/google-cloud-python#18339 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 googleapis/google-cloud-python 的全部 Issue
相似的 Issue
-
feature:LinkChecker
难度 2/5 1-3 小时 新手友好度 66/100
digitalfabrik/integreat-cms#4594 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
EleutherAI/lm-evaluation-harness#4319 ·
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
json_params_matcher fails on falsy top-level JSON primitives (0, False, "")可能已有人在做 @mayureshsonawane17 今天认领。 未关闭Waiting for: Product Owner
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 5 天内回复