deepscan-cli 1.0.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +5 -0
- package/README.md +224 -61
- package/dist/bin/deepscan.js +189 -71
- package/dist/bin/deepscan.js.map +1 -1
- package/dist/{chunk-OSYJXVNF.js → chunk-4TWV5TES.js} +5130 -610
- package/dist/chunk-4TWV5TES.js.map +1 -0
- package/dist/index.d.ts +62 -5
- package/dist/index.js +13 -3
- package/package.json +38 -12
- package/rules/built-in/default-config.yml +28 -3
- package/rules/built-in/operations.yml +287 -0
- package/rules/built-in/security.yml +12 -6
- package/dist/chunk-OSYJXVNF.js.map +0 -1
- package/rules/built-in/converted-semgrep.yml +0 -37
- package/rules/built-in/semgrep-apex.yml +0 -336
- package/rules/built-in/semgrep-bash.yml +0 -362
- package/rules/built-in/semgrep-c.yml +0 -429
- package/rules/built-in/semgrep-clojure.yml +0 -166
- package/rules/built-in/semgrep-csharp.yml +0 -1260
- package/rules/built-in/semgrep-dart.yml +0 -21
- package/rules/built-in/semgrep-dockerfile.yml +0 -874
- package/rules/built-in/semgrep-elixir.yml +0 -146
- package/rules/built-in/semgrep-generic.yml +0 -2945
- package/rules/built-in/semgrep-go.yml +0 -2898
- package/rules/built-in/semgrep-hcl.yml +0 -8181
- package/rules/built-in/semgrep-html.yml +0 -94
- package/rules/built-in/semgrep-java.yml +0 -4219
- package/rules/built-in/semgrep-javascript.yml +0 -6243
- package/rules/built-in/semgrep-json.yml +0 -360
- package/rules/built-in/semgrep-kotlin.yml +0 -540
- package/rules/built-in/semgrep-lua.yml +0 -46
- package/rules/built-in/semgrep-ocaml.yml +0 -773
- package/rules/built-in/semgrep-php.yml +0 -1638
- package/rules/built-in/semgrep-python.yml +0 -11240
- package/rules/built-in/semgrep-regex.yml +0 -6444
- package/rules/built-in/semgrep-ruby.yml +0 -2687
- package/rules/built-in/semgrep-rust.yml +0 -278
- package/rules/built-in/semgrep-scala.yml +0 -807
- package/rules/built-in/semgrep-sh.yml +0 -46
- package/rules/built-in/semgrep-solidity.yml +0 -1046
- package/rules/built-in/semgrep-swift.yml +0 -200
- package/rules/built-in/semgrep-terraform.yml +0 -147
- package/rules/built-in/semgrep-typescript.yml +0 -6212
- package/rules/built-in/semgrep-xml.yml +0 -31
- package/rules/built-in/semgrep-yaml.yml +0 -2785
- package/rules/examples/custom-api-security.yml +0 -66
|
@@ -1,540 +0,0 @@
|
|
|
1
|
-
rules:
|
|
2
|
-
- id: detect-gemini
|
|
3
|
-
name: detect-gemini
|
|
4
|
-
description: 'Possibly found usage of AI: Gemini'
|
|
5
|
-
category: security
|
|
6
|
-
severity: low
|
|
7
|
-
confidence: medium
|
|
8
|
-
languages:
|
|
9
|
-
- kotlin
|
|
10
|
-
patterns:
|
|
11
|
-
- pattern: import com.google.ai
|
|
12
|
-
message: 'Possibly found usage of AI: Gemini'
|
|
13
|
-
- pattern: GenerativeModel(...)
|
|
14
|
-
message: 'Possibly found usage of AI: Gemini'
|
|
15
|
-
cwe: []
|
|
16
|
-
owasp: []
|
|
17
|
-
references:
|
|
18
|
-
- https://semgrep.dev/blog/2024/detecting-shadow-ai
|
|
19
|
-
tags:
|
|
20
|
-
- genAI
|
|
21
|
-
- LLMs
|
|
22
|
-
- id: contains-bidirectional-characters
|
|
23
|
-
name: contains-bidirectional-characters
|
|
24
|
-
description: >-
|
|
25
|
-
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left languages
|
|
26
|
-
such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a manner that is
|
|
27
|
-
different from how it is displayed in code editing and review tools. If this is not what you were expecting,
|
|
28
|
-
please review this code in an editor that can reveal hidden Unicode characters.
|
|
29
|
-
category: security
|
|
30
|
-
severity: medium
|
|
31
|
-
confidence: medium
|
|
32
|
-
languages:
|
|
33
|
-
- bash
|
|
34
|
-
- c
|
|
35
|
-
- csharp
|
|
36
|
-
- go
|
|
37
|
-
- java
|
|
38
|
-
- javascript
|
|
39
|
-
- json
|
|
40
|
-
- kotlin
|
|
41
|
-
- lua
|
|
42
|
-
- ocaml
|
|
43
|
-
- php
|
|
44
|
-
- python
|
|
45
|
-
- ruby
|
|
46
|
-
- rust
|
|
47
|
-
- scala
|
|
48
|
-
- sh
|
|
49
|
-
- typescript
|
|
50
|
-
- yaml
|
|
51
|
-
patterns:
|
|
52
|
-
- regex: .*
|
|
53
|
-
message: >-
|
|
54
|
-
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left
|
|
55
|
-
languages such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a
|
|
56
|
-
manner that is different from how it is displayed in code editing and review tools. If this is not what you
|
|
57
|
-
were expecting, please review this code in an editor that can reveal hidden Unicode characters.
|
|
58
|
-
cwe:
|
|
59
|
-
- CWE-94
|
|
60
|
-
owasp:
|
|
61
|
-
- A03:2021
|
|
62
|
-
- A05:2025
|
|
63
|
-
references:
|
|
64
|
-
- https://trojansource.codes/
|
|
65
|
-
tags:
|
|
66
|
-
- unicode
|
|
67
|
-
- id: des-is-deprecated
|
|
68
|
-
name: des-is-deprecated
|
|
69
|
-
description: >-
|
|
70
|
-
DES is considered deprecated. AES is the recommended cipher. Upgrade to use AES. See
|
|
71
|
-
https://www.nist.gov/news-events/news/2005/06/nist-withdraws-outdated-data-encryption-standard for more
|
|
72
|
-
information.
|
|
73
|
-
category: security
|
|
74
|
-
severity: medium
|
|
75
|
-
confidence: medium
|
|
76
|
-
languages:
|
|
77
|
-
- java
|
|
78
|
-
- kt
|
|
79
|
-
patterns:
|
|
80
|
-
- regex: .*
|
|
81
|
-
message: >-
|
|
82
|
-
DES is considered deprecated. AES is the recommended cipher. Upgrade to use AES. See
|
|
83
|
-
https://www.nist.gov/news-events/news/2005/06/nist-withdraws-outdated-data-encryption-standard for more
|
|
84
|
-
information.
|
|
85
|
-
cwe:
|
|
86
|
-
- CWE-326
|
|
87
|
-
owasp:
|
|
88
|
-
- A03:2017
|
|
89
|
-
- A02:2021
|
|
90
|
-
- A04:2025
|
|
91
|
-
references:
|
|
92
|
-
- https://www.nist.gov/news-events/news/2005/06/nist-withdraws-outdated-data-encryption-standard
|
|
93
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#algorithms
|
|
94
|
-
tags:
|
|
95
|
-
- java
|
|
96
|
-
- id: desede-is-deprecated
|
|
97
|
-
name: desede-is-deprecated
|
|
98
|
-
description: Triple DES (3DES or DESede) is considered deprecated. AES is the recommended cipher. Upgrade to use AES.
|
|
99
|
-
category: security
|
|
100
|
-
severity: medium
|
|
101
|
-
confidence: medium
|
|
102
|
-
languages:
|
|
103
|
-
- java
|
|
104
|
-
- kt
|
|
105
|
-
patterns:
|
|
106
|
-
- regex: .*
|
|
107
|
-
message: Triple DES (3DES or DESede) is considered deprecated. AES is the recommended cipher. Upgrade to use AES.
|
|
108
|
-
cwe:
|
|
109
|
-
- CWE-326
|
|
110
|
-
owasp:
|
|
111
|
-
- A03:2017
|
|
112
|
-
- A02:2021
|
|
113
|
-
- A04:2025
|
|
114
|
-
references:
|
|
115
|
-
- https://csrc.nist.gov/News/2017/Update-to-Current-Use-and-Deprecation-of-TDEA
|
|
116
|
-
tags:
|
|
117
|
-
- java
|
|
118
|
-
- id: rsa-no-padding
|
|
119
|
-
name: rsa-no-padding
|
|
120
|
-
description: Using RSA without OAEP mode weakens the encryption.
|
|
121
|
-
category: security
|
|
122
|
-
severity: medium
|
|
123
|
-
confidence: medium
|
|
124
|
-
languages:
|
|
125
|
-
- java
|
|
126
|
-
- kt
|
|
127
|
-
patterns:
|
|
128
|
-
- pattern: $CIPHER.getInstance("=~/RSA/[Nn][Oo][Nn][Ee]/NoPadding/")
|
|
129
|
-
message: Using RSA without OAEP mode weakens the encryption.
|
|
130
|
-
cwe:
|
|
131
|
-
- CWE-326
|
|
132
|
-
owasp:
|
|
133
|
-
- A03:2017
|
|
134
|
-
- A02:2021
|
|
135
|
-
- A04:2025
|
|
136
|
-
references:
|
|
137
|
-
- https://rdist.root.org/2009/10/06/why-rsa-encryption-padding-is-critical/
|
|
138
|
-
tags:
|
|
139
|
-
- java
|
|
140
|
-
- kotlin
|
|
141
|
-
- id: build-gradle-password-hardcoded
|
|
142
|
-
name: build-gradle-password-hardcoded
|
|
143
|
-
description: >-
|
|
144
|
-
A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and
|
|
145
|
-
other types of sensitive data, can be leaked and used by internal or external malicious actors. It is recommended
|
|
146
|
-
to rotate the secret and retrieve them from a secure secret vault or Hardware Security Module (HSM), alternatively
|
|
147
|
-
environment variables can be used if allowed by your company policy.
|
|
148
|
-
category: secrets
|
|
149
|
-
severity: medium
|
|
150
|
-
confidence: medium
|
|
151
|
-
languages:
|
|
152
|
-
- kotlin
|
|
153
|
-
patterns:
|
|
154
|
-
- regex: .*
|
|
155
|
-
message: >-
|
|
156
|
-
A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers,
|
|
157
|
-
and other types of sensitive data, can be leaked and used by internal or external malicious actors. It is
|
|
158
|
-
recommended to rotate the secret and retrieve them from a secure secret vault or Hardware Security Module
|
|
159
|
-
(HSM), alternatively environment variables can be used if allowed by your company policy.
|
|
160
|
-
cwe:
|
|
161
|
-
- CWE-798
|
|
162
|
-
owasp:
|
|
163
|
-
- A07:2021
|
|
164
|
-
- A07:2025
|
|
165
|
-
references:
|
|
166
|
-
- https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures
|
|
167
|
-
tags:
|
|
168
|
-
- secrets
|
|
169
|
-
- id: anonymous-ldap-bind
|
|
170
|
-
name: anonymous-ldap-bind
|
|
171
|
-
description: >-
|
|
172
|
-
Detected anonymous LDAP bind. This permits anonymous users to execute LDAP statements. Consider enforcing
|
|
173
|
-
authentication for LDAP. See https://docs.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html for more
|
|
174
|
-
information.
|
|
175
|
-
category: security
|
|
176
|
-
severity: medium
|
|
177
|
-
confidence: medium
|
|
178
|
-
languages:
|
|
179
|
-
- kt
|
|
180
|
-
patterns:
|
|
181
|
-
- pattern: |
|
|
182
|
-
$ENV.put($CTX.SECURITY_AUTHENTICATION, "none")
|
|
183
|
-
...
|
|
184
|
-
$DCTX = InitialDirContext($ENV, ...)
|
|
185
|
-
message: >-
|
|
186
|
-
Detected anonymous LDAP bind. This permits anonymous users to execute LDAP statements. Consider enforcing
|
|
187
|
-
authentication for LDAP. See https://docs.oracle.com/javase/tutorial/jndi/ldap/auth_mechs.html for more
|
|
188
|
-
information.
|
|
189
|
-
cwe:
|
|
190
|
-
- CWE-287
|
|
191
|
-
owasp:
|
|
192
|
-
- A02:2017
|
|
193
|
-
- A07:2021
|
|
194
|
-
- A07:2025
|
|
195
|
-
references:
|
|
196
|
-
- https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures
|
|
197
|
-
tags:
|
|
198
|
-
- kotlin
|
|
199
|
-
- id: bad-hexa-conversion
|
|
200
|
-
name: bad-hexa-conversion
|
|
201
|
-
description: >-
|
|
202
|
-
'Integer.toHexString()' strips leading zeroes from each byte if read byte-by-byte. This mistake weakens the hash
|
|
203
|
-
value computed since it introduces more collisions. Use 'String.format("%02X", ...)' instead.
|
|
204
|
-
category: security
|
|
205
|
-
severity: medium
|
|
206
|
-
confidence: medium
|
|
207
|
-
languages:
|
|
208
|
-
- kt
|
|
209
|
-
patterns:
|
|
210
|
-
- pattern: |-
|
|
211
|
-
fun $METHOD(...) {
|
|
212
|
-
...
|
|
213
|
-
val $MD: MessageDigest = ...
|
|
214
|
-
...
|
|
215
|
-
$MD.digest(...)
|
|
216
|
-
...
|
|
217
|
-
Integer.toHexString(...)
|
|
218
|
-
}
|
|
219
|
-
message: >-
|
|
220
|
-
'Integer.toHexString()' strips leading zeroes from each byte if read byte-by-byte. This mistake weakens the
|
|
221
|
-
hash value computed since it introduces more collisions. Use 'String.format("%02X", ...)' instead.
|
|
222
|
-
cwe:
|
|
223
|
-
- CWE-704
|
|
224
|
-
owasp:
|
|
225
|
-
- A03:2017
|
|
226
|
-
references:
|
|
227
|
-
- https://cwe.mitre.org/data/definitions/704.html
|
|
228
|
-
tags:
|
|
229
|
-
- kotlin
|
|
230
|
-
- id: command-injection-formatted-runtime-call
|
|
231
|
-
name: command-injection-formatted-runtime-call
|
|
232
|
-
description: >-
|
|
233
|
-
A formatted or concatenated string was detected as input to a java.lang.Runtime call. This is dangerous if a
|
|
234
|
-
variable is controlled by user input and could result in a command injection. Ensure your variables are not
|
|
235
|
-
controlled by users or sufficiently sanitized.
|
|
236
|
-
category: injection
|
|
237
|
-
severity: high
|
|
238
|
-
confidence: medium
|
|
239
|
-
languages:
|
|
240
|
-
- kt
|
|
241
|
-
patterns:
|
|
242
|
-
- pattern: $RUNTIME.exec($X + $Y)
|
|
243
|
-
message: >-
|
|
244
|
-
A formatted or concatenated string was detected as input to a java.lang.Runtime call. This is dangerous if a
|
|
245
|
-
variable is controlled by user input and could result in a command injection. Ensure your variables are not
|
|
246
|
-
controlled by users or sufficiently sanitized.
|
|
247
|
-
- pattern: $RUNTIME.exec(String.format(...))
|
|
248
|
-
message: >-
|
|
249
|
-
A formatted or concatenated string was detected as input to a java.lang.Runtime call. This is dangerous if a
|
|
250
|
-
variable is controlled by user input and could result in a command injection. Ensure your variables are not
|
|
251
|
-
controlled by users or sufficiently sanitized.
|
|
252
|
-
- pattern: $RUNTIME.loadLibrary($X + $Y)
|
|
253
|
-
message: >-
|
|
254
|
-
A formatted or concatenated string was detected as input to a java.lang.Runtime call. This is dangerous if a
|
|
255
|
-
variable is controlled by user input and could result in a command injection. Ensure your variables are not
|
|
256
|
-
controlled by users or sufficiently sanitized.
|
|
257
|
-
- pattern: $RUNTIME.loadLibrary(String.format(...))
|
|
258
|
-
message: >-
|
|
259
|
-
A formatted or concatenated string was detected as input to a java.lang.Runtime call. This is dangerous if a
|
|
260
|
-
variable is controlled by user input and could result in a command injection. Ensure your variables are not
|
|
261
|
-
controlled by users or sufficiently sanitized.
|
|
262
|
-
cwe:
|
|
263
|
-
- CWE-78
|
|
264
|
-
owasp:
|
|
265
|
-
- A01:2017
|
|
266
|
-
- A03:2021
|
|
267
|
-
- A05:2025
|
|
268
|
-
references:
|
|
269
|
-
- https://owasp.org/Top10/A03_2021-Injection
|
|
270
|
-
tags:
|
|
271
|
-
- kt
|
|
272
|
-
- id: cookie-missing-httponly
|
|
273
|
-
name: cookie-missing-httponly
|
|
274
|
-
description: >-
|
|
275
|
-
A cookie was detected without setting the 'HttpOnly' flag. The 'HttpOnly' flag for cookies instructs the browser
|
|
276
|
-
to forbid client-side scripts from reading the cookie. Set the 'HttpOnly' flag by calling
|
|
277
|
-
'cookie.setHttpOnly(true);'
|
|
278
|
-
category: security
|
|
279
|
-
severity: medium
|
|
280
|
-
confidence: medium
|
|
281
|
-
languages:
|
|
282
|
-
- kt
|
|
283
|
-
patterns:
|
|
284
|
-
- regex: .*
|
|
285
|
-
message: >-
|
|
286
|
-
A cookie was detected without setting the 'HttpOnly' flag. The 'HttpOnly' flag for cookies instructs the
|
|
287
|
-
browser to forbid client-side scripts from reading the cookie. Set the 'HttpOnly' flag by calling
|
|
288
|
-
'cookie.setHttpOnly(true);'
|
|
289
|
-
cwe:
|
|
290
|
-
- CWE-1004
|
|
291
|
-
owasp:
|
|
292
|
-
- A05:2021
|
|
293
|
-
- A02:2025
|
|
294
|
-
references:
|
|
295
|
-
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
|
|
296
|
-
tags:
|
|
297
|
-
- kt
|
|
298
|
-
- id: cookie-missing-secure-flag
|
|
299
|
-
name: cookie-missing-secure-flag
|
|
300
|
-
description: >-
|
|
301
|
-
A cookie was detected without setting the 'secure' flag. The 'secure' flag for cookies prevents the client from
|
|
302
|
-
transmitting the cookie over insecure channels such as HTTP. Set the 'secure' flag by calling
|
|
303
|
-
'$COOKIE.setSecure(true);'
|
|
304
|
-
category: security
|
|
305
|
-
severity: medium
|
|
306
|
-
confidence: medium
|
|
307
|
-
languages:
|
|
308
|
-
- kt
|
|
309
|
-
patterns:
|
|
310
|
-
- regex: .*
|
|
311
|
-
message: >-
|
|
312
|
-
A cookie was detected without setting the 'secure' flag. The 'secure' flag for cookies prevents the client
|
|
313
|
-
from transmitting the cookie over insecure channels such as HTTP. Set the 'secure' flag by calling
|
|
314
|
-
'$COOKIE.setSecure(true);'
|
|
315
|
-
cwe:
|
|
316
|
-
- CWE-614
|
|
317
|
-
owasp:
|
|
318
|
-
- A05:2021
|
|
319
|
-
- A02:2025
|
|
320
|
-
references:
|
|
321
|
-
- https://owasp.org/Top10/A05_2021-Security_Misconfiguration
|
|
322
|
-
tags:
|
|
323
|
-
- kt
|
|
324
|
-
- id: defaulthttpclient-is-deprecated
|
|
325
|
-
name: defaulthttpclient-is-deprecated
|
|
326
|
-
description: >-
|
|
327
|
-
DefaultHttpClient is deprecated. Further, it does not support connections using TLS1.2, which makes using
|
|
328
|
-
DefaultHttpClient a security hazard. Use SystemDefaultHttpClient instead, which supports TLS1.2.
|
|
329
|
-
category: security
|
|
330
|
-
severity: medium
|
|
331
|
-
confidence: medium
|
|
332
|
-
languages:
|
|
333
|
-
- kt
|
|
334
|
-
patterns:
|
|
335
|
-
- pattern: DefaultHttpClient(...)
|
|
336
|
-
message: >-
|
|
337
|
-
DefaultHttpClient is deprecated. Further, it does not support connections using TLS1.2, which makes using
|
|
338
|
-
DefaultHttpClient a security hazard. Use SystemDefaultHttpClient instead, which supports TLS1.2.
|
|
339
|
-
cwe:
|
|
340
|
-
- CWE-326
|
|
341
|
-
owasp:
|
|
342
|
-
- A03:2017
|
|
343
|
-
- A02:2021
|
|
344
|
-
- A04:2025
|
|
345
|
-
references:
|
|
346
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
|
|
347
|
-
tags:
|
|
348
|
-
- kotlin
|
|
349
|
-
- id: ecb-cipher
|
|
350
|
-
name: ecb-cipher
|
|
351
|
-
description: >-
|
|
352
|
-
Cipher in ECB mode is detected. ECB mode produces the same output for the same input each time which allows an
|
|
353
|
-
attacker to intercept and replay the data. Further, ECB mode does not provide any integrity checking. See
|
|
354
|
-
https://find-sec-bugs.github.io/bugs.htm#CIPHER_INTEGRITY.
|
|
355
|
-
category: crypto
|
|
356
|
-
severity: medium
|
|
357
|
-
confidence: medium
|
|
358
|
-
languages:
|
|
359
|
-
- kt
|
|
360
|
-
patterns:
|
|
361
|
-
- regex: .*
|
|
362
|
-
message: >-
|
|
363
|
-
Cipher in ECB mode is detected. ECB mode produces the same output for the same input each time which allows an
|
|
364
|
-
attacker to intercept and replay the data. Further, ECB mode does not provide any integrity checking. See
|
|
365
|
-
https://find-sec-bugs.github.io/bugs.htm#CIPHER_INTEGRITY.
|
|
366
|
-
cwe:
|
|
367
|
-
- CWE-327
|
|
368
|
-
owasp:
|
|
369
|
-
- A03:2017
|
|
370
|
-
- A02:2021
|
|
371
|
-
- A04:2025
|
|
372
|
-
references:
|
|
373
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
|
|
374
|
-
tags:
|
|
375
|
-
- kotlin
|
|
376
|
-
- id: gcm-detection
|
|
377
|
-
name: gcm-detection
|
|
378
|
-
description: >-
|
|
379
|
-
GCM detected, please check that IV/nonce is not reused, an Initialization Vector (IV) is a nonce used to randomize
|
|
380
|
-
the encryption, so that even if multiple messages with identical plaintext are encrypted, the generated
|
|
381
|
-
corresponding ciphertexts are different.Unlike the Key, the IV usually does not need to be secret, rather it is
|
|
382
|
-
important that it is random and unique. Certain encryption schemes the IV is exchanged in public as part of the
|
|
383
|
-
ciphertext. Reusing same Initialization Vector with the same Key to encrypt multiple plaintext blocks allows an
|
|
384
|
-
attacker to compare the ciphertexts and then, with some assumptions on the content of the messages, to gain
|
|
385
|
-
important information about the data being encrypted.
|
|
386
|
-
category: security
|
|
387
|
-
severity: low
|
|
388
|
-
confidence: medium
|
|
389
|
-
languages:
|
|
390
|
-
- kt
|
|
391
|
-
patterns:
|
|
392
|
-
- regex: .*
|
|
393
|
-
message: >-
|
|
394
|
-
GCM detected, please check that IV/nonce is not reused, an Initialization Vector (IV) is a nonce used to
|
|
395
|
-
randomize the encryption, so that even if multiple messages with identical plaintext are encrypted, the
|
|
396
|
-
generated corresponding ciphertexts are different.Unlike the Key, the IV usually does not need to be secret,
|
|
397
|
-
rather it is important that it is random and unique. Certain encryption schemes the IV is exchanged in public
|
|
398
|
-
as part of the ciphertext. Reusing same Initialization Vector with the same Key to encrypt multiple plaintext
|
|
399
|
-
blocks allows an attacker to compare the ciphertexts and then, with some assumptions on the content of the
|
|
400
|
-
messages, to gain important information about the data being encrypted.
|
|
401
|
-
cwe:
|
|
402
|
-
- CWE-323
|
|
403
|
-
owasp:
|
|
404
|
-
- A02:2021
|
|
405
|
-
- A04:2025
|
|
406
|
-
references:
|
|
407
|
-
- https://cwe.mitre.org/data/definitions/323.html
|
|
408
|
-
tags:
|
|
409
|
-
- kotlin
|
|
410
|
-
- id: no-null-cipher
|
|
411
|
-
name: no-null-cipher
|
|
412
|
-
description: >-
|
|
413
|
-
NullCipher was detected. This will not encrypt anything; the cipher text will be the same as the plain text. Use a
|
|
414
|
-
valid, secure cipher: Cipher.getInstance("AES/CBC/PKCS7PADDING"). See
|
|
415
|
-
https://owasp.org/www-community/Using_the_Java_Cryptographic_Extensions for more information.
|
|
416
|
-
category: crypto
|
|
417
|
-
severity: medium
|
|
418
|
-
confidence: medium
|
|
419
|
-
languages:
|
|
420
|
-
- kt
|
|
421
|
-
- scala
|
|
422
|
-
patterns:
|
|
423
|
-
- pattern: NullCipher(...)
|
|
424
|
-
message: >-
|
|
425
|
-
NullCipher was detected. This will not encrypt anything; the cipher text will be the same as the plain text.
|
|
426
|
-
Use a valid, secure cipher: Cipher.getInstance("AES/CBC/PKCS7PADDING"). See
|
|
427
|
-
https://owasp.org/www-community/Using_the_Java_Cryptographic_Extensions for more information.
|
|
428
|
-
cwe:
|
|
429
|
-
- CWE-327
|
|
430
|
-
owasp:
|
|
431
|
-
- A03:2017
|
|
432
|
-
- A02:2021
|
|
433
|
-
- A04:2025
|
|
434
|
-
references:
|
|
435
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
|
|
436
|
-
tags:
|
|
437
|
-
- kotlin
|
|
438
|
-
- id: unencrypted-socket
|
|
439
|
-
name: unencrypted-socket
|
|
440
|
-
description: >-
|
|
441
|
-
This socket is not encrypted. The traffic could be read by an attacker intercepting the network traffic. Use an
|
|
442
|
-
SSLSocket created by 'SSLSocketFactory' or 'SSLServerSocketFactory' instead
|
|
443
|
-
category: security
|
|
444
|
-
severity: medium
|
|
445
|
-
confidence: medium
|
|
446
|
-
languages:
|
|
447
|
-
- kt
|
|
448
|
-
patterns:
|
|
449
|
-
- regex: .*
|
|
450
|
-
message: >-
|
|
451
|
-
This socket is not encrypted. The traffic could be read by an attacker intercepting the network traffic. Use
|
|
452
|
-
an SSLSocket created by 'SSLSocketFactory' or 'SSLServerSocketFactory' instead
|
|
453
|
-
cwe:
|
|
454
|
-
- CWE-319
|
|
455
|
-
owasp:
|
|
456
|
-
- A03:2017
|
|
457
|
-
- A02:2021
|
|
458
|
-
- A04:2025
|
|
459
|
-
references:
|
|
460
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
|
|
461
|
-
tags:
|
|
462
|
-
- kotlin
|
|
463
|
-
- id: use-of-md5
|
|
464
|
-
name: use-of-md5
|
|
465
|
-
description: >-
|
|
466
|
-
Detected MD5 hash algorithm which is considered insecure. MD5 is not collision resistant and is therefore not
|
|
467
|
-
suitable as a cryptographic signature. Use SHA256 or SHA3 instead.
|
|
468
|
-
category: crypto
|
|
469
|
-
severity: medium
|
|
470
|
-
confidence: medium
|
|
471
|
-
languages:
|
|
472
|
-
- kt
|
|
473
|
-
patterns:
|
|
474
|
-
- pattern: |
|
|
475
|
-
java.security.MessageDigest.getInstance("MD5")
|
|
476
|
-
message: >-
|
|
477
|
-
Detected MD5 hash algorithm which is considered insecure. MD5 is not collision resistant and is therefore not
|
|
478
|
-
suitable as a cryptographic signature. Use SHA256 or SHA3 instead.
|
|
479
|
-
- pattern: |
|
|
480
|
-
org.apache.commons.codec.digest.DigestUtils.getMd5Digest()
|
|
481
|
-
message: >-
|
|
482
|
-
Detected MD5 hash algorithm which is considered insecure. MD5 is not collision resistant and is therefore not
|
|
483
|
-
suitable as a cryptographic signature. Use SHA256 or SHA3 instead.
|
|
484
|
-
cwe:
|
|
485
|
-
- CWE-328
|
|
486
|
-
owasp:
|
|
487
|
-
- A03:2017
|
|
488
|
-
- A02:2021
|
|
489
|
-
- A04:2025
|
|
490
|
-
references:
|
|
491
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
|
|
492
|
-
tags:
|
|
493
|
-
- kotlin
|
|
494
|
-
- id: use-of-sha1
|
|
495
|
-
name: use-of-sha1
|
|
496
|
-
description: >-
|
|
497
|
-
Detected SHA1 hash algorithm which is considered insecure. SHA1 is not collision resistant and is therefore not
|
|
498
|
-
suitable as a cryptographic signature. Use SHA256 or SHA3 instead.
|
|
499
|
-
category: security
|
|
500
|
-
severity: medium
|
|
501
|
-
confidence: medium
|
|
502
|
-
languages:
|
|
503
|
-
- kt
|
|
504
|
-
patterns:
|
|
505
|
-
- pattern: |
|
|
506
|
-
$DU.getSha1Digest().digest(...)
|
|
507
|
-
message: >-
|
|
508
|
-
Detected SHA1 hash algorithm which is considered insecure. SHA1 is not collision resistant and is therefore
|
|
509
|
-
not suitable as a cryptographic signature. Use SHA256 or SHA3 instead.
|
|
510
|
-
cwe:
|
|
511
|
-
- CWE-327
|
|
512
|
-
owasp:
|
|
513
|
-
- A03:2017
|
|
514
|
-
- A02:2021
|
|
515
|
-
- A04:2025
|
|
516
|
-
references:
|
|
517
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures
|
|
518
|
-
tags:
|
|
519
|
-
- kotlin
|
|
520
|
-
- id: use-of-weak-rsa-key
|
|
521
|
-
name: use-of-weak-rsa-key
|
|
522
|
-
description: RSA keys should be at least 2048 bits based on NIST recommendation.
|
|
523
|
-
category: secrets
|
|
524
|
-
severity: medium
|
|
525
|
-
confidence: medium
|
|
526
|
-
languages:
|
|
527
|
-
- kt
|
|
528
|
-
patterns:
|
|
529
|
-
- regex: .*
|
|
530
|
-
message: RSA keys should be at least 2048 bits based on NIST recommendation.
|
|
531
|
-
cwe:
|
|
532
|
-
- CWE-326
|
|
533
|
-
owasp:
|
|
534
|
-
- A03:2017
|
|
535
|
-
- A02:2021
|
|
536
|
-
- A04:2025
|
|
537
|
-
references:
|
|
538
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#algorithms
|
|
539
|
-
tags:
|
|
540
|
-
- kotlin
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
rules:
|
|
2
|
-
- id: contains-bidirectional-characters
|
|
3
|
-
name: contains-bidirectional-characters
|
|
4
|
-
description: >-
|
|
5
|
-
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left languages
|
|
6
|
-
such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a manner that is
|
|
7
|
-
different from how it is displayed in code editing and review tools. If this is not what you were expecting,
|
|
8
|
-
please review this code in an editor that can reveal hidden Unicode characters.
|
|
9
|
-
category: security
|
|
10
|
-
severity: medium
|
|
11
|
-
confidence: medium
|
|
12
|
-
languages:
|
|
13
|
-
- bash
|
|
14
|
-
- c
|
|
15
|
-
- csharp
|
|
16
|
-
- go
|
|
17
|
-
- java
|
|
18
|
-
- javascript
|
|
19
|
-
- json
|
|
20
|
-
- kotlin
|
|
21
|
-
- lua
|
|
22
|
-
- ocaml
|
|
23
|
-
- php
|
|
24
|
-
- python
|
|
25
|
-
- ruby
|
|
26
|
-
- rust
|
|
27
|
-
- scala
|
|
28
|
-
- sh
|
|
29
|
-
- typescript
|
|
30
|
-
- yaml
|
|
31
|
-
patterns:
|
|
32
|
-
- regex: .*
|
|
33
|
-
message: >-
|
|
34
|
-
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left
|
|
35
|
-
languages such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a
|
|
36
|
-
manner that is different from how it is displayed in code editing and review tools. If this is not what you
|
|
37
|
-
were expecting, please review this code in an editor that can reveal hidden Unicode characters.
|
|
38
|
-
cwe:
|
|
39
|
-
- CWE-94
|
|
40
|
-
owasp:
|
|
41
|
-
- A03:2021
|
|
42
|
-
- A05:2025
|
|
43
|
-
references:
|
|
44
|
-
- https://trojansource.codes/
|
|
45
|
-
tags:
|
|
46
|
-
- unicode
|