Cryptography (CR9)
Andy puede eludir los controles criptográficos porque las funciones de generación de números aleatorios, GUID o hashing son construidas internamente, riesgosas o débiles
The card is related to use of weak algorithms/functions, especially self-built ones.
Scenario: Andy's Bypassing of Weak Custom Cryptographic Functions
Consider a situation where Andy bypasses crucial cryptographic functions like random number generation, GUID generation, hashing, and encryption because they are self-built and inadequately secure. This issue arises from:
- Self-Built Cryptographic Functions: The application relies on custom-developed cryptographic functions, which may not meet industry security standards.
- Weaknesses in Custom Algorithms: These self-built functions are not as robust or tested as established cryptographic standards, making them vulnerable to exploitation.
Example
Andy targets a system that uses a custom-built encryption algorithm and a self-developed function for generating random numbers. He identifies weaknesses in these algorithms, such as predictable patterns in random number generation and flaws in the encryption process. Leveraging these vulnerabilities, Andy is able to predict supposedly random values and decrypt sensitive data, bypassing the intended security measures of the system.
Threat Modeling
STRIDE
The primary applicable STRIDE categories for this scenario is Information Disclosure or Tampering depending on the context.
- Andy may be able to undermine the integrity of the system’s protections (random numbers, GUIDs, hashing, encryption). By bypassing or breaking them, he can alter outcomes (predictable GUIDs, weakened encryption, manipulated “random” values). This is a failure of integrity which makes the primary impact: Tampering.
- Andy’s bypass of weak/random crypto may give him a "backdoor" in encrypted communication that allow him to see what information is being sent. In that case the main harm is loss of confidentiality, primary impact: Information Disclosure.
What can go wrong?
Reliance on weak, custom-built cryptographic functions can lead to compromised data security, unauthorized access, and potential breaches of sensitive information.
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?
- Replace custom cryptographic functions with well-established, industry-standard algorithms and libraries that have been rigorously tested and proven secure.
- Conduct regular security audits and reviews of cryptographic implementations to ensure they are strong and effective.
- Avoid developing in-house cryptographic solutions unless absolutely necessary and ensure they are developed by experts in cryptography.
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): 6.8.2,9.1.1,9.1.2,9.1.3,11.2.1,11.2.2,11.2.3,11.2.4,11.2.5,11.3.1,11.3.2,11.3.3,11.3.4,11.3.5,11.4.1,11.4.2,11.4.3,11.4.4,11.5.1,11.5.2,11.6.1,11.6.2,16.3.3
OWASP DevGuide: SM3,CP4,CP5,CP6
STRIDE: Spoofing,Tampering,Information Disclosure
CAPEC Map
| Code | Title | ASVS |
|---|---|---|
| 97 | Cryptanalysis | 11.2.1,11.2.2,11.2.3,11.2.4,11.2.5,11.3.1,11.3.2,11.3.3,11.3.4,11.3.5,11.4.1,11.4.2,11.4.3,11.4.4,11.5.1,11.5.2,11.6.1,11.6.2,16.3.3 |
| 112 | Brute Force | 11.2.1,11.2.2,11.2.3,11.2.4,11.2.5,11.3.1,11.3.2,11.3.3,11.3.4,11.3.5,11.4.1,11.4.2,11.4.3,11.4.4,11.5.1,11.5.2,11.6.1,11.6.2,16.3.3 |
| 461 | Web Services API Signature Forgery Leveraging Hash Function Extension Weakness | 11.2.2,11.2.5,11.3.1,11.3.2,11.3.3,11.3.5,11.4.1,16.3.3 |
| 473 | Signature Spoof | 6.8.2,9.1.1,9.1.2,9.1.3,11.2.1,11.2.2,11.2.3,11.2.4,11.2.5,11.3.1,11.3.2,11.3.3,11.3.4,11.3.5,11.4.1,11.4.2,11.4.3,11.4.4,11.5.1,11.5.2,11.6.1,11.6.2,16.3.3 |