gitlab.find_sec_bugs.PADDING_ORACLE-1

unknown
Download Count*
License

This specific mode of CBC with PKCS5Padding is susceptible to padding oracle attacks. An adversary could potentially decrypt the message if the system exposed the difference between plaintext with invalid padding or valid padding. The distinction between valid and invalid padding is usually revealed through distinct error messages being returned for each condition.

Run Locally

Run in CI

Defintion

rules:
  - id: find_sec_bugs.PADDING_ORACLE-1
    patterns:
      - pattern-inside: javax.crypto.Cipher.getInstance("...")
      - pattern-regex: (/CBC/PKCS5Padding)
      - pattern-not-regex: ^(RSA)/.*
      - pattern-not-regex: ^(ECIES)$
    message: >
      This specific mode of CBC with PKCS5Padding is susceptible to padding
      oracle attacks. An

      adversary could potentially decrypt the message if the system exposed the difference between

      plaintext with invalid padding or valid padding. The distinction between valid and invalid

      padding is usually revealed through distinct error messages being returned for each condition.
    languages:
      - java
    severity: ERROR
    metadata:
      category: security
      cwe: "CWE-696: Incorrect Behavior Order"
      technology:
        - java
      primary_identifier: find_sec_bugs.PADDING_ORACLE-1
      secondary_identifiers:
        - name: Find Security Bugs-PADDING_ORACLE
          type: find_sec_bugs_type
          value: PADDING_ORACLE
      license: MIT