[bug] Session traces persist API credentials in plaintext headers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- security
Research direction
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.
Written by the indexing model from the issue text.
Description
Version and environment
main at 87c344501f5960cda6bf9f47eec5af0a4664cdba (1.0.0), Node.js 26.8.1, macOS 26.5.2 arm64.
Reproduction
- Create a
FetchHttpTransportwith a realSessionTraceStoretargeting a temporary storage root. - Send a request with complete trace metadata and dummy
authorization: Bearer fake-key-for-regression-only/x-api-key: fake-anthropic-keyheaders. Mock only the fetch response; do not use real credentials or call a model endpoint. - Read the generated
sessions/s1/trace/span1.json. - 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.
- Dominant language
- TypeScript
- Stars
- 471
- Forks
- 42
- Avg merge
- 18h 11m
- Merged PRs (30d)
- 22
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stepfun-ai/Step-Code
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
stepfun-ai/Step-Code#218 ·
Maintainers usually reply within 1 day
-
area/build bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#190 · 1 comment ·
Maintainers usually reply within 1 day
-
area/tools bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#186 · 1 comment ·
Maintainers usually reply within 1 day
-
area/tools bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#185 · 1 comment ·
Maintainers usually reply within 1 day
-
area/tools bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#184 · 1 comment ·
Maintainers usually reply within 1 day
All issues in stepfun-ai/Step-Code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Doist/todoist-cli#576 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 1/5 Under an hour Newbie friendliness 72/100
vercel-labs/skills#2370 ·
Maintainers usually reply within 1 day
-
🐛 Bug supabase/cli
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CopilotKit/aimock#491 ·
Maintainers usually reply within 1 day