Workload identity: three small hardening gaps (act member types, key fetch limit past 64 issuers, duplicate trust rules)

Ouverte
#73 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@ThomasK33 y travaille déjà.

Depuis le 19/11/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

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 act after this check, and the token is signed by an issuer the operator trusts.
  • Fix: require iat, exp and nbf to be JSON numbers, and aud to 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 trusts just lists one extra rule.
  • Where it is documented: the store contract in faucet/oauth/store.go describes 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

Langage dominant
Go
Étoiles
1
Forks
0
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de coder/faucet

Toutes les issues de coder/faucet

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.