Workload identity: three small hardening gaps (act member types, key fetch limit past 64 issuers, duplicate trust rules)
@ThomasK33 已经在做这个了。
开始于 2026年11月19日。
评估
这个 Issue 还没有评估数据。
描述
Three small gaps in workload identity on main. Reviewers and verifiers found them on #63, #65 and #69. None of them can produce a wrong login result, leak data or lose an event, so none blocked a merge. They are collected here so they stay findable.
1. The act check reads member names, not values
actsForAnother in faucet/oauth/workloadtoken.go lets through an act that is an object with no members other than iat, aud, exp and nbf. It never looks at the values. So {"aud": {"sub": "other"}} and {"iat": "x"} pass.
- Why it is not a bug today: nothing in faucet reads
actafter this check, and the token is signed by an issuer the operator trusts. - Fix: require
iat,expandnbfto be JSON numbers, andaudto be a string or an array of strings, with one refused test for each. This was found on #69 by its verifier and by Superblink.
2. The once-a-minute key fetch limit is lost past 64 issuers
keySource in faucet/oauth/workloadkeys.go stores the time of an issuer's last fetch in the same cache entry that the 64-issuer cap evicts.
- What goes wrong: once more than 64 discovery issuers are configured across all clients, a caller who cycles tokens across them makes each request miss the cache and cost about two outbound fetches.
- Why it is not a bug today: faucet only fetches issuers that an operator stored in a trust rule. Production has one.
- Fix: keep the last-fetch time apart from the cached keys, or never evict an entry whose limit has not run out. This was found on #61 and deferred there.
3. The same trust rule can be stored twice
Migration 000017 keys faucet_workload_trusts by rule_hash, which is sha256(jsonb_send(...)). jsonb_send keeps a number's scale, so a pasted key set that writes 1 in one copy and 1.0 in another yields two rule IDs instead of one.
- Why it is not a bug today: both rules work and match the same tokens.
faucet clients trustsjust lists one extra rule. - Where it is documented: the store contract in
faucet/oauth/store.godescribes this behaviour, and the fake store matches it. - Fix, if wanted: normalise numbers before hashing. This was found on #63.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
- 主要语言
- Go
- 星标
- 1
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/faucet 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 28/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 30/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
slavakurilyak/awesome-ai-agents#1026 ·
-
GetBatchResponseById panics for items without a body (204/302) and for unknown ids可能已有人在做 @0z5a 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 80/100
JuliusBrussee/caveman#1567 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
bug postgresql
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复