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

[bug] Session traces persist API credentials in plaintext headers

已关闭
#118 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
security

调研方向

Start at buildTraceRecord and cloneRequestHeaders, then inspect FetchHttpTransport and SessionTraceStore, using the isolated production-transport regression test described in the issue. Verify that persisted trace JSON redacts authorization, x-api-key, and response cookies across header casing, response status, and streaming mode while credentials still reach the endpoint.

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

描述

Version and environment

main at 87c344501f5960cda6bf9f47eec5af0a4664cdba (1.0.0), Node.js 26.8.1, macOS 26.5.2 arm64.

Reproduction
  1. Create a FetchHttpTransport with a real SessionTraceStore targeting a temporary storage root.
  2. Send a request with complete trace metadata and dummy authorization: Bearer fake-key-for-regression-only / x-api-key: fake-anthropic-key headers. Mock only the fetch response; do not use real credentials or call a model endpoint.
  3. Read the generated sessions/s1/trace/span1.json.
  4. Both dummy credentials appear verbatim in request.headers.
Expected behavior

Authentication credentials should reach the model endpoint but be redacted from persisted diagnostic headers, regardless of header-name casing, response status, or streaming mode.

Actual behavior and cause

buildTraceRecord copies request headers with cloneRequestHeaders without redaction. OpenAI-compatible requests contain a bearer token and Anthropic requests contain x-api-key. Session tracing is enabled by default in BUILTIN_CLI_DEFAULTS.

Trace files use mode 0600, so this is not a claim of unauthenticated remote access. The problem is that diagnostic files contain reusable API credentials and can disclose them if copied or shared. Response cookies should likewise be redacted from trace headers.

Verification

An isolated regression test using the production transport and filesystem trace store fails on current main because the saved JSON contains the dummy credential.

  • Searched existing issues and PRs for duplicates.
  • Read CONTRIBUTING.md.
主要语言
TypeScript
星标
654
派生
55
平均合并
1 天 20 小时
30 天内合并 PR
33

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

stepfun-ai/Step-Code 的其他 Issue

查看 stepfun-ai/Step-Code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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