dsh-code-security 0.3.7 → 0.4.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.
@@ -0,0 +1,72 @@
1
+ # Original rules for this plugin (MIT). No Semgrep-maintained registry rules bundled.
2
+ rules:
3
+ - id: dsh-js-command-input
4
+ languages: [javascript, typescript]
5
+ mode: taint
6
+ message: Request input flows into a shell command argument. Review quoting and use argument arrays.
7
+ severity: ERROR
8
+ metadata: {cwe: [CWE-78], confidence: MEDIUM}
9
+ pattern-sources:
10
+ - pattern-either:
11
+ - pattern: $REQ.query
12
+ - pattern: $REQ.body
13
+ - pattern: $REQ.params
14
+ pattern-sinks:
15
+ - patterns:
16
+ - pattern-either:
17
+ - pattern: exec($CMD, ...)
18
+ - pattern: execSync($CMD, ...)
19
+ - pattern: $CP.exec($CMD, ...)
20
+ - pattern: $CP.execSync($CMD, ...)
21
+ - focus-metavariable: $CMD
22
+ - id: dsh-js-html-input
23
+ languages: [javascript, typescript]
24
+ mode: taint
25
+ message: Request input flows into an HTML insertion point without a recognized sanitizer.
26
+ severity: ERROR
27
+ metadata: {cwe: [CWE-79], confidence: MEDIUM}
28
+ pattern-sources:
29
+ - pattern-either:
30
+ - pattern: $REQ.query
31
+ - pattern: $REQ.body
32
+ - pattern: $REQ.params
33
+ pattern-sinks:
34
+ - patterns:
35
+ - pattern: $EL.innerHTML = $HTML
36
+ - focus-metavariable: $HTML
37
+ - id: dsh-js-sql-input
38
+ languages: [javascript, typescript]
39
+ mode: taint
40
+ message: Request input flows into SQL text. Parameterized values are separate from SQL text.
41
+ severity: ERROR
42
+ metadata: {cwe: [CWE-89], confidence: MEDIUM}
43
+ pattern-sources:
44
+ - pattern-either:
45
+ - pattern: $REQ.query
46
+ - pattern: $REQ.body
47
+ - pattern: $REQ.params
48
+ pattern-sinks:
49
+ - patterns:
50
+ - pattern-either:
51
+ - pattern: $DB.query($SQL, ...)
52
+ - pattern: $DB.execute($SQL, ...)
53
+ - focus-metavariable: $SQL
54
+ - id: dsh-python-command-input
55
+ languages: [python]
56
+ mode: taint
57
+ message: Request input flows into a shell command argument.
58
+ severity: ERROR
59
+ metadata: {cwe: [CWE-78], confidence: MEDIUM}
60
+ pattern-sources:
61
+ - pattern-either:
62
+ - pattern: request.args
63
+ - pattern: request.form
64
+ - pattern: request.GET
65
+ - pattern: request.POST
66
+ pattern-sinks:
67
+ - patterns:
68
+ - pattern-either:
69
+ - pattern: os.system($CMD)
70
+ - pattern: subprocess.run($CMD, ..., shell=True, ...)
71
+ - pattern: subprocess.call($CMD, ..., shell=True, ...)
72
+ - focus-metavariable: $CMD