Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#1,451 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
cli, security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.)

Ngôn ngữ chính
TypeScript
Star
812
Fork
123
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
97

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AltimateAI/altimate-code

Tất cả issue của AltimateAI/altimate-code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.