Skip to content

Commit 6ff4438

Browse files
committed
use-of-blowfish-java
1 parent b679216 commit 6ff4438

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
id: use-of-blowfish-java
2+
language: java
3+
severity: info
4+
message: >-
5+
Use of Blowfish was detected. Blowfish uses a 64-bit block size
6+
that makes it vulnerable to birthday attacks, and is therefore considered
7+
non-compliant. Instead, use a strong, secure cipher:
8+
Cipher.getInstance("AES/CBC/PKCS7PADDING"). See
9+
https://owasp.org/www-community/Using_the_Java_Cryptographic_Extensions
10+
for more information.
11+
note: >-
12+
[CWE-327] Use of a Broken or Risky Cryptographic Algorithm
13+
[REFERENCES]
14+
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
15+
- https://googleprojectzero.blogspot.com/2022/10/rc4-is-still-considered-harmful.html
16+
rule:
17+
pattern: $CIPHER.getInstance("Blowfish")
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
id: use-of-blowfish-java
2+
snapshots:
3+
? |
4+
Cipher.getInstance("Blowfish");
5+
: labels:
6+
- source: Cipher.getInstance("Blowfish")
7+
style: primary
8+
start: 0
9+
end: 30
10+
? |
11+
useCipher(Cipher.getInstance("Blowfish"));
12+
: labels:
13+
- source: Cipher.getInstance("Blowfish")
14+
style: primary
15+
start: 10
16+
end: 40
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id: use-of-blowfish-java
2+
valid:
3+
- |
4+
Cipher.getInstance("AES/CBC/PKCS7PADDING");
5+
invalid:
6+
- |
7+
Cipher.getInstance("Blowfish");
8+
- |
9+
useCipher(Cipher.getInstance("Blowfish"));

0 commit comments

Comments
 (0)