Skip to content

Fix use of weak cryptographic hash function (MD5) - #5536

Open
apocalypse9949 wants to merge 1 commit into
hyperledger:mainfrom
apocalypse9949:MD-5
Open

Fix use of weak cryptographic hash function (MD5)#5536
apocalypse9949 wants to merge 1 commit into
hyperledger:mainfrom
apocalypse9949:MD-5

Conversation

@apocalypse9949

Copy link
Copy Markdown

What: Replaced the vulnerable MD5 hashing algorithm with the secure SHA256 algorithm in common/deliverclient/orderers/connection.go for the Endpoint.String() function. Also removed the unused "crypto/md5" import.
Reason: MD5 is a weak cryptographic hash function that is vulnerable to collision attacks. This means malicious actors could potentially generate an identical hash for a different endpoint certificate, leading to spoofed endpoints or misleading debug outputs, which poses a security risk in a system handling certificates.
Changed Switched the cryptographic hash function to sha256, which is a secure, modern hash function. The output continues to be correctly handled as a hexadecimal string by fmt.Sprintf("%X", hash), safely supporting the longer 64-character hash length. All unit tests successfully run.

Signed-off-by: apocalypse9949 <125962989+apocalypse9949@users.noreply.github.com>
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