Skip to content

Commit b62d49a

Browse files
committed
des-is-deprecated-kotlin
1 parent 126ec00 commit b62d49a

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
id: des-is-deprecated-kotlin
2+
severity: warning
3+
language: kotlin
4+
message: >-
5+
DES is considered deprecated. AES is the recommended cipher. Upgrade to
6+
use AES. See https://www.nist.gov/news-events/news/2005/06/nist-withdraws-outdated-data-encryption-standard
7+
for more information.
8+
note: >-
9+
[CWE-326] Inadequate Encryption Strength.
10+
[REFERENCES]
11+
- https://www.nist.gov/news-events/news/2005/06/nist-withdraws-outdated-data-encryption-standard
12+
rule:
13+
pattern: $CIPHER.getInstance($SAS)
14+
constraints:
15+
SAS:
16+
regex: "DES"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id: des-is-deprecated-kotlin
2+
snapshots:
3+
? |
4+
Cipher.getInstance("DES/ECB/PKCS5Padding");
5+
: labels:
6+
- source: Cipher.getInstance("DES/ECB/PKCS5Padding")
7+
style: primary
8+
start: 0
9+
end: 42
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
id: des-is-deprecated-kotlin
2+
valid:
3+
- |
4+
Cipher c = Cipher.getInstance("AES/GCM/NoPadding");
5+
invalid:
6+
- |
7+
Cipher.getInstance("DES/ECB/PKCS5Padding");

0 commit comments

Comments
 (0)