Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower confidence for gcm-detection audit rule #3144

Merged
merged 1 commit into from
Oct 3, 2023
Merged

Conversation

p4p3r
Copy link
Collaborator

@p4p3r p4p3r commented Oct 3, 2023

This rule is an audit rule and reporting findings that are supposed to manually reviewed to exclude IV reuse.

@p4p3r p4p3r requested a review from a team October 3, 2023 08:56
@linear
Copy link

linear bot commented Oct 3, 2023

RULES-5417 gcm-detection false positive

A customer reported a potential false positive. I'm unable to determine the validity.

The finding is here.

Here is the rule:

rules:
  - id: gcm-detection
    metadata:
      category: security
      cwe:
        - "CWE-323: Reusing a Nonce, Key Pair in Encryption"
      references:
        - https://cwe.mitre.org/data/definitions/323.html
      technology:
        - java
      owasp:
        - A02:2021 - Cryptographic Failures
      subcategory:
        - vuln
      likelihood: MEDIUM
      impact: MEDIUM
      confidence: HIGH
      license: Commons Clause License Condition v1.0[LGPL-2.1-only]
      vulnerability_class:
        - Cryptographic Issues
    languages:
      - java
    message: GCM detected, please check that IV/nonce is not reused, an
      Initialization Vector (IV) is a nonce used to randomize the encryption, so
      that even if multiple messages with identical plaintext are encrypted, the
      generated corresponding ciphertexts are different. Unlike the Key, the IV
      usually does not need to be secret, rather it is important that it is
      random and unique. Certain encryption schemes the IV is exchanged in
      public as part of the ciphertext. Reusing same Initialization Vector with
      the same Key to encrypt multiple plaintext blocks allows an attacker to
      compare the ciphertexts and then, with some assumptions on the content of
      the messages, to gain important information about the data being
      encrypted.
    patterns:
      - pattern-either:
          - pattern: $METHOD.getInstance("AES/GCM/NoPadding",...);
          - pattern: new GCMParameterSpec(...);
    severity: INFO

Here is the code snippet:

AESCipher.java

@p4p3r p4p3r merged commit 5e029dd into develop Oct 3, 2023
7 of 8 checks passed
@p4p3r p4p3r deleted the claudio/rules-5417 branch October 3, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants