Skip to content

claude proxy: sslkeylog.log grows unbounded in every live run dir (and holds TLS secrets on disk) #1380

Open

Description

@Juliusolsson05

Found by review c of #1376 (the #1273 app half).

What: claude-code-headless starts mitmdump with MITMPROXY_SSLKEYLOGFILE=<run dir>/sslkeylog.log (packages/claude-code-headless/src/proxy/proxyServer.ts:229). Every TLS handshake appends its session secrets there.

  • Nothing rotates or caps the file.
  • Debug retention skips a live run directory (a fresh mtime), so the file grows for as long as the session lives.
  • This is the one remaining unbounded file in a live Claude run directory, now that claude-code-headless#64 bounds proxy-events.jsonl.

Evidence: a recorded run held sslkeylog.log at 48,777 bytes (261 lines, 52 handshakes' worth of the five TLS 1.3 secret labels) beside a 162 KB proxy-events.jsonl. So it's about 0.9 KB per handshake, forever, per live session. The secret values were not read.

Also: it's TLS session secrets in plaintext on disk. Anyone who can read the run directory can decrypt any captured traffic.

Decide:

  • (a) Drop the key log unless an explicit debug flag is set. It is only useful for decrypting a packet capture.
  • (b) Bound it (rotate, like the events file).

(a) removes both the growth and the secret-on-disk exposure.

🤖 Generated with Claude Code

Activity

  1. Juliusolsson05 commented on Sep 27, 2026

    @Juliusolsson05
    OwnerAuthor

    Package fix: claude-code-headless#67. All three reviewers are MERGE-READY. The app bump follows once #1376 merges. Residual: existing key-log files are NOT removed by this fix. 23 of 33 on the owner's machine sit in run dirs that debug retention never collects. That is tracked in #1385, and the one-time sweep awaits an owner decision.

    🤖 Generated with Claude Code

  2. added a commit that references this issue on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    class:C6-unboundedUnbounded growthprovider:claudeAffects Claude Code integrationsev:P2Real bug with a workaroundtype:bugSomething works wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions