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,278 +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
|
|
47
|
-
- id: args-os
|
|
48
|
-
name: args-os
|
|
49
|
-
description: >-
|
|
50
|
-
args_os should not be used for security operations. From the docs: "The first element is traditionally the path of
|
|
51
|
-
the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not
|
|
52
|
-
be relied upon for security purposes."
|
|
53
|
-
category: security
|
|
54
|
-
severity: low
|
|
55
|
-
confidence: medium
|
|
56
|
-
languages:
|
|
57
|
-
- rust
|
|
58
|
-
patterns:
|
|
59
|
-
- pattern: std::env::args_os()
|
|
60
|
-
message: >-
|
|
61
|
-
args_os should not be used for security operations. From the docs: "The first element is traditionally the
|
|
62
|
-
path of the executable, but it can be set to arbitrary text, and might not even exist. This means this
|
|
63
|
-
property should not be relied upon for security purposes."
|
|
64
|
-
cwe:
|
|
65
|
-
- CWE-807
|
|
66
|
-
owasp: []
|
|
67
|
-
references:
|
|
68
|
-
- https://doc.rust-lang.org/stable/std/env/fn.args_os.html
|
|
69
|
-
tags:
|
|
70
|
-
- rust
|
|
71
|
-
- id: args
|
|
72
|
-
name: args
|
|
73
|
-
description: >-
|
|
74
|
-
args should not be used for security operations. From the docs: "The first element is traditionally the path of
|
|
75
|
-
the executable, but it can be set to arbitrary text, and might not even exist. This means this property should not
|
|
76
|
-
be relied upon for security purposes."
|
|
77
|
-
category: security
|
|
78
|
-
severity: low
|
|
79
|
-
confidence: medium
|
|
80
|
-
languages:
|
|
81
|
-
- rust
|
|
82
|
-
patterns:
|
|
83
|
-
- pattern: std::env::args()
|
|
84
|
-
message: >-
|
|
85
|
-
args should not be used for security operations. From the docs: "The first element is traditionally the path
|
|
86
|
-
of the executable, but it can be set to arbitrary text, and might not even exist. This means this property
|
|
87
|
-
should not be relied upon for security purposes."
|
|
88
|
-
cwe:
|
|
89
|
-
- CWE-807
|
|
90
|
-
owasp: []
|
|
91
|
-
references:
|
|
92
|
-
- https://doc.rust-lang.org/stable/std/env/fn.args.html
|
|
93
|
-
tags:
|
|
94
|
-
- rust
|
|
95
|
-
- id: current-exe
|
|
96
|
-
name: current-exe
|
|
97
|
-
description: >-
|
|
98
|
-
current_exe should not be used for security operations. From the docs: "The output of this function should not be
|
|
99
|
-
trusted for anything that might have security implications. Basically, if users can run the executable, they can
|
|
100
|
-
change the output arbitrarily."
|
|
101
|
-
category: security
|
|
102
|
-
severity: low
|
|
103
|
-
confidence: medium
|
|
104
|
-
languages:
|
|
105
|
-
- rust
|
|
106
|
-
patterns:
|
|
107
|
-
- pattern: std::env::current_exe()
|
|
108
|
-
message: >-
|
|
109
|
-
current_exe should not be used for security operations. From the docs: "The output of this function should not
|
|
110
|
-
be trusted for anything that might have security implications. Basically, if users can run the executable,
|
|
111
|
-
they can change the output arbitrarily."
|
|
112
|
-
cwe:
|
|
113
|
-
- CWE-807
|
|
114
|
-
owasp: []
|
|
115
|
-
references:
|
|
116
|
-
- https://doc.rust-lang.org/stable/std/env/fn.current_exe.html#security
|
|
117
|
-
tags:
|
|
118
|
-
- rust
|
|
119
|
-
- id: insecure-hashes
|
|
120
|
-
name: insecure-hashes
|
|
121
|
-
description: Detected cryptographically insecure hashing function
|
|
122
|
-
category: crypto
|
|
123
|
-
severity: medium
|
|
124
|
-
confidence: medium
|
|
125
|
-
languages:
|
|
126
|
-
- rust
|
|
127
|
-
patterns:
|
|
128
|
-
- pattern: md2::Md2::new(...)
|
|
129
|
-
message: Detected cryptographically insecure hashing function
|
|
130
|
-
- pattern: md4::Md4::new(...)
|
|
131
|
-
message: Detected cryptographically insecure hashing function
|
|
132
|
-
- pattern: md5::Md5::new(...)
|
|
133
|
-
message: Detected cryptographically insecure hashing function
|
|
134
|
-
- pattern: sha1::Sha1::new(...)
|
|
135
|
-
message: Detected cryptographically insecure hashing function
|
|
136
|
-
cwe:
|
|
137
|
-
- CWE-328
|
|
138
|
-
owasp: []
|
|
139
|
-
references:
|
|
140
|
-
- https://github.com/RustCrypto/hashes
|
|
141
|
-
- https://docs.rs/md2/latest/md2/
|
|
142
|
-
- https://docs.rs/md4/latest/md4/
|
|
143
|
-
- https://docs.rs/md5/latest/md5/
|
|
144
|
-
- https://docs.rs/sha-1/latest/sha1/
|
|
145
|
-
tags:
|
|
146
|
-
- rust
|
|
147
|
-
- id: reqwest-accept-invalid
|
|
148
|
-
name: reqwest-accept-invalid
|
|
149
|
-
description: Dangerously accepting invalid TLS information
|
|
150
|
-
category: security
|
|
151
|
-
severity: medium
|
|
152
|
-
confidence: medium
|
|
153
|
-
languages:
|
|
154
|
-
- rust
|
|
155
|
-
patterns:
|
|
156
|
-
- pattern: reqwest::Client::builder(). ... .danger_accept_invalid_hostnames(true)
|
|
157
|
-
message: Dangerously accepting invalid TLS information
|
|
158
|
-
- pattern: reqwest::Client::builder(). ... .danger_accept_invalid_certs(true)
|
|
159
|
-
message: Dangerously accepting invalid TLS information
|
|
160
|
-
cwe:
|
|
161
|
-
- CWE-295
|
|
162
|
-
owasp: []
|
|
163
|
-
references:
|
|
164
|
-
- https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.danger_accept_invalid_hostnames
|
|
165
|
-
- https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.danger_accept_invalid_certs
|
|
166
|
-
tags:
|
|
167
|
-
- reqwest
|
|
168
|
-
- id: reqwest-set-sensitive
|
|
169
|
-
name: reqwest-set-sensitive
|
|
170
|
-
description: Set sensitive flag on security headers with 'set_sensitive' to treat data with special care
|
|
171
|
-
category: security
|
|
172
|
-
severity: low
|
|
173
|
-
confidence: medium
|
|
174
|
-
languages:
|
|
175
|
-
- rust
|
|
176
|
-
patterns:
|
|
177
|
-
- pattern: |
|
|
178
|
-
let mut $HEADERS = header::HeaderMap::new();
|
|
179
|
-
...
|
|
180
|
-
let $HEADER_VALUE = <... header::HeaderValue::$FROM_FUNC(...) ...>;
|
|
181
|
-
...
|
|
182
|
-
$HEADERS.insert($HEADER, $HEADER_VALUE);
|
|
183
|
-
message: Set sensitive flag on security headers with 'set_sensitive' to treat data with special care
|
|
184
|
-
cwe:
|
|
185
|
-
- CWE-921
|
|
186
|
-
owasp: []
|
|
187
|
-
references:
|
|
188
|
-
- https://docs.rs/reqwest/latest/reqwest/header/struct.HeaderValue.html#method.set_sensitive
|
|
189
|
-
tags:
|
|
190
|
-
- reqwest
|
|
191
|
-
- id: rustls-dangerous
|
|
192
|
-
name: rustls-dangerous
|
|
193
|
-
description: Dangerous client config used, ensure SSL verification
|
|
194
|
-
category: security
|
|
195
|
-
severity: medium
|
|
196
|
-
confidence: medium
|
|
197
|
-
languages:
|
|
198
|
-
- rust
|
|
199
|
-
patterns:
|
|
200
|
-
- pattern: rustls::client::DangerousClientConfig
|
|
201
|
-
message: Dangerous client config used, ensure SSL verification
|
|
202
|
-
- pattern: $CLIENT.dangerous().set_certificate_verifier(...)
|
|
203
|
-
message: Dangerous client config used, ensure SSL verification
|
|
204
|
-
- pattern: |
|
|
205
|
-
let $CLIENT = rustls::client::ClientConfig::dangerous(...);
|
|
206
|
-
...
|
|
207
|
-
$CLIENT.set_certificate_verifier(...);
|
|
208
|
-
message: Dangerous client config used, ensure SSL verification
|
|
209
|
-
cwe:
|
|
210
|
-
- CWE-295
|
|
211
|
-
owasp: []
|
|
212
|
-
references:
|
|
213
|
-
- https://docs.rs/rustls/latest/rustls/client/struct.DangerousClientConfig.html
|
|
214
|
-
- https://docs.rs/rustls/latest/rustls/client/struct.ClientConfig.html#method.dangerous
|
|
215
|
-
tags:
|
|
216
|
-
- rustls
|
|
217
|
-
- id: ssl-verify-none
|
|
218
|
-
name: ssl-verify-none
|
|
219
|
-
description: SSL verification disabled, this allows for MitM attacks
|
|
220
|
-
category: security
|
|
221
|
-
severity: medium
|
|
222
|
-
confidence: medium
|
|
223
|
-
languages:
|
|
224
|
-
- rust
|
|
225
|
-
patterns:
|
|
226
|
-
- pattern: $BUILDER.set_verify(openssl::ssl::SSL_VERIFY_NONE)
|
|
227
|
-
message: SSL verification disabled, this allows for MitM attacks
|
|
228
|
-
cwe:
|
|
229
|
-
- CWE-295
|
|
230
|
-
owasp: []
|
|
231
|
-
references:
|
|
232
|
-
- https://docs.rs/openssl/latest/openssl/ssl/struct.SslContextBuilder.html#method.set_verify
|
|
233
|
-
tags:
|
|
234
|
-
- openssl
|
|
235
|
-
- id: temp-dir
|
|
236
|
-
name: temp-dir
|
|
237
|
-
description: >-
|
|
238
|
-
temp_dir should not be used for security operations. From the docs: 'The temporary directory may be shared among
|
|
239
|
-
users, or between processes with different privileges; thus, the creation of any files or directories in the
|
|
240
|
-
temporary directory must use a secure method to create a uniquely named file. Creating a file or directory with a
|
|
241
|
-
fixed or predictable name may result in “insecure temporary file” security vulnerabilities.'
|
|
242
|
-
category: security
|
|
243
|
-
severity: low
|
|
244
|
-
confidence: medium
|
|
245
|
-
languages:
|
|
246
|
-
- rust
|
|
247
|
-
patterns:
|
|
248
|
-
- pattern: std::env::temp_dir()
|
|
249
|
-
message: >-
|
|
250
|
-
temp_dir should not be used for security operations. From the docs: 'The temporary directory may be shared
|
|
251
|
-
among users, or between processes with different privileges; thus, the creation of any files or directories in
|
|
252
|
-
the temporary directory must use a secure method to create a uniquely named file. Creating a file or directory
|
|
253
|
-
with a fixed or predictable name may result in “insecure temporary file” security vulnerabilities.'
|
|
254
|
-
cwe:
|
|
255
|
-
- CWE-807
|
|
256
|
-
owasp: []
|
|
257
|
-
references:
|
|
258
|
-
- https://doc.rust-lang.org/stable/std/env/fn.temp_dir.html
|
|
259
|
-
tags:
|
|
260
|
-
- rust
|
|
261
|
-
- id: unsafe-usage
|
|
262
|
-
name: unsafe-usage
|
|
263
|
-
description: Detected 'unsafe' usage, please audit for secure usage
|
|
264
|
-
category: security
|
|
265
|
-
severity: low
|
|
266
|
-
confidence: medium
|
|
267
|
-
languages:
|
|
268
|
-
- rust
|
|
269
|
-
patterns:
|
|
270
|
-
- pattern: unsafe { ... }
|
|
271
|
-
message: Detected 'unsafe' usage, please audit for secure usage
|
|
272
|
-
cwe:
|
|
273
|
-
- CWE-242
|
|
274
|
-
owasp: []
|
|
275
|
-
references:
|
|
276
|
-
- https://doc.rust-lang.org/std/keyword.unsafe.html
|
|
277
|
-
tags:
|
|
278
|
-
- rust
|