Skip to content

security: Math.random used for structured logger sessionId #443

Description

@nanaf6203-bit

Summary

src/utils/structuredLogger.ts generates session IDs with Math.random(). If a session ID is later used as a correlation handle (e.g. for de-dup or signed audit events), this is unsafe.

Affected area

src/utils/structuredLogger.ts (sessionId = sess_${Date.now()}_${Math.random()…``)

Steps to reproduce / impact

An attacker who can guess the random component could collide sessions, potentially inserting correlated log events.

Expected behaviour

Use crypto.randomUUID() for session IDs.

Acceptance criteria

  • Replace sessionId generator.
  • Add a test asserting non-predictability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programpriority/p1P1 — high priority, fix soonsecuritySecurity issue or hardening opportunity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions