Weak Cisco Password Encryption (Type 7)

Passwords in a Cisco device configuration are stored as type 7 values, a reversible encoding that anyone who obtains the configuration can decode instantly.

SeverityMedium
CVSS 3.16.8 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N Open in the calculator
CVSS 4.07.6 CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-261: Weak Encoding for Password
OWASP Top 10A04:2025 Cryptographic Failures
MITRE ATT&CKT1552.001 Credentials In Files, T1078 Valid Accounts
CategoryCryptographic Failures

Description

Cisco IOS and related platforms store some passwords in the device configuration as type 7 values, shown as password 7 or key 7 followed by a string of hexadecimal characters. Type 7 is applied by service password-encryption to passwords that would otherwise appear in clear text. It is a reversible encoding with a fixed, publicly known key, intended only to stop passwords being read by someone glancing at the configuration, and Cisco does not present it as protection against anyone who obtains the file.

Anyone who obtains a configuration file containing type 7 values can therefore recover the passwords in clear text: many offline tools and scripts decode these values immediately, and a device itself can be made to reveal them. This commonly gives administrative access to the device and, because network device passwords and shared keys are often reused, to other switches, routers, firewalls and authentication servers. Recovered RADIUS, TACACS+ and routing protocol keys can also help an attacker impersonate those services or interfere with routing. The attacker first needs a copy of the configuration, which limits the issue to those who can reach backups, file shares, management systems or the device, but configuration files are frequently found in such places.

The weakness is found when a configuration is reviewed, or recovered during testing from a backup, a TFTP or file server, a configuration management system or the device itself, and contains local user passwords, enable password, line passwords or keys for RADIUS, TACACS+, routing protocol authentication or VPN peers in type 7 form. Older type 5 (salted MD5) and type 4 values are also weak, though they must be cracked rather than decoded.

Remediation

  • Store local account and enable passwords as strong one-way hashes, using the scrypt-based type 9 (algorithm-type scrypt) or the PBKDF2-based type 8 (algorithm-type sha256) with the secret keyword of the enable and username commands, and remove any enable password lines and username entries configured with password.
  • For keys that the device must be able to recover, such as RADIUS and TACACS+ shared secrets, use the AES-based type 6 encryption where the platform supports it, by setting a master key with key config-key password-encrypt and enabling password encryption aes.
  • Use central authentication through TACACS+ or RADIUS with individual named accounts, keeping a single local emergency account with a strong hashed secret.
  • Change every password and key that has been stored as type 7, since it must be assumed known, and remove old configuration copies from backups, TFTP servers and file shares, or restrict access to them.
  • Keep service password-encryption enabled for any values that cannot yet be converted, as it still prevents casual viewing, but do not rely on it.

As an interim measure, restrict access to configuration backups and the systems that store them. Confirm the fix by reviewing the running configuration for remaining type 7 values and enable password entries, for example with show running-config | include password.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Network Services Findings

Every Network Services finding