MCP/API setup copies force `http://` base URLs that embed personal Bearer tokens
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 75/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- go, javascript
- Domínio
- api, authentication, security
Direção de pesquisa
Comece em web/app/access.js, em getPublicBaseURL() e nos modelos de MCP e REST que contêm tokens; web/app.js fornece o nome do host, enquanto internal/httpapi/studio.go o injeta. Leia as orientações sobre proxy reverso HTTPS para implantação e acompanhe como o esquema da página chega às URLs copiadas. O trabalho estará concluído quando implantações seguras emitirem HTTPS em todas as URLs de configuração que contêm tokens e um teste específico cobrir a seleção do esquema.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 141
- Forks
- 28
- Merge médio
- 2d 15h
- PRs com merge (30d)
- 41
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Tencent/LoopForge
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
[Feature]: 使用ssh key 支持所有gitAbertaenhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 48/100
Mantenedores costumam responder em até 1 dia
-
[Bug]: SOP 设计器「AI 编排助手」侧栏输入框叠住场景标签,标题按钮换行Talvez já em andamento @Robert0622 assumiu há 1 dia. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
Tencent/LoopForge#134 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
Tencent/LoopForge#128 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de Tencent/LoopForge
Issues semelhantes
-
Support kubevirt CRDsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
rancher/rancher-ai-mcp#206 ·
Mantenedores costumam responder em até 1 dia
-
test: make command and stdio startup tests portableTalvez já em andamento @dajiaohuang assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
mark3labs/mcp-go#1220 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
open-telemetry/opentelemetry-go-compile-instrumentation#1743 ·
Mantenedores costumam responder em até 2 dias
-
FindInBatches panics for non-positive batch sizesTalvez já em andamento @Dazhou-del assumiu hoje. Abertatype:with reproduction steps
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia