Skip to content

Conversation

@ekuboo100
Copy link
Contributor

Fix the problem, replace the use of MD5 with a strong cryptographic hash function, such as SHA-256, for hashing the session ID. This change should be made in the new_store_file method, where the hash is computed for the session ID. Specifically, replace require 'digest/md5' and Digest::MD5.hexdigest(session_id)[0,16] with require 'digest' and Digest::SHA256.hexdigest(session_id)[0,16]. This ensures that a strong hash function is used, reducing the risk of collisions and improving security. No other changes are needed, as the hash is still truncated to 16 characters for filename purposes.

@hsbt hsbt merged commit 6d17d61 into ruby:master Aug 18, 2025
34 checks passed
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.

2 participants