Skip to content

fix(cli): use cryptographically secure random for mcp session tokens#2087

Merged
bpamiri merged 1 commit intodevelopfrom
peter/fix-mcp-session-token-randomness
Apr 10, 2026
Merged

fix(cli): use cryptographically secure random for mcp session tokens#2087
bpamiri merged 1 commit intodevelopfrom
peter/fix-mcp-session-token-randomness

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 10, 2026

Summary

  • Replace createUUID() (type-1, timestamp+MAC based, predictable) with java.util.UUID.randomUUID() (type-4, SecureRandom-backed) in MCP session ID generation
  • Defense-in-depth hardening -- MCP endpoint is already localhost-restricted in dev mode, but session tokens should not be guessable regardless

Test plan

  • Verified test suite results identical before/after (2448 pass, 9 fail, 208 errors -- all failures pre-existing $SIMPLELOCK/GET infrastructure issues)
  • Single-line change, no behavioral difference (still produces mcp-<uuid> format string)
  • java.util.UUID.randomUUID() is available on all CFML engines (Lucee, Adobe CF, BoxLang) via underlying JVM

🤖 Generated with Claude Code

Replace createUUID() (type-1, timestamp-based) with java.util.UUID.randomUUID()
(type-4, SecureRandom-backed) for defense-in-depth on session ID generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bpamiri bpamiri merged commit 8a3f635 into develop Apr 10, 2026
3 checks passed
@bpamiri bpamiri deleted the peter/fix-mcp-session-token-randomness branch April 10, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant