Cisco has released a security bulletin warning that a move to strengthen passwords on some devices resulted in making passwords much easier to crack.
The vulnerability affects recently released versions of the IOS and IOS XE operating system that runs on Cisco routers and switches. The problem stems from Cisco's use of the Type 4 password algorithm in the operating system, and its failure to salt – add random bits to -- passwords or use PBKDF2, which randomizes passphrases and adds a salt, thus deriving a cryptographic key that's more difficult to crack.
"Due to an implementation issue, the Type 4 password algorithm does not use PBKDF2 and does not use a salt, but instead performs a single iteration of SHA-256 over the user-provided plaintext password," said the Cisco security warning. "This approach causes a Type 4 password to be less resilient to brute-force attacks than a Type 5 password of equivalent complexity."
[ Curious about Cisco's long-term game plan? Read Cisco CTO: Internet Of Everything Much More Than SDN. ]
The flaw affects only devices that have been upgraded to versions of IOS or IOS XE that support Type 4 passwords, and only affects those devices' "'enable secret' and 'username secret' commands," according to the security advisory. "No other Cisco IOS or IOS XE features use this algorithm to hash passwords or keys." Previous versions of IOS and IOS XE used the Type 5 algorithm.
Some caveats about the vulnerability: Cisco said that Type 4 passwords must have been purposefully generated, because no preexisting passwords on its devices would have been automatically updated. "There is no automatic conversion of existing Type 5 passwords to Type 4 passwords after upgrading a device to a Cisco IOS or Cisco IOS XE release that has support for Type 4 passwords," said Cisco.
To mitigate the vulnerability, Cisco recommends organizations search for any Type 4 passwords they've generated, and replace them with Type 5 passwords, which Cisco's devices do generate correctly.
The Type 4 password weaknesses were reported to Cisco on March 12 by security researcher Jens Steube, who's the developer behind the Hashcat advanced password recovery tool, as well as beta tester Philipp Schmidt. They worked with Cisco on a "coordinated disclosure," which the company made just six days after receiving the pair's notification.
For context, Cisco devices don't store plain-text passwords, but rather a cryptographic hash of a password. With any attempt to authenticate to a device, after the password gets entered, it's run through the same one-way cryptographic password hashing algorithm, and the result is compared to the known-good hash that's already been stored. If the two hashes match, the newly entered password is legitimate.
Password hashes are designed to be one-way operations, meaning the hash shouldn't be able to be decrypted to reveal the original input. But in the case of Cisco's Type 4 password algorithm implementation error, the password hash is insufficiently random, meaning that an attacker able to obtain a password hash could crack it.
"In my eyes, for such an important company, this is a big fail," Steube toldArs Technica about Cisco's password security fumble. "Nowadays everyone in the security/crypto/hash scene knows that password hashes should be salted, at least. By not salting the hashes we can crack all the hashes at once with full speed."
For example, Steube studied a Cisco Type 4 password hash -- "luSeObEBqS7m7Ux97dU4qPfW4iArF8KZI2sQnuwGcoU" -- that he found posted to an online forum as part of a configuration file and was able to quickly crack it.
The Type 4 approach that Cisco had intended to take was to add an 80-bit salt to a plain-text password, then run it through a SHA-256 hash algorithm 1,000 times to produce a password that's very difficult -- in terms of required computational power and speed -- to decrypt, should the hash be obtained. As noted, Cisco's implementation only ran the password through the SHA-256 hash once, failed to add a salt, and failed to use PBKDF2 to apply a pseudorandom function to further strengthen password security. That left the resulting password hash less secure than if it had been hashed using existing Cisco's Type 5 approach, which ran a password through 1,000 iterations of the MD5 hash function.
Going forward, Cisco said that it will discontinue using Type 4 passwords, and recommended users stick to Type 5 passwords for now. "Future Cisco IOS and Cisco IOS XE releases will not generate Type 4 passwords," it said. "However, to maintain backward compatibility, existing Type 4 passwords will be parsed and accepted. Customers will need to manually remove the existing Type 4 passwords from their configuration."
Stay tuned, however, for Cisco's preferred Type 4 replacement. "A new password type will be introduced: This new password type will implement the original design intended for Type 4 passwords, which is PBKDF2 with SHA-256, an 80-bit salt, and 1,000 iterations," said Cisco. "The exact type is yet to be determined."
InformationWeek is conducting a survey on security and risk management. Take the InformationWeek 2013 Strategic Security Survey today. Survey ends March 29.