Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insecure Hash Algorithms #311

Open
sourabhkatti opened this issue Aug 6, 2018 · 0 comments
Open

Insecure Hash Algorithms #311

sourabhkatti opened this issue Aug 6, 2018 · 0 comments

Comments

@sourabhkatti
Copy link
Owner

Trace UUID: CGPQ-L8IQ-5ON4-X9MI

https://apptwo.contrastsecurity.com/Contrast/static/ng/index.html#/f7ea7169-d4eb-42c4-b32e-5c0ea0ca9733/vulns/CGPQ-L8IQ-5ON4-X9MI/overview

Description

The code:

jenkins.util.JSONSignatureValidator#verifySignature(), line 81

Risk

The hashing algorithm used, SHA1, has been found by researchers to be unsafe for protecting
sensitive data with today's technology.

Recommendation to fix this finding

Cryptography is hard. There are lots of little mistakes you can make in your cryptosystem that can leak information, or
worse - but choosing a known unsafe hashing algorithm can be a big mistake. This is why we wanted to alert you to the presence
of a hashing algorithm being used that doesn't meet our standards.

Obviously, there are lots of times when a hashing algorithm like MD5 or SHA-1 is used in a way that doesn't represent realistic
risk to your organization. However, if you find yourself needing to switch hashing algorithms, doing it in the code is
very easy; data migration is a much bigger problem. Here's code that gets a http://en.wikipedia.org/wiki/MD5$$LINK_DELIM$$MD5
digester, which is considered broken by today's standards because it's not nearly as collision-resistant as
once thought:

MessageDigest badDigester = MessageDigest.getInstance("MD5"); // Unsafe

The following code retrieves a http://en.wikipedia.org/wiki/SHA-2$$LINK_DELIM$$SHA-256 cipher, which is
considered much stronger for many reasons (including a 256-bit hash, which is less likely to fall victim
to a http://en.wikipedia.org/wiki/Birthday_attack$$LINK_DELIM$$birthday attack ):

MessageDigest safeDigester = MessageDigest.getInstance("SHA-256"); // Safe!

Attacks against unsafe digests are more than theoretical; undirected collisions can be found on an average laptop in a few
seconds. Directed collisions can be generated with relatively modest resources. That being said, all practical attacks would seem
to require cryptographers of rare quality and the resources of a mid-large sized organization. Therefore, you should carefully
decide how likely you are to face such an attack when estimating the severity of this issue.

There is a common saying in cryptography (attributed to the NSA), "Attacks always get better; they never get worse."
Make your cryptographic design accordingly!

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

No branches or pull requests

1 participant