auth scoperesolver uses offset pagination during cache reload — same root cause as #8586
I maintainer di solito rispondono entro 1 giorno
@petemoore ci sta già lavorando.
Dal 7/5/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
While auditing call sites for the offset-pagination bug class fixed by #8587, I found that services/auth/src/scoperesolver.js:193-200 uses the same dangerous pattern:
let offset = 0;
while (true) {
const rows = await this.db.fns.get_clients(null, 1000, offset);
if (rows.length === 0) {
break;
} else {
offset += 1000;
}
// ... process clients
}
This loop walks the full clients table to rebuild the in-memory client cache used for scope resolution. Concurrent client inserts/deletes during the reload shift rows between pages, so a client can be silently skipped (or returned twice) — exactly the same offset-pagination race fixed in #8586/#8587 for the worker-scanner.
Severity
Lower than the worker-scanner case — this is an eventually-consistent cache, not a termination decision — but real:
- A skipped client briefly fails authentication for that client until the next reload.
- A duplicated client wastes work and slightly distorts the resolver's cache.
- The race repeats every reload cycle whenever clients are being created/expired during the same window.
Fix
Same shape as #8587: add a keyset-paginated DB function get_clients_after (in DB version 0126), then migrate the scoperesolver scan loop to use it via paginatedIterator from @taskcluster/lib-postgres. The existing get_clients will be marked deprecated, and the auth API handler (auth/src/api.js) and static-clients.js migrated to the new function as well.
Audit context
The full audit found six internal full-set scan loops in services/. Five are already safe (keyset, self-terminating, or DB-side single-call). This is the only remaining one with the offset-pagination race.
A separate follow-up will add an ESLint rule banning the offset-loop pattern to prevent regressions.
References
- Original bug: #8586
- Original fix (worker-scanner / provisioner): #8587
- Lingua principale
- JavaScript
- Stelle
- 436
- Fork
- 307
- Merge medio
- 1g 10h
- PR unite (30g)
- 94
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di taskcluster/taskcluster
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
taskcluster/taskcluster#9235 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
taskcluster/taskcluster#8622 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
taskcluster/taskcluster#9265 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
taskcluster/taskcluster#9203 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
taskcluster/taskcluster#9202 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di taskcluster/taskcluster
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
no-human-ai/no_human#659 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] Multi-day events show "Ended" while still in progressForse già presa @tarunagnihotri534 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
data-umbrella/du-event-board#231 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
IO.get_env on Node truncates names at embedded NULForse già presa @Yi-111-a l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
HigherOrderCO/Bend#1449 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
cryptpad/documentation#162 ·