Cryptography (CRJ)
Justin kan lese autensieringsdata for å få tilgang til interne eller eksterne ressurser, tjenester og andre systemer fordi de er lagret i et ukryptert format, eller lagret i kildekoden
The card is related to unencrypted storage of account credentials.
Scenario: Justin's Access to Unencrypted Credentials
Imagine a scenario where Justin accesses credentials for internal or external resources, services, and other systems because they are stored unencrypted or embedded in source code. This vulnerability arises due to:
- Unencrypted Storage of Credentials: Sensitive credentials are stored in plain text, making them easily accessible.
- Credentials Embedded in Source Code: Important credentials are hard-coded into the application’s source code, posing a significant security risk.
Example
Justin examines the source code of a publicly accessible repository for a web application and discovers hard-coded credentials for accessing its database. Additionally, he finds that the application stores API keys for external services in unencrypted configuration files. Using these credentials, Justin gains unauthorized access to the application's database and external services, compromising both the application and its integrated systems.
Threat Modeling
STRIDE
That scenario clearly maps to Information Disclosure in STRIDE.
The primary violation is exposure of sensitive credentials (database passwords, API keys, service credentials). Once Justin can read those secrets, he can then leverage them for further attacks (like Tampering, Elevation of Privilege, etc.), but the root threat is that information that should have been protected is disclosed in plaintext or source code.
What can go wrong?
Storing credentials in an unencrypted format or embedding them in source code can lead to unauthorized system access, data breaches, and potentially severe security incidents.
For more things that can go wrong, see the Common Attack Patterns related to this card in the table below.
What are we going to do about it?
- Avoid storing credentials in the source code. Instead, use secure vaults or environment variables for credential storage.
- Ensure all sensitive credentials are encrypted and securely managed, accessible only to authorized systems or personnel.
- Regularly audit and update credential management practices to prevent unauthorized access and exposure.
For detailed advice on how to mitigate threats related to the card, see the ASVS and OWASP Developer Guide requirements in the table below.
Mappings
OWASP ASVS (v5.0): 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1-3,14.2.2,16.2.5,17.2.1
OWASP DevGuide: SC12,SQ6,SQ7,SDA3,ACM8,SCM6,SCM7,PDR1
STRIDE: Information Disclosure
CAPEC Map
| Code | Title | ASVS |
|---|---|---|
| 37 | Retrieve Embedded Sensitive Data | 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1,13.3.2,13.3.3 |
| 57 | Utilizing REST's Trust in the System Resource to Obtain Sensitive Data | 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1,13.3.2,13.3.3 |
| 155 | Screen Temporary Files for Sensitive Information | 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1,13.3.2,13.3.3,16.2.5 |
| 204 | Lifting Sensitive Data Embedded in Cache | 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1,13.3.2,13.3.3,14.2.2 |
| 474 | Signature Spoofing by Key Theft | 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1,13.3.2,13.3.3,17.2.1 |
| 639 | Probe System Files | 11.1.1,11.1.2,11.1.3,11.1.4,13.1.4,13.3.1,13.3.2,13.3.3 |