Safeguard
Application Security•

CWE-314 Cleartext Storage in the Windows Registry

Registry keys are easy to read, so passwords stored there in cleartext are easy to take. Learn how to check your software and where secrets should live instead.

Safeguard Security Team
2 min read

CWE-314 covers products that store sensitive information in cleartext in the registry. It mainly concerns Windows software that keeps its settings there.

How it happens

The registry is a convenient place for application settings, so credentials end up next to them. An installer asks for a service account password and saves it in a key. A sync tool remembers a login the same way.

MITRE says attackers can read the information by accessing the registry key. As with other cleartext entries, encoding is not protection: techniques exist to work out the encoding and decode the data.

The observed example is CVE-2005-2227, which involved cleartext passwords in a registry key.

What an attacker gains

The listed consequence is loss of confidentiality, by reading application data.

How to find it

The record lists no detection methods. Practical checks:

  • Export the keys your product creates and search the values for passwords, tokens and connection strings.
  • Review key permissions to see which accounts can read them.
  • Search source for registry write calls and check what values they store.

How to fix it

The record has no formal mitigations. Sound practice:

  1. Do not store passwords in the registry. Ask for credentials when needed, or use the operating system's credential facilities.
  2. If the product must keep a secret, encrypt it with an OS-provided mechanism so only the intended account can recover it.
  3. Restrict permissions on any key that holds sensitive settings.
  4. Migrate old installs by removing existing cleartext values during upgrade.

Quick check

Does a hidden or obscure key name protect the value?

No. Anyone who can read the registry can enumerate keys, so obscurity adds nothing.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.