deepscan-cli 1.0.0 → 1.2.0
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 +174 -59
- package/dist/bin/deepscan.js +189 -71
- package/dist/bin/deepscan.js.map +1 -1
- package/dist/{chunk-OSYJXVNF.js → chunk-KITQQYNW.js} +5071 -596
- package/dist/chunk-KITQQYNW.js.map +1 -0
- package/dist/index.d.ts +61 -5
- package/dist/index.js +13 -3
- package/package.json +23 -5
- 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,429 +0,0 @@
|
|
|
1
|
-
rules:
|
|
2
|
-
- id: c-string-equality
|
|
3
|
-
name: c-string-equality
|
|
4
|
-
description: Using == on char* performs pointer comparison, use strcmp instead
|
|
5
|
-
category: security
|
|
6
|
-
severity: high
|
|
7
|
-
confidence: medium
|
|
8
|
-
languages:
|
|
9
|
-
- c
|
|
10
|
-
patterns:
|
|
11
|
-
- pattern: (char *$X) == (char *$Y)
|
|
12
|
-
message: Using == on char* performs pointer comparison, use strcmp instead
|
|
13
|
-
cwe: []
|
|
14
|
-
owasp: []
|
|
15
|
-
references: []
|
|
16
|
-
tags:
|
|
17
|
-
- c
|
|
18
|
-
- id: double_goto
|
|
19
|
-
name: double_goto
|
|
20
|
-
description: The second goto statement will always be executed.
|
|
21
|
-
category: security
|
|
22
|
-
severity: medium
|
|
23
|
-
confidence: medium
|
|
24
|
-
languages:
|
|
25
|
-
- c
|
|
26
|
-
patterns:
|
|
27
|
-
- pattern: |
|
|
28
|
-
if ($COND)
|
|
29
|
-
goto $FAIL;
|
|
30
|
-
goto $FAIL;
|
|
31
|
-
message: The second goto statement will always be executed.
|
|
32
|
-
cwe: []
|
|
33
|
-
owasp: []
|
|
34
|
-
references: []
|
|
35
|
-
tags:
|
|
36
|
-
- c
|
|
37
|
-
- id: incorrect-use-ato-fn
|
|
38
|
-
name: incorrect-use-ato-fn
|
|
39
|
-
description: >-
|
|
40
|
-
Avoid the 'ato*()' family of functions. Their use can lead to undefined behavior, integer overflows, and lack of
|
|
41
|
-
appropriate error handling. Instead prefer the 'strtol*()' family of functions.
|
|
42
|
-
category: security
|
|
43
|
-
severity: medium
|
|
44
|
-
confidence: medium
|
|
45
|
-
languages:
|
|
46
|
-
- c
|
|
47
|
-
patterns:
|
|
48
|
-
- pattern: atoi(...)
|
|
49
|
-
message: >-
|
|
50
|
-
Avoid the 'ato*()' family of functions. Their use can lead to undefined behavior, integer overflows, and lack
|
|
51
|
-
of appropriate error handling. Instead prefer the 'strtol*()' family of functions.
|
|
52
|
-
- pattern: atol(...)
|
|
53
|
-
message: >-
|
|
54
|
-
Avoid the 'ato*()' family of functions. Their use can lead to undefined behavior, integer overflows, and lack
|
|
55
|
-
of appropriate error handling. Instead prefer the 'strtol*()' family of functions.
|
|
56
|
-
- pattern: atoll(...)
|
|
57
|
-
message: >-
|
|
58
|
-
Avoid the 'ato*()' family of functions. Their use can lead to undefined behavior, integer overflows, and lack
|
|
59
|
-
of appropriate error handling. Instead prefer the 'strtol*()' family of functions.
|
|
60
|
-
cwe: []
|
|
61
|
-
owasp: []
|
|
62
|
-
references:
|
|
63
|
-
- https://stackoverflow.com/q/38393162
|
|
64
|
-
- https://stackoverflow.com/q/14176123
|
|
65
|
-
tags:
|
|
66
|
-
- c
|
|
67
|
-
- id: incorrect-use-sscanf-fn
|
|
68
|
-
name: incorrect-use-sscanf-fn
|
|
69
|
-
description: >-
|
|
70
|
-
Avoid 'sscanf()' for number conversions. Its use can lead to undefined behavior, slow processing, and integer
|
|
71
|
-
overflows. Instead prefer the 'strto*()' family of functions.
|
|
72
|
-
category: security
|
|
73
|
-
severity: medium
|
|
74
|
-
confidence: medium
|
|
75
|
-
languages:
|
|
76
|
-
- c
|
|
77
|
-
patterns:
|
|
78
|
-
- pattern: sscanf($STR, $FMT, $PTR);
|
|
79
|
-
message: >-
|
|
80
|
-
Avoid 'sscanf()' for number conversions. Its use can lead to undefined behavior, slow processing, and integer
|
|
81
|
-
overflows. Instead prefer the 'strto*()' family of functions.
|
|
82
|
-
cwe: []
|
|
83
|
-
owasp: []
|
|
84
|
-
references:
|
|
85
|
-
- https://stackoverflow.com/q/22865622
|
|
86
|
-
- https://stackoverflow.com/q/7021725
|
|
87
|
-
- https://www.mattkeeter.com/blog/2021-03-01-happen/
|
|
88
|
-
tags:
|
|
89
|
-
- c
|
|
90
|
-
- id: double-free
|
|
91
|
-
name: double-free
|
|
92
|
-
description: Variable '$VAR' was freed twice. This can lead to undefined behavior.
|
|
93
|
-
category: security
|
|
94
|
-
severity: high
|
|
95
|
-
confidence: medium
|
|
96
|
-
languages:
|
|
97
|
-
- c
|
|
98
|
-
patterns:
|
|
99
|
-
- regex: .*
|
|
100
|
-
message: Variable '$VAR' was freed twice. This can lead to undefined behavior.
|
|
101
|
-
cwe:
|
|
102
|
-
- CWE-415
|
|
103
|
-
owasp:
|
|
104
|
-
- A03:2021
|
|
105
|
-
- A01:2017
|
|
106
|
-
- A05:2025
|
|
107
|
-
references:
|
|
108
|
-
- https://cwe.mitre.org/data/definitions/415.html
|
|
109
|
-
- https://owasp.org/www-community/vulnerabilities/Doubly_freeing_memory
|
|
110
|
-
tags:
|
|
111
|
-
- c
|
|
112
|
-
- id: function-use-after-free
|
|
113
|
-
name: function-use-after-free
|
|
114
|
-
description: Variable '$VAR' was passed to a function after being freed. This can lead to undefined behavior.
|
|
115
|
-
category: security
|
|
116
|
-
severity: medium
|
|
117
|
-
confidence: medium
|
|
118
|
-
languages:
|
|
119
|
-
- c
|
|
120
|
-
patterns:
|
|
121
|
-
- regex: .*
|
|
122
|
-
message: Variable '$VAR' was passed to a function after being freed. This can lead to undefined behavior.
|
|
123
|
-
cwe:
|
|
124
|
-
- CWE-416
|
|
125
|
-
owasp: []
|
|
126
|
-
references:
|
|
127
|
-
- https://cwe.mitre.org/data/definitions/416.html
|
|
128
|
-
- https://ctf-wiki.github.io/ctf-wiki/pwn/linux/glibc-heap/use_after_free/
|
|
129
|
-
tags:
|
|
130
|
-
- c
|
|
131
|
-
- id: info-leak-on-non-formated-string
|
|
132
|
-
name: info-leak-on-non-formated-string
|
|
133
|
-
description: Use %s, %d, %c... to format your variables, otherwise this could leak information.
|
|
134
|
-
category: security
|
|
135
|
-
severity: medium
|
|
136
|
-
confidence: medium
|
|
137
|
-
languages:
|
|
138
|
-
- c
|
|
139
|
-
patterns:
|
|
140
|
-
- pattern: printf(argv[$NUM]);
|
|
141
|
-
message: Use %s, %d, %c... to format your variables, otherwise this could leak information.
|
|
142
|
-
cwe:
|
|
143
|
-
- CWE-532
|
|
144
|
-
owasp:
|
|
145
|
-
- A09:2021
|
|
146
|
-
- A09:2025
|
|
147
|
-
references:
|
|
148
|
-
- http://nebelwelt.net/files/13PPREW.pdf
|
|
149
|
-
tags:
|
|
150
|
-
- c
|
|
151
|
-
- id: insecure-use-gets-fn
|
|
152
|
-
name: insecure-use-gets-fn
|
|
153
|
-
description: >-
|
|
154
|
-
Avoid 'gets()'. This function does not consider buffer boundaries and can lead to buffer overflows. Use 'fgets()'
|
|
155
|
-
or 'gets_s()' instead.
|
|
156
|
-
category: security
|
|
157
|
-
severity: high
|
|
158
|
-
confidence: medium
|
|
159
|
-
languages:
|
|
160
|
-
- c
|
|
161
|
-
patterns:
|
|
162
|
-
- pattern: gets(...)
|
|
163
|
-
message: >-
|
|
164
|
-
Avoid 'gets()'. This function does not consider buffer boundaries and can lead to buffer overflows. Use
|
|
165
|
-
'fgets()' or 'gets_s()' instead.
|
|
166
|
-
cwe:
|
|
167
|
-
- CWE-676
|
|
168
|
-
owasp: []
|
|
169
|
-
references:
|
|
170
|
-
- https://us-cert.cisa.gov/bsi/articles/knowledge/coding-practices/fgets-and-gets_s
|
|
171
|
-
tags:
|
|
172
|
-
- c
|
|
173
|
-
- id: insecure-use-memset
|
|
174
|
-
name: insecure-use-memset
|
|
175
|
-
description: >-
|
|
176
|
-
When handling sensitive information in a buffer, it's important to ensure that the data is securely erased before
|
|
177
|
-
the buffer is deleted or reused. While `memset()` is commonly used for this purpose, it can leave sensitive
|
|
178
|
-
information behind due to compiler optimizations or other factors. To avoid this potential vulnerability, it's
|
|
179
|
-
recommended to use the `memset_s()` function instead. `memset_s()` is a standardized function that securely
|
|
180
|
-
overwrites the memory with a specified value, making it more difficult for an attacker to recover any sensitive
|
|
181
|
-
data that was stored in the buffer. By using `memset_s()` instead of `memset()`, you can help to ensure that
|
|
182
|
-
your application is more secure and less vulnerable to exploits that rely on residual data in memory.
|
|
183
|
-
category: security
|
|
184
|
-
severity: medium
|
|
185
|
-
confidence: medium
|
|
186
|
-
languages:
|
|
187
|
-
- c
|
|
188
|
-
patterns:
|
|
189
|
-
- pattern: memset($...VARS)
|
|
190
|
-
message: >-
|
|
191
|
-
When handling sensitive information in a buffer, it's important to ensure that the data is securely erased
|
|
192
|
-
before the buffer is deleted or reused. While `memset()` is commonly used for this purpose, it can leave
|
|
193
|
-
sensitive information behind due to compiler optimizations or other factors. To avoid this potential
|
|
194
|
-
vulnerability, it's recommended to use the `memset_s()` function instead. `memset_s()` is a standardized
|
|
195
|
-
function that securely overwrites the memory with a specified value, making it more difficult for an
|
|
196
|
-
attacker to recover any sensitive data that was stored in the buffer. By using `memset_s()` instead of
|
|
197
|
-
`memset()`, you can help to ensure that your application is more secure and less vulnerable to exploits that
|
|
198
|
-
rely on residual data in memory.
|
|
199
|
-
cwe:
|
|
200
|
-
- CWE-14
|
|
201
|
-
owasp:
|
|
202
|
-
- A04:2021
|
|
203
|
-
- A06:2025
|
|
204
|
-
references:
|
|
205
|
-
- https://cwe.mitre.org/data/definitions/14.html
|
|
206
|
-
- https://owasp.org/Top10/A02_2021-Cryptographic_Failures/
|
|
207
|
-
tags:
|
|
208
|
-
- c
|
|
209
|
-
- id: insecure-use-printf-fn
|
|
210
|
-
name: insecure-use-printf-fn
|
|
211
|
-
description: >-
|
|
212
|
-
Avoid using user-controlled format strings passed into 'sprintf', 'printf' and 'vsprintf'. These functions put you
|
|
213
|
-
at risk of buffer overflow vulnerabilities through the use of format string exploits. Instead, use 'snprintf' and
|
|
214
|
-
'vsnprintf'.
|
|
215
|
-
category: security
|
|
216
|
-
severity: medium
|
|
217
|
-
confidence: medium
|
|
218
|
-
languages:
|
|
219
|
-
- c
|
|
220
|
-
patterns:
|
|
221
|
-
- regex: .*
|
|
222
|
-
message: >-
|
|
223
|
-
Avoid using user-controlled format strings passed into 'sprintf', 'printf' and 'vsprintf'. These functions put
|
|
224
|
-
you at risk of buffer overflow vulnerabilities through the use of format string exploits. Instead, use
|
|
225
|
-
'snprintf' and 'vsnprintf'.
|
|
226
|
-
cwe:
|
|
227
|
-
- CWE-134
|
|
228
|
-
owasp: []
|
|
229
|
-
references:
|
|
230
|
-
- https://doc.castsoftware.com/display/SBX/Never+use+sprintf%28%29+or+vsprintf%28%29+functions
|
|
231
|
-
- https://www.cvedetails.com/cwe-details/134/Uncontrolled-Format-String.html
|
|
232
|
-
tags:
|
|
233
|
-
- c
|
|
234
|
-
- id: insecure-use-scanf-fn
|
|
235
|
-
name: insecure-use-scanf-fn
|
|
236
|
-
description: >-
|
|
237
|
-
Avoid using 'scanf()'. This function, when used improperly, does not consider buffer boundaries and can lead to
|
|
238
|
-
buffer overflows. Use 'fgets()' instead for reading input.
|
|
239
|
-
category: security
|
|
240
|
-
severity: medium
|
|
241
|
-
confidence: medium
|
|
242
|
-
languages:
|
|
243
|
-
- c
|
|
244
|
-
patterns:
|
|
245
|
-
- pattern: scanf(...)
|
|
246
|
-
message: >-
|
|
247
|
-
Avoid using 'scanf()'. This function, when used improperly, does not consider buffer boundaries and can lead
|
|
248
|
-
to buffer overflows. Use 'fgets()' instead for reading input.
|
|
249
|
-
cwe:
|
|
250
|
-
- CWE-676
|
|
251
|
-
owasp: []
|
|
252
|
-
references:
|
|
253
|
-
- http://sekrit.de/webdocs/c/beginners-guide-away-from-scanf.html
|
|
254
|
-
tags:
|
|
255
|
-
- c
|
|
256
|
-
- id: insecure-use-strcat-fn
|
|
257
|
-
name: insecure-use-strcat-fn
|
|
258
|
-
description: >-
|
|
259
|
-
Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can lead
|
|
260
|
-
to buffer overflow vulns. Fix this by using strcat_s instead.
|
|
261
|
-
category: security
|
|
262
|
-
severity: medium
|
|
263
|
-
confidence: medium
|
|
264
|
-
languages:
|
|
265
|
-
- c
|
|
266
|
-
patterns:
|
|
267
|
-
- pattern: strcat(...)
|
|
268
|
-
message: >-
|
|
269
|
-
Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can
|
|
270
|
-
lead to buffer overflow vulns. Fix this by using strcat_s instead.
|
|
271
|
-
- pattern: strncat(...)
|
|
272
|
-
message: >-
|
|
273
|
-
Finding triggers whenever there is a strcat or strncat used. This is an issue because strcat or strncat can
|
|
274
|
-
lead to buffer overflow vulns. Fix this by using strcat_s instead.
|
|
275
|
-
cwe:
|
|
276
|
-
- CWE-676
|
|
277
|
-
owasp: []
|
|
278
|
-
references:
|
|
279
|
-
- https://nvd.nist.gov/vuln/detail/CVE-2019-12553
|
|
280
|
-
- https://techblog.mediaservice.net/2020/04/cve-2020-2851-stack-based-buffer-overflow-in-cde-libdtsvc/
|
|
281
|
-
tags:
|
|
282
|
-
- c
|
|
283
|
-
- id: insecure-use-string-copy-fn
|
|
284
|
-
name: insecure-use-string-copy-fn
|
|
285
|
-
description: >-
|
|
286
|
-
Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the
|
|
287
|
-
size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer
|
|
288
|
-
overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by
|
|
289
|
-
using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and so may not be
|
|
290
|
-
available).
|
|
291
|
-
category: security
|
|
292
|
-
severity: medium
|
|
293
|
-
confidence: medium
|
|
294
|
-
languages:
|
|
295
|
-
- c
|
|
296
|
-
patterns:
|
|
297
|
-
- pattern: strcpy(...)
|
|
298
|
-
message: >-
|
|
299
|
-
Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm
|
|
300
|
-
the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to
|
|
301
|
-
buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program.
|
|
302
|
-
Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and
|
|
303
|
-
so may not be available).
|
|
304
|
-
- pattern: strncpy(...)
|
|
305
|
-
message: >-
|
|
306
|
-
Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm
|
|
307
|
-
the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to
|
|
308
|
-
buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program.
|
|
309
|
-
Fix this by using strcpy_s instead (although note that strcpy_s is an optional part of the C11 standard, and
|
|
310
|
-
so may not be available).
|
|
311
|
-
cwe:
|
|
312
|
-
- CWE-676
|
|
313
|
-
owasp: []
|
|
314
|
-
references:
|
|
315
|
-
- https://cwe.mitre.org/data/definitions/676
|
|
316
|
-
- https://nvd.nist.gov/vuln/detail/CVE-2019-11365
|
|
317
|
-
tags:
|
|
318
|
-
- c
|
|
319
|
-
- id: insecure-use-strtok-fn
|
|
320
|
-
name: insecure-use-strtok-fn
|
|
321
|
-
description: >-
|
|
322
|
-
Avoid using 'strtok()'. This function directly modifies the first argument buffer, permanently erasing the
|
|
323
|
-
delimiter character. Use 'strtok_r()' instead.
|
|
324
|
-
category: security
|
|
325
|
-
severity: medium
|
|
326
|
-
confidence: medium
|
|
327
|
-
languages:
|
|
328
|
-
- c
|
|
329
|
-
patterns:
|
|
330
|
-
- pattern: strtok(...)
|
|
331
|
-
message: >-
|
|
332
|
-
Avoid using 'strtok()'. This function directly modifies the first argument buffer, permanently erasing the
|
|
333
|
-
delimiter character. Use 'strtok_r()' instead.
|
|
334
|
-
cwe:
|
|
335
|
-
- CWE-676
|
|
336
|
-
owasp: []
|
|
337
|
-
references:
|
|
338
|
-
- >-
|
|
339
|
-
https://wiki.sei.cmu.edu/confluence/display/c/STR06-C.+Do+not+assume+that+strtok%28%29+leaves+the+parse+string+unchanged
|
|
340
|
-
- https://man7.org/linux/man-pages/man3/strtok.3.html#BUGS
|
|
341
|
-
- https://stackoverflow.com/a/40335556
|
|
342
|
-
tags:
|
|
343
|
-
- c
|
|
344
|
-
- id: random-fd-exhaustion
|
|
345
|
-
name: random-fd-exhaustion
|
|
346
|
-
description: >-
|
|
347
|
-
Call to 'read()' without error checking is susceptible to file descriptor exhaustion. Consider using the
|
|
348
|
-
'getrandom()' function.
|
|
349
|
-
category: security
|
|
350
|
-
severity: medium
|
|
351
|
-
confidence: medium
|
|
352
|
-
languages:
|
|
353
|
-
- c
|
|
354
|
-
patterns:
|
|
355
|
-
- regex: .*
|
|
356
|
-
message: >-
|
|
357
|
-
Call to 'read()' without error checking is susceptible to file descriptor exhaustion. Consider using the
|
|
358
|
-
'getrandom()' function.
|
|
359
|
-
cwe:
|
|
360
|
-
- CWE-774
|
|
361
|
-
owasp: []
|
|
362
|
-
references:
|
|
363
|
-
- https://lwn.net/Articles/606141/
|
|
364
|
-
tags:
|
|
365
|
-
- c
|
|
366
|
-
- id: use-after-free
|
|
367
|
-
name: use-after-free
|
|
368
|
-
description: Variable '$VAR' was used after being freed. This can lead to undefined behavior.
|
|
369
|
-
category: security
|
|
370
|
-
severity: medium
|
|
371
|
-
confidence: medium
|
|
372
|
-
languages:
|
|
373
|
-
- c
|
|
374
|
-
patterns:
|
|
375
|
-
- regex: .*
|
|
376
|
-
message: Variable '$VAR' was used after being freed. This can lead to undefined behavior.
|
|
377
|
-
cwe:
|
|
378
|
-
- CWE-416
|
|
379
|
-
owasp: []
|
|
380
|
-
references:
|
|
381
|
-
- https://cwe.mitre.org/data/definitions/416.html
|
|
382
|
-
- https://ctf-wiki.github.io/ctf-wiki/pwn/linux/glibc-heap/use_after_free/
|
|
383
|
-
tags:
|
|
384
|
-
- c
|
|
385
|
-
- id: contains-bidirectional-characters
|
|
386
|
-
name: contains-bidirectional-characters
|
|
387
|
-
description: >-
|
|
388
|
-
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left languages
|
|
389
|
-
such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a manner that is
|
|
390
|
-
different from how it is displayed in code editing and review tools. If this is not what you were expecting,
|
|
391
|
-
please review this code in an editor that can reveal hidden Unicode characters.
|
|
392
|
-
category: security
|
|
393
|
-
severity: medium
|
|
394
|
-
confidence: medium
|
|
395
|
-
languages:
|
|
396
|
-
- bash
|
|
397
|
-
- c
|
|
398
|
-
- csharp
|
|
399
|
-
- go
|
|
400
|
-
- java
|
|
401
|
-
- javascript
|
|
402
|
-
- json
|
|
403
|
-
- kotlin
|
|
404
|
-
- lua
|
|
405
|
-
- ocaml
|
|
406
|
-
- php
|
|
407
|
-
- python
|
|
408
|
-
- ruby
|
|
409
|
-
- rust
|
|
410
|
-
- scala
|
|
411
|
-
- sh
|
|
412
|
-
- typescript
|
|
413
|
-
- yaml
|
|
414
|
-
patterns:
|
|
415
|
-
- regex: .*
|
|
416
|
-
message: >-
|
|
417
|
-
This code contains bidirectional (bidi) characters. While this is useful for support of right-to-left
|
|
418
|
-
languages such as Arabic or Hebrew, it can also be used to trick language parsers into executing code in a
|
|
419
|
-
manner that is different from how it is displayed in code editing and review tools. If this is not what you
|
|
420
|
-
were expecting, please review this code in an editor that can reveal hidden Unicode characters.
|
|
421
|
-
cwe:
|
|
422
|
-
- CWE-94
|
|
423
|
-
owasp:
|
|
424
|
-
- A03:2021
|
|
425
|
-
- A05:2025
|
|
426
|
-
references:
|
|
427
|
-
- https://trojansource.codes/
|
|
428
|
-
tags:
|
|
429
|
-
- unicode
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
rules:
|
|
2
|
-
- id: command-injection-shell-call
|
|
3
|
-
name: command-injection-shell-call
|
|
4
|
-
description: >-
|
|
5
|
-
A call to clojure.java.shell has been found, this could lead to an RCE if the inputs are user-controllable. Please
|
|
6
|
-
ensure their origin is validated and sanitized.
|
|
7
|
-
category: injection
|
|
8
|
-
severity: high
|
|
9
|
-
confidence: medium
|
|
10
|
-
languages:
|
|
11
|
-
- clojure
|
|
12
|
-
patterns:
|
|
13
|
-
- regex: .*
|
|
14
|
-
message: >-
|
|
15
|
-
A call to clojure.java.shell has been found, this could lead to an RCE if the inputs are user-controllable.
|
|
16
|
-
Please ensure their origin is validated and sanitized.
|
|
17
|
-
cwe:
|
|
18
|
-
- CWE-78
|
|
19
|
-
owasp:
|
|
20
|
-
- A01:2017
|
|
21
|
-
- A03:2021
|
|
22
|
-
- A05:2025
|
|
23
|
-
references:
|
|
24
|
-
- https://clojuredocs.org/clojure.java.shell/sh
|
|
25
|
-
tags:
|
|
26
|
-
- clojure
|
|
27
|
-
- id: documentbuilderfactory-xxe
|
|
28
|
-
name: documentbuilderfactory-xxe
|
|
29
|
-
description: >-
|
|
30
|
-
DOCTYPE declarations are enabled for javax.xml.parsers.SAXParserFactory. Without prohibiting external entity
|
|
31
|
-
declarations, this is vulnerable to XML external entity attacks. Disable this by setting the feature
|
|
32
|
-
"http://apache.org/xml/features/disallow-doctype-decl" to true. Alternatively, allow DOCTYPE declarations and only
|
|
33
|
-
prohibit external entities declarations. This can be done by setting the features
|
|
34
|
-
"http://xml.org/sax/features/external-general-entities" and
|
|
35
|
-
"http://xml.org/sax/features/external-parameter-entities" to false.
|
|
36
|
-
category: api-security
|
|
37
|
-
severity: high
|
|
38
|
-
confidence: medium
|
|
39
|
-
languages:
|
|
40
|
-
- clojure
|
|
41
|
-
patterns:
|
|
42
|
-
- regex: .*
|
|
43
|
-
message: >-
|
|
44
|
-
DOCTYPE declarations are enabled for javax.xml.parsers.SAXParserFactory. Without prohibiting external entity
|
|
45
|
-
declarations, this is vulnerable to XML external entity attacks. Disable this by setting the feature
|
|
46
|
-
"http://apache.org/xml/features/disallow-doctype-decl" to true. Alternatively, allow DOCTYPE declarations and
|
|
47
|
-
only prohibit external entities declarations. This can be done by setting the features
|
|
48
|
-
"http://xml.org/sax/features/external-general-entities" and
|
|
49
|
-
"http://xml.org/sax/features/external-parameter-entities" to false.
|
|
50
|
-
cwe:
|
|
51
|
-
- CWE-611
|
|
52
|
-
owasp:
|
|
53
|
-
- A04:2017
|
|
54
|
-
- A05:2021
|
|
55
|
-
- A02:2025
|
|
56
|
-
references:
|
|
57
|
-
- https://semgrep.dev/blog/2022/xml-security-in-java
|
|
58
|
-
- https://semgrep.dev/docs/cheat-sheets/java-xxe/
|
|
59
|
-
- https://xerces.apache.org/xerces2-j/features.html
|
|
60
|
-
tags:
|
|
61
|
-
- clojure
|
|
62
|
-
- xml
|
|
63
|
-
- id: use-of-md5
|
|
64
|
-
name: use-of-md5
|
|
65
|
-
description: >-
|
|
66
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes. Replace
|
|
67
|
-
with current recommended hashing algorithms.
|
|
68
|
-
category: crypto
|
|
69
|
-
severity: medium
|
|
70
|
-
confidence: medium
|
|
71
|
-
languages:
|
|
72
|
-
- clojure
|
|
73
|
-
patterns:
|
|
74
|
-
- pattern: (MessageDigest/getInstance "MD5")
|
|
75
|
-
message: >-
|
|
76
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes.
|
|
77
|
-
Replace with current recommended hashing algorithms.
|
|
78
|
-
- pattern: (MessageDigest/getInstance MessageDigestAlgorithms/MD5)
|
|
79
|
-
message: >-
|
|
80
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes.
|
|
81
|
-
Replace with current recommended hashing algorithms.
|
|
82
|
-
- pattern: (MessageDigest/getInstance org.apache.commons.codec.digest.MessageDigestAlgorithms/MD5)
|
|
83
|
-
message: >-
|
|
84
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes.
|
|
85
|
-
Replace with current recommended hashing algorithms.
|
|
86
|
-
- pattern: (java.security.MessageDigest/getInstance "MD5")
|
|
87
|
-
message: >-
|
|
88
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes.
|
|
89
|
-
Replace with current recommended hashing algorithms.
|
|
90
|
-
- pattern: (java.security.MessageDigest/getInstance MessageDigestAlgorithms/MD5)
|
|
91
|
-
message: >-
|
|
92
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes.
|
|
93
|
-
Replace with current recommended hashing algorithms.
|
|
94
|
-
- pattern: (java.security.MessageDigest/getInstance org.apache.commons.codec.digest.MessageDigestAlgorithms/MD5)
|
|
95
|
-
message: >-
|
|
96
|
-
MD5 hash algorithm detected. This is not collision resistant and leads to easily-cracked password hashes.
|
|
97
|
-
Replace with current recommended hashing algorithms.
|
|
98
|
-
cwe:
|
|
99
|
-
- CWE-328
|
|
100
|
-
owasp:
|
|
101
|
-
- A03:2017
|
|
102
|
-
- A02:2021
|
|
103
|
-
- A04:2025
|
|
104
|
-
references:
|
|
105
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html
|
|
106
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
|
|
107
|
-
tags:
|
|
108
|
-
- clojure
|
|
109
|
-
- id: use-of-sha1
|
|
110
|
-
name: use-of-sha1
|
|
111
|
-
description: >-
|
|
112
|
-
Detected SHA1 hash algorithm which is considered insecure. SHA1 is not collision resistant and is therefore not
|
|
113
|
-
suitable as a cryptographic signature. Instead, use PBKDF2 for password hashing or SHA256 or SHA512 for other hash
|
|
114
|
-
function applications.
|
|
115
|
-
category: security
|
|
116
|
-
severity: medium
|
|
117
|
-
confidence: medium
|
|
118
|
-
languages:
|
|
119
|
-
- clojure
|
|
120
|
-
patterns:
|
|
121
|
-
- regex: .*
|
|
122
|
-
message: >-
|
|
123
|
-
Detected SHA1 hash algorithm which is considered insecure. SHA1 is not collision resistant and is therefore
|
|
124
|
-
not suitable as a cryptographic signature. Instead, use PBKDF2 for password hashing or SHA256 or SHA512 for
|
|
125
|
-
other hash function applications.
|
|
126
|
-
cwe:
|
|
127
|
-
- CWE-327
|
|
128
|
-
- CWE-328
|
|
129
|
-
owasp:
|
|
130
|
-
- A03:2017
|
|
131
|
-
- A02:2021
|
|
132
|
-
- A04:2025
|
|
133
|
-
references:
|
|
134
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html
|
|
135
|
-
- https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html
|
|
136
|
-
tags:
|
|
137
|
-
- clojure
|
|
138
|
-
- id: read-string-unsafe
|
|
139
|
-
name: read-string-unsafe
|
|
140
|
-
description: >-
|
|
141
|
-
The default core Clojure read-string method is dangerous and can lead to deserialization vulnerabilities. Use the
|
|
142
|
-
edn/read-string instead.
|
|
143
|
-
category: security
|
|
144
|
-
severity: high
|
|
145
|
-
confidence: medium
|
|
146
|
-
languages:
|
|
147
|
-
- clojure
|
|
148
|
-
patterns:
|
|
149
|
-
- pattern: |
|
|
150
|
-
(read-string $X)
|
|
151
|
-
message: >-
|
|
152
|
-
The default core Clojure read-string method is dangerous and can lead to deserialization vulnerabilities. Use
|
|
153
|
-
the edn/read-string instead.
|
|
154
|
-
cwe:
|
|
155
|
-
- CWE-502
|
|
156
|
-
owasp:
|
|
157
|
-
- A08:2017
|
|
158
|
-
- A08:2021
|
|
159
|
-
- A08:2025
|
|
160
|
-
references:
|
|
161
|
-
- http://www.learningclojure.com/2013/02/clojures-reader-is-unsafe.html#post-body-2898830171141471587
|
|
162
|
-
- https://ericnormand.me/article/clojure-web-security
|
|
163
|
-
- >-
|
|
164
|
-
https://github.com/jafingerhut/jafingerhut.github.com/blob/master/clojure-info/using-edn-safely.md#vulnerabilities-in-clojurecores-read-and-read-string
|
|
165
|
-
tags:
|
|
166
|
-
- clojure
|