Concurrent MCP OAuth token saves can lose credentials
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- authentication, backend, security
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 850
- Fork
- 62
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stepfun-ai/Step-Code
-
area/build bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#190 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/tools bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#186 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/tools bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#185 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area/tools bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#184 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
stepfun-ai/Step-Code#179 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stepfun-ai/Step-Code
Issue tương tự
-
Create/import wallet form shows raw "password must be at least 1 characters" instead of the translated messageCó thể đã có người làm @CapThunder19 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
joinmarket-webui/jam#1538 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
t0ggles
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
nolimits4web/swiper#8240 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/inspector#2723 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:approved type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
egdev6/quorb#109 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày