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

Cryptographic API Misuse Vulnerability #75

Open
lialon opened this issue Aug 7, 2024 · 0 comments
Open

Cryptographic API Misuse Vulnerability #75

lialon opened this issue Aug 7, 2024 · 0 comments

Comments

@lialon
Copy link

lialon commented Aug 7, 2024

Description:

In the "SecureSnaps/aescrypt.py" and "SecureSnaps/bfcrypt.py", I have identified security vulnerabilities about insecure cryptographic algorithm. Blowfish-ECB mode encryption is not semantically secure, which means it might cause information leakage. And Blowfish encryption is vulnerable to Sweet32 attack. AES-CBC with hardcode IV is insecure too.

Location:

https://github.com/NITDgpOS/SecureSnaps/blob/master/aescrypt.py#L31

obj = AES.new(password, AES.MODE_CBC, 'This is an IV456')

https://github.com/NITDgpOS/SecureSnaps/blob/master/bfcrypt.py#L32

crypt_obj = Blowfish.new(password, Blowfish.MODE_ECB)

Reference

  • CWE-327: Use of a Broken or Risky Cryptographic Algorithm
  • **CWE-330: Use of Insufficiently Random Values **

Recommendate

  • Use other cipher mode such as CBC or CTR with random IV.
  • Generate IV with cryptographic secure PRNG.
  • Use other block cipher, for example, AES-128.
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