Python

Python : Weak hashing algorithm

Overview

The hash function used is not secure. Its use may result in loss of data privacy.

Confidential data leak vulnerabilities rank third in the OWASP Top 10 2017 web application vulnerabilities.

Hash functions MD2, MD5, SHA1 have vulnerabilities. Finding collisions for MD2 and MD5 functions does not require significant resources; a similar problem was solved for SHA1. If these features are used to store valuable information (such as passwords), its confidentiality may be compromised.

The hash function used to store passwords, in addition to collision resistance, should not be too fast. This complicates the attack by exhaustive search. For this purpose, specialized hash functions have been developed: PBKDF2, bcrypt, scrypt.

Have user passwords stored on the server encrypted using an insecure hash function (such as MD5). Possible attack scenario:

  1. An attacker gains access to the encrypted password database.
  2. An attacker, using a hashing algorithm vulnerability, calculates a string for which the hashing algorithm gives the same value as for the user’s password.
  3. The attacker authenticates using the computed string.
CRITICAL

DerScanner Severity Score

Check your Python code for this vulnerability, free

Request a free pilot of DerScanner. We give you access and help with the first scan. It works in the cloud and on-premise.

Try it on your code, free

By submitting this form, I acknowledge that DerScanner may process my personal data I provided above for purposes explained above. More details about the processing.