This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "Password Plaintext Storage"
Weilin Zhong (talk | contribs) |
Weilin Zhong (talk | contribs) (Added contents provided by Fortify.) |
||
Line 1: | Line 1: | ||
+ | {{Template:Fortify}} | ||
+ | |||
{{Template:Vulnerability}} | {{Template:Vulnerability}} | ||
+ | |||
+ | ==Abstract== | ||
+ | |||
+ | Storing a password in plaintext may result in a system compromise. | ||
==Description== | ==Description== | ||
+ | |||
+ | Password management issues occur when a password is stored in plaintext in an application's properties or configuration file. A programmer can attempt to remedy the password management problem by obscuring the password with an encoding function, such as base 64 encoding, but this effort does not adequately protect the password. | ||
+ | |||
+ | Storing a plaintext password in a configuration file allows anyone who can read the file access to the password-protected resource. Developers sometimes believe that they cannot defend the application from someone who has access to the configuration, but this attitude makes an attacker's job easier. Good password management guidelines require that a password never be stored in plaintext. | ||
==Examples == | ==Examples == | ||
+ | |||
+ | The following code reads a password from a properties file and uses the password to connect to a database. | ||
+ | |||
+ | <pre> | ||
+ | ... | ||
+ | Properties prop = new Properties(); | ||
+ | prop.load(new FileInputStream("config.properties")); | ||
+ | String password = prop.getProperty("password"); | ||
+ | |||
+ | DriverManager.getConnection(url, usr, password); | ||
+ | ... | ||
+ | <pre> | ||
==Related Threats== | ==Related Threats== | ||
Line 12: | Line 34: | ||
==Related Countermeasures== | ==Related Countermeasures== | ||
+ | |||
+ | [[Password Management Countermeasure]] | ||
==Categories== | ==Categories== | ||
Line 18: | Line 42: | ||
[[Category:Sensitive Data Protection Vulnerability]] | [[Category:Sensitive Data Protection Vulnerability]] | ||
+ | |||
+ | [[Category:Java]] | ||
+ | |||
+ | [[Category:Code Snippet]] |
Revision as of 15:44, 18 July 2006
This is a Vulnerability. To view all vulnerabilities, please see the Vulnerability Category page.
Abstract
Storing a password in plaintext may result in a system compromise.
Description
Password management issues occur when a password is stored in plaintext in an application's properties or configuration file. A programmer can attempt to remedy the password management problem by obscuring the password with an encoding function, such as base 64 encoding, but this effort does not adequately protect the password.
Storing a plaintext password in a configuration file allows anyone who can read the file access to the password-protected resource. Developers sometimes believe that they cannot defend the application from someone who has access to the configuration, but this attitude makes an attacker's job easier. Good password management guidelines require that a password never be stored in plaintext.
Examples
The following code reads a password from a properties file and uses the password to connect to a database.
... Properties prop = new Properties(); prop.load(new FileInputStream("config.properties")); String password = prop.getProperty("password"); DriverManager.getConnection(url, usr, password); ... <pre>Related Threats
Related Attacks
Related Vulnerabilities
Related Countermeasures
Password Management Countermeasure
Categories
This article is a stub. You can help OWASP by expanding it or discussing it on its Talk page.