HawkScan Test Info for Hash Disclosure - Mac OSX salted SHA-1

Hash Disclosure - Mac OSX salted SHA-1


Plugin Id: 10097


To remediate this vulnerability, the following steps can be taken:

  1. Upgrade to a more secure hashing algorithm: Since SHA-1 is considered weak and vulnerable to attacks, it is recommended to switch to a stronger hashing algorithm such as SHA-256 or bcrypt. This can be done by modifying the code that handles password hashing and updating it to use the new algorithm.

    Example code for updating password hashing to use bcrypt in PHP:

    // Before
    $hashedPassword = sha1($password);
    // After
    $hashedPassword = password_hash($password, PASSWORD_BCRYPT);
  2. Implement salting: Salting adds an extra layer of security to the hashing process by appending a unique random string (salt) to each password before hashing. This makes it harder for attackers to crack the passwords using precomputed tables or rainbow tables. The salt should be stored securely and separately from the hashed passwords.

    Example code for implementing salting in PHP:

    // Before
    $hashedPassword = sha1($password);
    // After
    $salt = generateRandomSalt();
    $hashedPassword = sha1($salt . $password);
  3. Regularly update and patch the operating system: Keeping the operating system up to date with the latest security patches is crucial to prevent vulnerabilities like this. Regularly check for updates and apply them promptly.


The vulnerability “Hash Disclosure - Mac OSX salted SHA-1” refers to a situation where the web server discloses the hashed passwords using the salted SHA-1 algorithm on a Mac OSX system. Hash disclosure occurs when the server inadvertently exposes the hashed passwords, making it easier for attackers to attempt cracking them.


The risks associated with this vulnerability include:

  • Password cracking: With access to the hashed passwords, attackers can use various techniques such as brute-force attacks or rainbow table lookups to crack the passwords and gain unauthorized access to user accounts.
  • Account takeover: Once an attacker successfully cracks a password, they can impersonate the user and gain unauthorized access to their account, potentially leading to data breaches, identity theft, or other malicious activities.
  • Reputation damage: If user passwords are compromised, it can severely damage the reputation and trustworthiness of the affected system or organization. Users may lose confidence in the security of their accounts and may choose to discontinue using the service.