pinata-security-cli 0.6.0 → 0.6.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/dist/cli/index.js +1527 -369
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -1
- package/src/categories/definitions/data/data-race.yml +6 -2
- package/src/categories/definitions/input/boundary-testing.yml +7 -0
- package/src/categories/definitions/input/injection-fuzzing.yml +19 -0
- package/src/categories/definitions/input/null-undefined.yml +14 -0
- package/src/categories/definitions/network/connection-failure.yml +8 -2
- package/src/categories/definitions/resource/memory-leak.yml +7 -2
- package/src/categories/definitions/security/auth-failures.yml +8 -0
- package/src/categories/definitions/security/command-injection.yml +17 -0
- package/src/categories/definitions/security/csrf.yml +19 -0
- package/src/categories/definitions/security/data-exposure.yml +24 -0
- package/src/categories/definitions/security/dependency-risks.yml +6 -6
- package/src/categories/definitions/security/deserialization.yml +44 -0
- package/src/categories/definitions/security/file-upload.yml +39 -0
- package/src/categories/definitions/security/ldap-injection.yml +23 -0
- package/src/categories/definitions/security/path-traversal.yml +13 -0
- package/src/categories/definitions/security/prompt-injection.yml +14 -0
- package/src/categories/definitions/security/sql-injection.yml +30 -0
- package/src/categories/definitions/security/ssrf.yml +60 -0
- package/src/categories/definitions/security/xss.yml +36 -0
- package/src/categories/definitions/security/xxe.yml +32 -0
|
@@ -69,6 +69,18 @@ detectionPatterns:
|
|
|
69
69
|
pattern: "fetch\\s*\\(.*req\\.(body|query|params)"
|
|
70
70
|
confidence: high
|
|
71
71
|
description: Detects fetch with user-controlled URL
|
|
72
|
+
sources:
|
|
73
|
+
- "req\\.(body|params|query|headers)"
|
|
74
|
+
- "\\buser[Ii]nput\\b"
|
|
75
|
+
- "searchParams\\.get\\("
|
|
76
|
+
- "\\bprocess\\.argv"
|
|
77
|
+
sanitizers:
|
|
78
|
+
- "new\\s+URL\\(.*\\)"
|
|
79
|
+
- "url\\.parse\\("
|
|
80
|
+
- "isAllowedUrl\\("
|
|
81
|
+
- "allowlist|whitelist"
|
|
82
|
+
- "isPrivateIP\\(|isInternalIP\\("
|
|
83
|
+
- "ipaddr\\.process\\("
|
|
72
84
|
|
|
73
85
|
- id: ts-axios-user-url
|
|
74
86
|
type: regex
|
|
@@ -76,6 +88,18 @@ detectionPatterns:
|
|
|
76
88
|
pattern: "axios\\.(get|post|put|delete|patch)\\s*\\(.*req\\."
|
|
77
89
|
confidence: high
|
|
78
90
|
description: Detects axios with user-controlled URL
|
|
91
|
+
sources:
|
|
92
|
+
- "req\\.(body|params|query|headers)"
|
|
93
|
+
- "\\buser[Ii]nput\\b"
|
|
94
|
+
- "searchParams\\.get\\("
|
|
95
|
+
- "\\bprocess\\.argv"
|
|
96
|
+
sanitizers:
|
|
97
|
+
- "new\\s+URL\\(.*\\)"
|
|
98
|
+
- "url\\.parse\\("
|
|
99
|
+
- "isAllowedUrl\\("
|
|
100
|
+
- "allowlist|whitelist"
|
|
101
|
+
- "isPrivateIP\\(|isInternalIP\\("
|
|
102
|
+
- "ipaddr\\.process\\("
|
|
79
103
|
|
|
80
104
|
- id: ts-got-user-url
|
|
81
105
|
type: regex
|
|
@@ -83,6 +107,18 @@ detectionPatterns:
|
|
|
83
107
|
pattern: "got\\s*\\(.*req\\.|got\\.(get|post)\\s*\\(.*req\\."
|
|
84
108
|
confidence: high
|
|
85
109
|
description: Detects got library with user-controlled URL
|
|
110
|
+
sources:
|
|
111
|
+
- "req\\.(body|params|query|headers)"
|
|
112
|
+
- "\\buser[Ii]nput\\b"
|
|
113
|
+
- "searchParams\\.get\\("
|
|
114
|
+
- "\\bprocess\\.argv"
|
|
115
|
+
sanitizers:
|
|
116
|
+
- "new\\s+URL\\(.*\\)"
|
|
117
|
+
- "url\\.parse\\("
|
|
118
|
+
- "isAllowedUrl\\("
|
|
119
|
+
- "allowlist|whitelist"
|
|
120
|
+
- "isPrivateIP\\(|isInternalIP\\("
|
|
121
|
+
- "ipaddr\\.process\\("
|
|
86
122
|
|
|
87
123
|
- id: ts-node-fetch-user
|
|
88
124
|
type: regex
|
|
@@ -90,6 +126,18 @@ detectionPatterns:
|
|
|
90
126
|
pattern: "node-fetch.*req\\.(body|query|params)"
|
|
91
127
|
confidence: high
|
|
92
128
|
description: Detects node-fetch with user-controlled URL
|
|
129
|
+
sources:
|
|
130
|
+
- "req\\.(body|params|query|headers)"
|
|
131
|
+
- "\\buser[Ii]nput\\b"
|
|
132
|
+
- "searchParams\\.get\\("
|
|
133
|
+
- "\\bprocess\\.argv"
|
|
134
|
+
sanitizers:
|
|
135
|
+
- "new\\s+URL\\(.*\\)"
|
|
136
|
+
- "url\\.parse\\("
|
|
137
|
+
- "isAllowedUrl\\("
|
|
138
|
+
- "allowlist|whitelist"
|
|
139
|
+
- "isPrivateIP\\(|isInternalIP\\("
|
|
140
|
+
- "ipaddr\\.process\\("
|
|
93
141
|
|
|
94
142
|
- id: ts-http-request-user
|
|
95
143
|
type: regex
|
|
@@ -97,6 +145,18 @@ detectionPatterns:
|
|
|
97
145
|
pattern: "http\\.request\\s*\\(.*req\\.|https\\.request\\s*\\(.*req\\."
|
|
98
146
|
confidence: high
|
|
99
147
|
description: Detects native http/https with user-controlled URL
|
|
148
|
+
sources:
|
|
149
|
+
- "req\\.(body|params|query|headers)"
|
|
150
|
+
- "\\buser[Ii]nput\\b"
|
|
151
|
+
- "searchParams\\.get\\("
|
|
152
|
+
- "\\bprocess\\.argv"
|
|
153
|
+
sanitizers:
|
|
154
|
+
- "new\\s+URL\\(.*\\)"
|
|
155
|
+
- "url\\.parse\\("
|
|
156
|
+
- "isAllowedUrl\\("
|
|
157
|
+
- "allowlist|whitelist"
|
|
158
|
+
- "isPrivateIP\\(|isInternalIP\\("
|
|
159
|
+
- "ipaddr\\.process\\("
|
|
100
160
|
|
|
101
161
|
testTemplates:
|
|
102
162
|
- id: pytest-ssrf
|
|
@@ -63,6 +63,21 @@ detectionPatterns:
|
|
|
63
63
|
pattern: "\\.innerHTML\\s*=|\\.outerHTML\\s*="
|
|
64
64
|
confidence: high
|
|
65
65
|
description: Detects direct innerHTML/outerHTML assignment
|
|
66
|
+
sources:
|
|
67
|
+
- "req\\.(body|params|query|headers)"
|
|
68
|
+
- "\\buser[Ii]nput\\b"
|
|
69
|
+
- "searchParams\\.get\\("
|
|
70
|
+
- "\\blocation\\.(hash|search|href)"
|
|
71
|
+
- "\\bwindow\\.location"
|
|
72
|
+
- "\\bdocument\\.cookie"
|
|
73
|
+
- "\\bURLSearchParams"
|
|
74
|
+
sanitizers:
|
|
75
|
+
- "DOMPurify\\.sanitize\\("
|
|
76
|
+
- "escapeHtml\\("
|
|
77
|
+
- "sanitizeHtml\\("
|
|
78
|
+
- "encodeURIComponent\\("
|
|
79
|
+
- "textContent\\s*="
|
|
80
|
+
- "xss\\("
|
|
66
81
|
|
|
67
82
|
- id: ts-document-write
|
|
68
83
|
type: regex
|
|
@@ -70,6 +85,14 @@ detectionPatterns:
|
|
|
70
85
|
pattern: "document\\.write\\s*\\(|document\\.writeln\\s*\\("
|
|
71
86
|
confidence: high
|
|
72
87
|
description: Detects document.write() which is vulnerable to XSS
|
|
88
|
+
sources:
|
|
89
|
+
- "req\\.(body|params|query|headers)"
|
|
90
|
+
- "\\blocation\\.(hash|search|href)"
|
|
91
|
+
- "\\bURLSearchParams"
|
|
92
|
+
sanitizers:
|
|
93
|
+
- "DOMPurify\\.sanitize\\("
|
|
94
|
+
- "escapeHtml\\("
|
|
95
|
+
- "encodeURIComponent\\("
|
|
73
96
|
|
|
74
97
|
- id: ts-dangerouslysetinnerhtml
|
|
75
98
|
type: regex
|
|
@@ -78,6 +101,15 @@ detectionPatterns:
|
|
|
78
101
|
confidence: medium
|
|
79
102
|
description: Detects React dangerouslySetInnerHTML usage
|
|
80
103
|
negativePattern: "DOMPurify\\.sanitize|sanitizeHtml|xss\\("
|
|
104
|
+
sources:
|
|
105
|
+
- "req\\.(body|params|query|headers)"
|
|
106
|
+
- "\\bprops\\."
|
|
107
|
+
- "\\buseSearchParams"
|
|
108
|
+
- "\\bfetch\\("
|
|
109
|
+
sanitizers:
|
|
110
|
+
- "DOMPurify\\.sanitize\\("
|
|
111
|
+
- "sanitizeHtml\\("
|
|
112
|
+
- "xss\\("
|
|
81
113
|
|
|
82
114
|
- id: ts-eval-user-input
|
|
83
115
|
type: regex
|
|
@@ -85,6 +117,10 @@ detectionPatterns:
|
|
|
85
117
|
pattern: "eval\\s*\\(|new\\s+Function\\s*\\(|setTimeout\\s*\\(\\s*[`\"'].*\\$\\{"
|
|
86
118
|
confidence: high
|
|
87
119
|
description: Detects eval() or Function() with potential user input
|
|
120
|
+
sources:
|
|
121
|
+
- "req\\.(body|params|query|headers)"
|
|
122
|
+
- "\\buser[Ii]nput\\b"
|
|
123
|
+
- "searchParams\\.get\\("
|
|
88
124
|
|
|
89
125
|
- id: ts-jquery-html
|
|
90
126
|
type: regex
|
|
@@ -71,6 +71,15 @@ detectionPatterns:
|
|
|
71
71
|
pattern: "DOMParser\\s*\\(\\)|xmldom|xml2js"
|
|
72
72
|
confidence: medium
|
|
73
73
|
description: Detects XML parsing libraries that may allow XXE
|
|
74
|
+
sources:
|
|
75
|
+
- "req\\.(body|params|query|headers)"
|
|
76
|
+
- "\\buser[Ii]nput\\b"
|
|
77
|
+
- "searchParams\\.get\\("
|
|
78
|
+
sanitizers:
|
|
79
|
+
- "disableExternalEntities"
|
|
80
|
+
- "noent:\\s*false"
|
|
81
|
+
- "explicitCharkey"
|
|
82
|
+
- "xmlParserOptions.*noent"
|
|
74
83
|
|
|
75
84
|
- id: ts-libxmljs
|
|
76
85
|
type: regex
|
|
@@ -79,6 +88,14 @@ detectionPatterns:
|
|
|
79
88
|
confidence: high
|
|
80
89
|
description: Detects libxmljs which allows XXE by default
|
|
81
90
|
negativePattern: "noent:\\s*false|nonet:\\s*true"
|
|
91
|
+
sources:
|
|
92
|
+
- "req\\.(body|params|query|headers)"
|
|
93
|
+
- "\\buser[Ii]nput\\b"
|
|
94
|
+
- "searchParams\\.get\\("
|
|
95
|
+
sanitizers:
|
|
96
|
+
- "noent:\\s*false"
|
|
97
|
+
- "nonet:\\s*true"
|
|
98
|
+
- "disableExternalEntities"
|
|
82
99
|
|
|
83
100
|
- id: ts-fast-xml-parser
|
|
84
101
|
type: regex
|
|
@@ -86,6 +103,14 @@ detectionPatterns:
|
|
|
86
103
|
pattern: "XMLParser\\s*\\(\\)|fast-xml-parser"
|
|
87
104
|
confidence: low
|
|
88
105
|
description: Detects fast-xml-parser usage (check external entity settings)
|
|
106
|
+
sources:
|
|
107
|
+
- "req\\.(body|params|query|headers)"
|
|
108
|
+
- "\\buser[Ii]nput\\b"
|
|
109
|
+
- "searchParams\\.get\\("
|
|
110
|
+
sanitizers:
|
|
111
|
+
- "processEntities:\\s*false"
|
|
112
|
+
- "disableExternalEntities"
|
|
113
|
+
- "noent:\\s*false"
|
|
89
114
|
|
|
90
115
|
- id: ts-express-xml
|
|
91
116
|
type: regex
|
|
@@ -93,6 +118,13 @@ detectionPatterns:
|
|
|
93
118
|
pattern: "express-xml-bodyparser|body-parser-xml"
|
|
94
119
|
confidence: medium
|
|
95
120
|
description: Detects Express XML body parsers that may enable XXE
|
|
121
|
+
sources:
|
|
122
|
+
- "req\\.(body|params|query|headers)"
|
|
123
|
+
- "\\buser[Ii]nput\\b"
|
|
124
|
+
sanitizers:
|
|
125
|
+
- "disableExternalEntities"
|
|
126
|
+
- "noent:\\s*false"
|
|
127
|
+
- "xmlParserOptions.*noent"
|
|
96
128
|
|
|
97
129
|
testTemplates:
|
|
98
130
|
- id: pytest-xxe
|