Skip to content

Conversation

@sydseter
Copy link
Collaborator

@sydseter sydseter commented Mar 7, 2025

This PR closes #3200.

This PR replaces imprecise “weak” terminology with more specific language (e.g., “predictable,” “broken,” “risky”), expands cryptographic guidance (e.g., forward-compliance, post-quantum, CBC-MAC pitfalls), and updates several titles, statuses, and references across weaknesses, tests, rules, demos, and documentation.

  • Refinement of terminology and titles to improve clarity and precision
  • Addition of detailed overviews, impacts, modes of introduction, and mitigations for various crypto weaknesses
  • Alignment of tests, rules, and demos to use the updated terminology

New terminology:

  • Insufficient:
    A protection or behavior exists but does not meet required strength or standards.
    Used for things that vary on a sliding scale like key length, entropy, iteration counts.
    “It’s there but not enough.”

  • Missing:
    A required protection or behavior is entirely absent.
    Used for things like missing HMAC, salt, certificate validation.
    “It’s not there at all.”

  • Incorrect:
    A protection is implemented, but done improperly.
    Used for logic flaws, misuse of cryptographic operations, or broken error handling.
    “It’s there but it’s wrong.”

  • Broken:
    The cryptographic primitive or mode is fundamentally insecure due to known attacks, regardless of implementation (e.g. disallowed or deprecated by NIST).
    Example: SHA-1, ECB mode.

  • Improper:
    A broad term used to cover missing, insufficient, or incorrect behavior.
    Acts as a wrapper for multiple failure types.

  • Risky:
    A configuration or usage is not formally disallowed (e.g. by NIST) but has reduced safety margins or known weaknesses under some conditions.
    Example: AES-CBC with PKCS#7, RSA PKCS#1 v1.5.

  • Weak (DO NOT USE):
    Ambiguous term discouraged in precise taxonomies.
    Avoid using it, as it can mean both broken or risky.

Here's how it applies to this PR:

Term Used In Applied To Examples
Insufficient Demo titles, Test titles Key size, Key length Cryptographic Key Generation With Insufficient Key Length
Uses of Insufficient Key Size in SecKeyCreateRandomKey
Insufficient Key Sizes (tests)
Broken Demo titles, Test titles Hashing algorithms, Encryption algorithms, Modes of operation Uses of Broken Hashing Algorithms in CommonCrypto
Broken Symmetric Encryption Algorithms
Broken Encryption Modes
Improper Weakness titles Catch-all for missing, incorrect, or insufficient implementation Improper Encryption
Improper Cryptographic Key Generation
Improper Hashing
Missing Not yet used in titles
Incorrect Not yet used in titles
Risky Not yet used in titles

Here's a summary of how I applied them to the specific components in this PR:

  • MASWE-0009: Improper Cryptographic Key Generation

    • MASTG-TEST-0208: Insufficient Key Sizes

      • MASTG-DEMO-0012: Cryptographic Key Generation With Insufficient Key Length
    • MASTG-TEST-0209: Insufficient Key Sizes

      • MASTG-DEMO-0011: Uses of Insufficient Key Size in SecKeyCreateRandomKey with r2
  • MASWE-0010: Improper Cryptographic Key Derivation

  • MASWE-0019: Risky Cryptography Implementations

  • MASWE-0020: Improper Encryption

    • MASTG-TEST-0221: Broken Symmetric Encryption Algorithms

      • MASTG-DEMO-0022: Uses of Broken Symmetric Encryption Algorithms in Cipher with semgrep
    • MASTG-TEST-0232: Broken Symmetric Encryption Modes

      • MASTG-DEMO-0023: Uses of Broken Encryption Modes in Cipher with semgrep
    • MASTG-TEST-0210: Broken Symmetric Encryption Algorithms

      • MASTG-DEMO-0018: Uses of Broken Encryption Algorithms in CommonCrypto with r2
  • MASWE-0021: Improper Hashing

    • MASTG-TEST-0211: Broken Hashing Algorithms

      • MASTG-DEMO-0015: Uses of Broken Hashing Algorithms in CommonCrypto with r2
      • MASTG-DEMO-0016: Uses of Broken Hashing Algorithms in CryptoKit with r2
  • MASWE-0023: Risky Padding

  • MASWE-0024: Improper Use of Message Authentication Code (MAC)

  • MASWE-0025: Improper Generation of Cryptographic Signatures

  • MASWE-0027: Improper Random Number Generation


Other changes include:

  • Addition concerning Symmetric encryption.
  • Additional advice on forward compliance with NIST.
  • Additional recommendation on the use of EdDSA with Edwards448.
  • Post-Quantum recommendations.
  • Additional recommendations concerning the use of a key-derivation key.
  • CSPRNG alignment with ASVS.
  • Additional recommendation when using CBC with MAC.
  • Attack related to CBC-MAC.
  • MASWE-0023:
    • Added RFC 4055 reference recommending RSASSA-PSS for signatures
    • Expanded on RFC 8017 and NIST SP 800-131A deprecation details
    • Refined wording around Bleichenbacher’s padding-oracle attack

@cpholguera cpholguera changed the title Cryptography Update Cryptographic Language (e.g. "weak") Mar 7, 2025
@sydseter
Copy link
Collaborator Author

@cpholguera What do you do with external links that return HTTP status 403 or 0, but that can be reached by human browsing?

@sydseter
Copy link
Collaborator Author

I am leaving the internal links as they are. It's ok to use the word "weak" as a general term when talking about a category of issues. My reaction and corrections is meant to make it more specific as to what we are talking about when we are referring to cryptographic concepts. A padding scheme can be predictable, the bit-size of an algorithm insufficient, input validation and crypto configuration, inappropriate or improper and so on.
I think it is better to rename the links as more MASWE gets defined. As I see it now, it isn't very problematic to leave it as it is.

@sydseter
Copy link
Collaborator Author

sydseter commented Mar 11, 2025

There is something not working with the MASTG-DEMO tests. The moment I started touching them, the matrix broke. So I am leaving them aside.

@cpholguera
Copy link
Collaborator

@cpholguera What do you do with external links that return HTTP status 403 or 0, but that can be reached by human browsing?

Is this about the GitHub action failing? You can add them to https://github.com/OWASP/owasp-mastg/blob/master/.github/workflows/config/url-checker-config.json

@cpholguera
Copy link
Collaborator

There is something not working with the MASTG-DEMO tests. The moment I started touching them, the matrix broke. So I am leaving them aside.

I just fixed the matrix. If you git pull origin master it should be fine again. Thanks for letting me know!

Copy link
Collaborator

@cpholguera cpholguera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick first pass for now, thanks a lot @sydseter!

@cpholguera
Copy link
Collaborator

Idea: maybe we could also build a glossary for these and other terms.

See:

@cpholguera cpholguera merged commit b0bdf09 into OWASP:master Jul 14, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarifying Cryptographic Language (e.g. "weak") in MASTG-TEST-0210 & MASTG-TEST-0211

5 participants