Nuke icon indicating copy to clipboard operation
Nuke copied to clipboard

Update SHA1 to SHA256

Open myersjac opened this issue 1 year ago • 4 comments

Updating the Data Cache to utilize a more up-to-date with security standards hashing algorithm.

Tests have also been updated to utilize and confirm the functionality. All Tests passing

As an employee of a large corporation, I would love to utilize this library to load images as it is very performant. Unfortunately, based on our corporate security standards, we are unable to use this framework as it stands because it contains usage of an insecure hash function. This PR's goal is to update that hash function from SHA1 to SHA256, allowing it to adhere to current security standards and will make it so that it does not get flagged as a vulnerability within static scans of the framework

myersjac avatar Oct 17 '24 19:10 myersjac

Screenshot 2024-10-17 at 3 48 11 PM

myersjac avatar Oct 17 '24 19:10 myersjac

Is there a performance difference when switching to sha256? How big?

Is the hash even used for securing anything here? Those types of corporate policies are usually for password hashing.

fabianfabian avatar Oct 29 '24 23:10 fabianfabian

Hey, I just wanted to say that I saw the PR, and I agree that it's fair concern as .sha1 is now considered "Insecure". But I do share the same concerns as @fabianfabian. I begrudgingly switched from md5 to (slower) sha1 in one of the previous releases, and sha256 will likely be slower still.

Is the hash even used for securing anything here?

No, but this type of tooling typically doesn't care.

I've been thinking about switching to an SQLite-based cache that wouldn't require hashing.

kean avatar Oct 30 '24 00:10 kean

Yeah, from what I understood from the code itself there aren't any actual security concerns with this.

It's only an issue for me as because it's included within the framework, and that gets picked up in the static scan that we run for security vulnerabilities.

I believe our use case doesn't utilize this part of the code even, but our company's security policy is really strict that the inclusion of using SHA1 for something is not acceptable.

We would love to use this framework as it's been extremely performant, but as it stands we can't because of the use of SHA1.

Regardless, do whatever you think is best for it. 👍

myersjac avatar Oct 30 '24 00:10 myersjac