Non-encrypted confidential information - Credentials
Description
The passwords are in plain text in the source code of the application allowing an attacker to view it without any encryption.
Impact
Obtain sensitive information to compromise resources or services
Recommendation
Verify that sensitive information, API keys and passwords are not included in the source code, nor in online code repositories.
Threat
Authenticated attacker from the Internet with access to the source code
Expected Remediation Time
⌚ 120 minutes.
Score
Default score using CVSS 3.1. It may change depending on the context of the vulnerability.
Base
- Attack vector: N
- Attack complexity: L
- Privileges required: L
- User interaction: N
- Scope: U
- Confidentiality: L
- Integrity: N
- Availability: N
Temporal
- Exploit code madurity: P
- Remediation level: U
- Report confidence: C
Result
- Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N/E:P/RL:U/RC:C
- Score:
- Base: 4.3
- Temporal: 4.1
- Severity:
- Base: Medium
- Temporal: Medium
Code Examples
Compliant code
There are no sensitive access credentials stored in the source code
DirectoryEntry de = new DirectoryEntry();
de.Path = "serverPath";
de.AuthenticationType = AuthenticationTypes.SFTP;
de(path, username, encryptedPass);
Non compliant code
Some credentials are stored as plain text in the source code
password = "PlainPassword"
DirectoryEntry de = new DirectoryEntry();
de.Path = "serverPath";
de.AuthenticationType = AuthenticationTypes.None;
de(path, username, password);
Requirements
- 134. Store passwords with salt
- 135. Passwords with random salt
- 185. Encrypt sensitive information
- 229. Request access credentials
- 264. Request authentication
- 300. Mask sensitive data
Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.