Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

security: `serve` has no Host allowlist, so a passwordless server answers DNS-rebinding pages

未关闭
#1,451 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
cli, security

调研方向

Start by reading server.ts around the password and browserOriginRefusal checks, then inspect the /altimate/* routes and the existing isTraceShaped list handling. The issue proposes a Host allowlist and also raises trace shape checking and prompt title exposure; agree on scope and expected behavior before implementation. Done means the chosen protections are covered by tests for allowed and refused hosts and the reported trace cases.

由索引模型根据 Issue 内容生成。

描述

Found during the v0.12.7 release review (CTO, tech lead and compliance reviewers). Deferred because it changes how every serve route is reached, not just this release's.

With no OPENCODE_SERVER_PASSWORD, basic auth is skipped (server.ts ~300) and browserOriginRefusal passes any request without an Origin header. A same-origin fetch after DNS rebinding sends no Origin and Sec-Fetch-Site: same-origin, so it gets through. The server never checks Host. Not verified with a live rebinding; read from the code.

This is the posture of every serve route, but #1415's /altimate/trace routes now serve prompts, SQL and query results, which raises the stakes.

Proposed: refuse any request whose Host isn't loopback (localhost, 127.0.0.1, [::1]) or the configured hostname, at least on /altimate/*.

Related, same routes:

  • GET /altimate/trace/:id/view doesn't shape-check the file like the list does (isTraceShaped), so a foreign JSON file named <id>.json renders a broken page (500) instead of a 404.
  • The list falls back to the raw first prompt as a trace's title (server.ts ~1301), so prompt text appears in list JSON. Consider truncating it.

(v0.12.7 already adds a CSP to the viewer page so script in trace content can't call the API.)

主要语言
TypeScript
星标
812
派生
123
平均合并
1 天 11 小时
30 天内合并 PR
97

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AltimateAI/altimate-code 的其他 Issue

查看 AltimateAI/altimate-code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。