[bug] Session traces persist API credentials in plaintext headers
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
- 54
- Forks
- 20
- Avg merge
- 2h 58m
- Merged PRs (30d)
- 1
Contributor 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
-
status/needs-triage type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stepfun-ai/Step-Code#85 · 1 comment ·
-
status/needs-triage type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stepfun-ai/Step-Code#84 ·
-
status/needs-triage type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stepfun-ai/Step-Code#83 ·
-
status/needs-triage type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stepfun-ai/Step-Code#81 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
stepfun-ai/Step-Code#80 ·
All issues in stepfun-ai/Step-Code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
0xMiden/bridge-portal#132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·