-
Notifications
You must be signed in to change notification settings - Fork 17
[Feature request] Secure against length extension attacks #108
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Per folder SHA256 hashes can be potentially vulnerable to length extension attacks.
Describe the solution you'd like
- Change hash function to one that is resistant to length extension attacks
SHA-384andSHA-512/256exist. However the latter is difficult to canonicalize due to slash in the name (it is part of its official name). If speed or size is a concern, BLAKE3 is extremely fast and secure as well. - Add filesize in bytes when writing the hash and filename
This can work, and can be achieved with minimal code change. - Both of the above. It would be nice to have file sizes with the checksum for verification purposes. Also, even if the new hash has a length extension attack found, it will still be secure.
Describe alternatives you've considered
DO NOT
- use xxhash from the zstd file.
I thought about this possibility since it is already present, but xxhash64 as used in zstd is a very fast hash function with minimal
security guarantees. If we assume that somebody is manipulating the json.zst file and doing so with sufficient compute to actually launch a length extension attack this will not provide any further security.
Additional context
I consider OSCAR as an important part of the Data pipelines supply chain so I this the bar i hope OSCAR can clear.
I will be willing to further investigate potential hash functions, implementations and provide PRs if necessary.
Reference : oscar-project/documentation#13
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request