MCP/API setup copies force `http://` base URLs that embed personal Bearer tokens
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/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ệ
- go, javascript
- Lĩnh vực
- api, authentication, security
Hướng nghiên cứu
Bắt đầu tại web/app/access.js, ở getPublicBaseURL() và các mẫu MCP, REST có chứa token; web/app.js cung cấp tên máy chủ, còn internal/httpapi/studio.go chèn tên này. Đọc hướng dẫn về proxy ngược HTTPS khi triển khai và theo dõi cách scheme của trang được đưa vào các URL đã sao chép. Công việc hoàn tất khi các triển khai an toàn tạo HTTPS trong mọi URL thiết lập có chứa token và một bài kiểm thử tập trung bao quát việc chọn scheme.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Access / MCP onboarding builds public base URLs with a hard-coded http:// scheme and interpolates the user’s newly created personal Bearer token into MCP JSON, curl samples, and one-click agent prompts. On deployments that terminate TLS at a reverse proxy while the studio page is reached over HTTPS, following those copied instructions sends long-lived API/MCP tokens in cleartext over HTTP.
Affected code (head c7114fca)
| Location | What the code does |
|---|---|
web/app/access.js |
getPublicBaseURL() always returns 'http://' + domain — no location.protocol, no HTTPS branch |
web/app/access.js |
Module-level PUBLIC_BASE_URL likewise prefixes http:// |
web/app/access.js |
accessMcpClientSpec / accessMcpAgentPrompt embed base + Bearer ${token} |
web/app/access.js |
REST setup: AGENTFLOW_URL=${base} and curl with Bearer token |
web/app/access.js |
MCP tab: same base + token in prompt, manual mcp.json, and curl tools/list |
web/app/access.js |
Token reveal: MCP client spec / agent prompt rebuilt with getPublicBaseURL() + revealed token |
web/app.js |
Domain from <meta name="agentflow-app-domain"> (hostname, no scheme) |
internal/httpapi/studio.go |
stampStudioIndex injects AGENTFLOW_APP_DOMAIN / APP_DOMAIN as meta content (raw domain string) |
docs/deployment.md |
Documents HTTPS reverse proxy in front of the service; AGENTFLOW_SECURE_COOKIES=true when HTTPS terminates at the proxy |
.env.example |
Notes production HTTPS → AGENTFLOW_SECURE_COOKIES=true |
| Contrast | Runner bind copy prefers HTTPS first (deploy/bind-cli.sh); preview UI has HTTPS upgrade helpers in runs.js — Access onboarding does not |
Conditions
- User is logged in, opens Access (MCP / REST / Token reveal), and creates or reveals a personal token (
state.revealedToken). - UI copies snippets that set
AGENTFLOW_URL=http://<domain>(or MCPurl/ curl URL) andAuthorization: Bearer <token>usinggetPublicBaseURL(). - Deployment serves the studio over HTTPS at the edge while
AGENTFLOW_APP_DOMAIN/APP_DOMAINis a bare hostname (common TLS-terminated proxy layout per deployment docs). Backend may still speak HTTP to the proxy; that alone is fine — the issue is client instructions that force HTTP for token-bearing calls. - User (or an agent following the pasted prompt) executes the copied HTTP endpoint.
No special attacker role is required beyond the victim following their own Access copy flow (self-inflicted cleartext token transport). Risk materializes when those instructions leave the HTTPS studio context (local agent, curl on another host, MCP client config).
User copy / follow steps (expected misuse path — not captured)
- Open Access → MCP (or REST / create Token).
- Create token / use “生成并复制” so the prompt or
mcp.jsoncontains a real Bearer token. - Observe generated base: always
http://+ domain (static reading ofgetPublicBaseURL; nolocation.protocol). - Paste into Cursor/Claude/CodeBuddy/Codex or run the curl sample → client contacts
http://…with the Bearer token.
Not claimed: MitM observed on a wire, or that every deployment is HTTPS. Claim is: templates force HTTP, which is unsafe whenever the public entry is HTTPS / TLS-terminated.
Impact
- Cleartext exposure of long-lived personal API/MCP tokens on the path between client and the HTTP origin named in the snippet (MitM, captive portals, corporate proxies).
- Automated agents that follow the prompt will prefer the insecure endpoint.
- Mixed-content / confusing breakage is secondary; the security issue is token transport scheme.
Suggested fix
- Derive scheme from
window.location.protocol, or from a config/meta that may includehttps://(e.g. align withLOOPFORGE_PUBLIC_URL/ public URL scheme). - Never downgrade an HTTPS studio page to
http://for token-bearing endpoints. - Align Access/MCP copy with runner install guidance that already prefers HTTPS.
- Add a unit/UI test that locks scheme selection for token-bearing templates (HTTPS page must not emit
http://bases).
Acceptance criteria
- Token-bearing setup URLs use HTTPS whenever the studio page or configured public base is HTTPS.
- No Access/MCP generated snippet forces
http://for a secure deployment. - Focused test locks scheme selection for token templates.
- Issue text does not claim a packet capture unless one is separately recorded.
- Ngôn ngữ chính
- Go
- Star
- 141
- Fork
- 28
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 41
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 Tencent/LoopForge
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: 使用ssh key 支持所有gitĐang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: SOP 设计器「AI 编排助手」侧栏输入框叠住场景标签,标题按钮换行Có thể đã có người làm @Robert0622 đã nhận 1 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Tencent/LoopForge#134 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tencent/LoopForge#128 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Tencent/LoopForge
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
tomasz-tomczyk/crit#1159 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SelectOneHealthyInstance panics when instance weights are fractional (e.g. 0.5)Có thể đã có người làm @Ajax-1 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
nacos-group/nacos-sdk-go#929 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
google/osv-scanner#3270 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Batch JSON validation reports the wrong input indexCó thể đã có người làm @Dazhou-del đã nhận hôm nay. Đang mởtype/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
gin-gonic/gin#4928 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày