Concurrent MCP OAuth token saves can lose credentials
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, typescript
- Ambito
- authentication, backend, security
Direzione di ricerca
The issue is in packages/coding-agent/src/step/mcp-oauth.ts. Look at the saveTokens method and the publish function. The repo already uses proper-lockfile for auth.json; examine how that lock is implemented. You'll need to apply a similar cross-process lock around the read-modify-write sequence for .credentials.json. Create a unique temporary file for the write before the atomic rename. Test by simulating concurrent OAuth token saves from two Step processes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
MCP OAuth token updates use an unlocked read-modify-write of .credentials.json. Both createStoredMcpOAuthProvider().saveTokens() and loginMcpServer().saveTokens() load the whole store, change one server entry, then rename a replacement file. Two Step processes saving different servers can both read the same old store; the second rename drops the first process's new token.
Steps to reproduce
Use one config root with two MCP servers and run two Step processes. Trigger both OAuth token saves concurrently. If both processes read the store before either rename, the final file contains only the update from the last writer. The relevant read/update and publish paths are synchronous but unguarded across processes.
Expected behavior
Lock the credential store across processes around reload, update, and publish, then release in finally. This repo already uses proper-lockfile for auth.json; its documented lock API supports retries and realpath: false for a missing target. The MCP SDK awaits saveTokens, so the provider can use an async lock. Use a unique temporary path for publication.
Version
main @ cb5fc1456d49d49c62e072bfed2926220083214e
AI-assisted report; source path checked against the stated commit.
- Lingua principale
- TypeScript
- Stelle
- 850
- Fork
- 62
- Merge medio
- 1g 9h
- PR unite (30g)
- 48
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 stepfun-ai/Step-Code
-
area/build bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#190 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
area/tools bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#186 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area/tools bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#185 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area/tools bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#184 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stepfun-ai/Step-Code#179 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di stepfun-ai/Step-Code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
QuantumNous/new-api#7839 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug p2 triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
getpaseo/paseo#7071 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
test: make the #3408 Claude OAuth token fixture obviously fake so secret scanners stop flagging itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
code-yeongyu/senpi#3436 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
lingdojo/kana-dojo#32505 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno