Skip to content

security: use OS RNG for session ID generation#347

Open
hongkongkiwi wants to merge 1 commit intoexpressvpn:mainfrom
hongkongkiwi:fix-pr14-session-rng
Open

security: use OS RNG for session ID generation#347
hongkongkiwi wants to merge 1 commit intoexpressvpn:mainfrom
hongkongkiwi:fix-pr14-session-rng

Conversation

@hongkongkiwi
Copy link

Replace the internal RNG for session ID generation with the operating system cryptographically secure random number generator (OsRng).

Session IDs are used for authentication and session management, making their unpredictability critical for security. The OS RNG provides better entropy guarantees than the local ChaCha20 RNG.

The wire module now exports a secure_random_session_id() function that uses OsRng directly, with a check to avoid reserved values (EMPTY/REJECTED).

Replace the internal RNG for session ID generation with the operating
system cryptographically secure random number generator (OsRng).

Session IDs are used for authentication and session management, making
their unpredictability critical for security. The OS RNG provides better
entropy guarantees than the local ChaCha20 RNG.

The wire module now exports a secure_random_session_id() function that
uses OsRng directly, with a check to avoid reserved values (EMPTY/REJECTED).
@hongkongkiwi hongkongkiwi requested a review from a team as a code owner January 28, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant