Skip to content

fix(status-server): stop sending ACAO:* on unauthenticated read responses - #3137

Merged
huangruiteng merged 1 commit into
mainfrom
codex/security-serve-status-cors
Aug 12, 2026
Merged

fix(status-server): stop sending ACAO:* on unauthenticated read responses#3137
huangruiteng merged 1 commit into
mainfrom
codex/security-serve-status-cors

Conversation

@huangruiteng

Copy link
Copy Markdown
Owner

What

loopx serve-status sent Access-Control-Allow-Origin: * on every JSON response, including unauthenticated read routes. While the server is running, any website the operator visits could fetch() control-plane state and private repo Markdown cross-origin without interaction.

Change

  • New cors_response_headers(origin): only loopback browser origins are echoed; foreign origins and non-browser clients (no Origin header) receive no ACAO header, so browsers block cross-origin reads.
  • _send_json and do_OPTIONS now use this helper instead of hardcoding *.
  • Write endpoints keep their existing is_loopback_origin checks.

Validation

  • tests/test_status_server_cors.py: 7 new tests (unit: loopback echo, foreign reject, no-Origin; integration: /healthz without Origin, foreign Origin, loopback Origin) - all pass.
  • tests/test_status_server_extension_projection.py passes.
  • py_compile clean.

Addresses GHSA-vx2m-gpq4-8j5q and GHSA-p7c9-q3rc-f4f5 (details kept private pending coordinated disclosure).

…nses

serve-status sent Access-Control-Allow-Origin: * on every JSON response,
so any website the operator visits could read control-plane state and
private repo Markdown while the server was running. Only loopback
browser origins may read responses cross-origin now; foreign origins
and non-browser clients receive no ACAO header. Write endpoints keep
their existing is_loopback_origin checks.

Addresses GHSA-vx2m-gpq4-8j5q and GHSA-p7c9-q3rc-f4f5.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

中文结论

精确评审头: 3137@2d3b5931b(codex/security-serve-status-cors)

serve-status 读接口不再发送 Access-Control-Allow-Origin: *,仅对 loopback Origin 回显;写接口原有 origin 校验保留。exact head 上 7 项新增 CORS 测试(含真实 HTTP 集成)+ 既有 extension-projection 测试全部通过,py_compile 干净。CI pytest 变红为 main 基线问题(干净 main 同样失败 9 个真实模型测试),与本 PR 无关。

结论:APPROVE(author-owned,GitHub 阻止正式 self-approve,以评论记录)。

English Verdict

APPROVE — exact head 2d3b5931b. serve-status read responses no longer send ACAO: *; loopback origins are echoed, foreign origins get no CORS header. 7 new tests plus existing extension-projection tests pass; CI pytest red is a confirmed baseline failure, unrelated to this change.

@huangruiteng
huangruiteng merged commit 838720f into main Aug 12, 2026
4 of 5 checks passed
@huangruiteng
huangruiteng deleted the codex/security-serve-status-cors branch August 12, 2026 16:01
huangruiteng added a commit that referenced this pull request Aug 12, 2026
Security hardening release: fixes GHSA-2225/GHSA-c42j/GHSA-hfmf/
GHSA-vx2m/GHSA-p7c9 via #3137-#3140, caller-approved completion
validation (#3142), and the durable-smoke review gate (#3134).
huangruiteng added a commit that referenced this pull request Aug 12, 2026
#3147)

Mark the fresh-project onboarding fixture done (GH-C87, #3093/#3103), bump release docs slices to v0.4.5, and add security-boundary (GH-C90) plus obligation-bound replan/evidence-read (GH-C91) fixtures. Reflect merged security fixes #3137-#3140, PR-review lenses #3123/#3134, replan evidence-log hardening #3100-#3106/#3112/#3135/#3144, and the landed React homepage #3098.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant