Cryptography (CR9)

CRYPTOGRAPHY
9

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

How to play?

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:

  1. Self-Built Cryptographic Functions: The application relies on custom-developed cryptographic functions, which may not meet industry security standards.
  2. 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.

  1. 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.
  2. 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?

  1. Replace custom cryptographic functions with well-established, industry-standard algorithms and libraries that have been rigorously tested and proven secure.
  2. Conduct regular security audits and reviews of cryptographic implementations to ensure they are strong and effective.
  3. 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™: 97,112,461,473

SAFECode™: 14,20,21,29,32,33

CAPEC Map

ASVS (5.0) Cheat Sheet Series Index

Cryptographic Algorithm Attacks

Hash Collision Attacks

Encryption Bypass

OWASP Cornucopia

OWASP Cornucopia is a mechanism in the form of a card game to assist software development teams identify security requirements in Agile, conventional and formal development processes. It is language, platform and technology-agnostic, and is free to use. OWASP Cornucopia is licensed under the Creative Commons Attribution-ShareAlike 4.0 license, so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar licence to this one.

© 2012-2025 OWASP Foundation. The Open Worldwide Application Security Project (OWASP) is a nonprofit foundation that works to improve the security of software.