@runsec/mcp 1.0.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/index.js +578 -0
- package/package.json +43 -0
- package/src/rules/data/rule-compliance-map.json +43563 -0
- package/src/rules/data/semgrep-rules/README-taint-overlays.md +21 -0
- package/src/rules/data/semgrep-rules/advanced-agent-cloud.yaml +802 -0
- package/src/rules/data/semgrep-rules/app-logic.yaml +445 -0
- package/src/rules/data/semgrep-rules/auth-keycloak.yaml +831 -0
- package/src/rules/data/semgrep-rules/browser-agent.yaml +260 -0
- package/src/rules/data/semgrep-rules/cloud-secrets.yaml +316 -0
- package/src/rules/data/semgrep-rules/csharp-dotnet.yaml +4864 -0
- package/src/rules/data/semgrep-rules/desktop-electron-pro.yaml +30 -0
- package/src/rules/data/semgrep-rules/desktop-vsto-suite.yaml +2759 -0
- package/src/rules/data/semgrep-rules/devops-security.yaml +393 -0
- package/src/rules/data/semgrep-rules/domain-access-management.yaml +1023 -0
- package/src/rules/data/semgrep-rules/domain-data-privacy.yaml +852 -0
- package/src/rules/data/semgrep-rules/domain-input-validation.yaml +2894 -0
- package/src/rules/data/semgrep-rules/domain-platform-hardening.yaml +1715 -0
- package/src/rules/data/semgrep-rules/ds-ml-security.yaml +2431 -0
- package/src/rules/data/semgrep-rules/fastapi-async.yaml +5953 -0
- package/src/rules/data/semgrep-rules/frontend-react.yaml +4035 -0
- package/src/rules/data/semgrep-rules/frontend-security.yaml +200 -0
- package/src/rules/data/semgrep-rules/go-core.yaml +4959 -0
- package/src/rules/data/semgrep-rules/hft-cpp-security.yaml +631 -0
- package/src/rules/data/semgrep-rules/infra-k8s-helm.yaml +4968 -0
- package/src/rules/data/semgrep-rules/integration-security.yaml +2362 -0
- package/src/rules/data/semgrep-rules/java-enterprise.yaml +14756 -0
- package/src/rules/data/semgrep-rules/java-spring.yaml +397 -0
- package/src/rules/data/semgrep-rules/license-compliance.yaml +186 -0
- package/src/rules/data/semgrep-rules/mobile-flutter.yaml +37 -0
- package/src/rules/data/semgrep-rules/mobile-security.yaml +721 -0
- package/src/rules/data/semgrep-rules/nodejs-nestjs.yaml +5164 -0
- package/src/rules/data/semgrep-rules/nodejs-security.yaml +326 -0
- package/src/rules/data/semgrep-rules/observability.yaml +381 -0
- package/src/rules/data/semgrep-rules/php-security.yaml +3601 -0
- package/src/rules/data/semgrep-rules/python-backend-pro.yaml +30 -0
- package/src/rules/data/semgrep-rules/python-django.yaml +181 -0
- package/src/rules/data/semgrep-rules/python-security.yaml +284 -0
- package/src/rules/data/semgrep-rules/ru-regulatory.yaml +496 -0
- package/src/rules/data/semgrep-rules/ruby-rails.yaml +3078 -0
- package/src/rules/data/semgrep-rules/rust-security.yaml +2701 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
rules:
|
|
2
|
+
- id: runsec.python-backend-pro.py-100
|
|
3
|
+
pattern-either:
|
|
4
|
+
- pattern: |-
|
|
5
|
+
if token == os.getenv("CHAT_TOKEN"):
|
|
6
|
+
return True
|
|
7
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-100\\b'
|
|
8
|
+
message: 'RunSec Detection [PY-100]: Enterprise backend security baseline'
|
|
9
|
+
languages:
|
|
10
|
+
- python
|
|
11
|
+
severity: WARNING
|
|
12
|
+
- id: runsec.python-backend-pro.py-105
|
|
13
|
+
pattern-either:
|
|
14
|
+
- pattern: |-
|
|
15
|
+
def get_queryset(self):
|
|
16
|
+
return Message.objects.all()
|
|
17
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-105\\b'
|
|
18
|
+
message: 'RunSec Detection [PY-105]: Enterprise backend security baseline'
|
|
19
|
+
languages:
|
|
20
|
+
- python
|
|
21
|
+
severity: WARNING
|
|
22
|
+
- id: runsec.python-backend-pro.py-110
|
|
23
|
+
pattern-either:
|
|
24
|
+
- pattern: |-
|
|
25
|
+
file_full_path = path.join(settings.MEDIA_ROOT, file_path)
|
|
26
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-110\\b'
|
|
27
|
+
message: 'RunSec Detection [PY-110]: Enterprise backend security baseline'
|
|
28
|
+
languages:
|
|
29
|
+
- python
|
|
30
|
+
severity: WARNING
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
rules:
|
|
2
|
+
- id: runsec.python-django.dja-001
|
|
3
|
+
pattern-either:
|
|
4
|
+
- pattern: |-
|
|
5
|
+
@csrf_exempt
|
|
6
|
+
def update_profile(request):
|
|
7
|
+
...
|
|
8
|
+
return JsonResponse({"ok": True})
|
|
9
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-001\\b'
|
|
10
|
+
message: 'RunSec Detection [DJA-001]: CWE-352'
|
|
11
|
+
languages:
|
|
12
|
+
- python
|
|
13
|
+
severity: WARNING
|
|
14
|
+
- id: runsec.python-django.dja-002
|
|
15
|
+
pattern-either:
|
|
16
|
+
- pattern: |-
|
|
17
|
+
q = "SELECT * FROM users WHERE email = '" + email + "'"
|
|
18
|
+
...
|
|
19
|
+
User.objects.raw(q)
|
|
20
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-002\\b'
|
|
21
|
+
message: 'RunSec Detection [DJA-002]: CWE-89'
|
|
22
|
+
languages:
|
|
23
|
+
- python
|
|
24
|
+
severity: WARNING
|
|
25
|
+
- id: runsec.python-django.dja-003
|
|
26
|
+
pattern-either:
|
|
27
|
+
- pattern: |-
|
|
28
|
+
DEBUG = True
|
|
29
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-003\\b'
|
|
30
|
+
message: 'RunSec Detection [DJA-003]: CWE-489'
|
|
31
|
+
languages:
|
|
32
|
+
- python
|
|
33
|
+
severity: WARNING
|
|
34
|
+
- id: runsec.python-django.dja-004
|
|
35
|
+
pattern-either:
|
|
36
|
+
- pattern: |-
|
|
37
|
+
class UserForm(forms.ModelForm):
|
|
38
|
+
class Meta:
|
|
39
|
+
model = User
|
|
40
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-004\\b'
|
|
41
|
+
message: 'RunSec Detection [DJA-004]: CWE-915'
|
|
42
|
+
languages:
|
|
43
|
+
- python
|
|
44
|
+
severity: WARNING
|
|
45
|
+
- id: runsec.python-django.dja-005
|
|
46
|
+
pattern-either:
|
|
47
|
+
- pattern: |-
|
|
48
|
+
ALLOWED_HOSTS = ["*"]
|
|
49
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-005\\b'
|
|
50
|
+
message: 'RunSec Detection [DJA-005]: CWE-346'
|
|
51
|
+
languages:
|
|
52
|
+
- python
|
|
53
|
+
severity: WARNING
|
|
54
|
+
- id: runsec.python-django.dja-006
|
|
55
|
+
pattern-either:
|
|
56
|
+
- pattern: |-
|
|
57
|
+
return redirect(request.GET.get("next"))
|
|
58
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-006\\b'
|
|
59
|
+
message: 'RunSec Detection [DJA-006]: CWE-601'
|
|
60
|
+
languages:
|
|
61
|
+
- python
|
|
62
|
+
severity: WARNING
|
|
63
|
+
- id: runsec.python-django.dja-007
|
|
64
|
+
pattern-either:
|
|
65
|
+
- pattern: |-
|
|
66
|
+
SESSION_COOKIE_SECURE = False
|
|
67
|
+
CSRF_COOKIE_SECURE = False
|
|
68
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-007\\b'
|
|
69
|
+
message: 'RunSec Detection [DJA-007]: CWE-614'
|
|
70
|
+
languages:
|
|
71
|
+
- python
|
|
72
|
+
severity: WARNING
|
|
73
|
+
- id: runsec.python-django.dja-008
|
|
74
|
+
pattern-either:
|
|
75
|
+
- pattern: |-
|
|
76
|
+
SECRET_KEY = "django-insecure-hardcoded-secret"
|
|
77
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-008\\b'
|
|
78
|
+
message: 'RunSec Detection [DJA-008]: CWE-798'
|
|
79
|
+
languages:
|
|
80
|
+
- python
|
|
81
|
+
severity: WARNING
|
|
82
|
+
- id: runsec.python-django.dja-009
|
|
83
|
+
pattern-either:
|
|
84
|
+
- pattern: |-
|
|
85
|
+
path = os.path.join("/data/uploads", upload.name)
|
|
86
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-009\\b'
|
|
87
|
+
message: 'RunSec Detection [DJA-009]: CWE-22'
|
|
88
|
+
languages:
|
|
89
|
+
- python
|
|
90
|
+
severity: WARNING
|
|
91
|
+
- id: runsec.python-django.dja-010
|
|
92
|
+
pattern-either:
|
|
93
|
+
- pattern: |-
|
|
94
|
+
try:
|
|
95
|
+
...
|
|
96
|
+
except Exception as e:
|
|
97
|
+
return JsonResponse({"error": str(e)}, status=500)
|
|
98
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-010\\b'
|
|
99
|
+
message: 'RunSec Detection [DJA-010]: CWE-209'
|
|
100
|
+
languages:
|
|
101
|
+
- python
|
|
102
|
+
severity: WARNING
|
|
103
|
+
- id: runsec.python-django.dja-011
|
|
104
|
+
pattern-either:
|
|
105
|
+
- pattern: |-
|
|
106
|
+
html = mark_safe(user_input)
|
|
107
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-011\\b'
|
|
108
|
+
message: 'RunSec Detection [DJA-011]: CWE-79'
|
|
109
|
+
languages:
|
|
110
|
+
- python
|
|
111
|
+
severity: WARNING
|
|
112
|
+
- id: runsec.python-django.dja-012
|
|
113
|
+
pattern-either:
|
|
114
|
+
- pattern: |-
|
|
115
|
+
SESSION_SERIALIZER = "django.contrib.sessions.serializers.PickleSerializer"
|
|
116
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-012\\b'
|
|
117
|
+
message: 'RunSec Detection [DJA-012]: CWE-502'
|
|
118
|
+
languages:
|
|
119
|
+
- python
|
|
120
|
+
severity: WARNING
|
|
121
|
+
- id: runsec.python-django.dja-013
|
|
122
|
+
pattern-either:
|
|
123
|
+
- pattern: |-
|
|
124
|
+
qs = User.objects.extra(where=["id=%s" % user_id])
|
|
125
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-013\\b'
|
|
126
|
+
message: 'RunSec Detection [DJA-013]: CWE-89'
|
|
127
|
+
languages:
|
|
128
|
+
- python
|
|
129
|
+
severity: WARNING
|
|
130
|
+
- id: runsec.python-django.dja-014
|
|
131
|
+
pattern-either:
|
|
132
|
+
- pattern: |-
|
|
133
|
+
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
|
|
134
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-014\\b'
|
|
135
|
+
message: 'RunSec Detection [DJA-014]: CWE-330'
|
|
136
|
+
languages:
|
|
137
|
+
- python
|
|
138
|
+
severity: WARNING
|
|
139
|
+
- id: runsec.python-django.dja-015
|
|
140
|
+
pattern-either:
|
|
141
|
+
- pattern: |-
|
|
142
|
+
LOGOUT_REDIRECT_URL = request.GET.get("next")
|
|
143
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-015\\b'
|
|
144
|
+
message: 'RunSec Detection [DJA-015]: CWE-601'
|
|
145
|
+
languages:
|
|
146
|
+
- python
|
|
147
|
+
severity: WARNING
|
|
148
|
+
- id: runsec.python-django.dja-016
|
|
149
|
+
pattern-either:
|
|
150
|
+
- pattern: |-
|
|
151
|
+
urlpatterns = [
|
|
152
|
+
re_path(r"^(a+)+$", view),
|
|
153
|
+
]
|
|
154
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-016\\b'
|
|
155
|
+
message: 'RunSec Detection [DJA-016]: CWE-400'
|
|
156
|
+
languages:
|
|
157
|
+
- python
|
|
158
|
+
severity: WARNING
|
|
159
|
+
- id: runsec.python-django.dja-017
|
|
160
|
+
pattern-either:
|
|
161
|
+
- pattern: |-
|
|
162
|
+
class AdminForm(forms.ModelForm):
|
|
163
|
+
class Meta:
|
|
164
|
+
model = User
|
|
165
|
+
exclude = []
|
|
166
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-017\\b'
|
|
167
|
+
message: 'RunSec Detection [DJA-017]: CWE-915'
|
|
168
|
+
languages:
|
|
169
|
+
- python
|
|
170
|
+
severity: WARNING
|
|
171
|
+
- id: runsec.python-django.dja-018
|
|
172
|
+
pattern-either:
|
|
173
|
+
- pattern: |-
|
|
174
|
+
class PaymentsView(View):
|
|
175
|
+
def dispatch(self, request, *args, **kwargs):
|
|
176
|
+
...
|
|
177
|
+
- pattern-regex: 'Vulnerable:\\s*DJA\\-018\\b'
|
|
178
|
+
message: 'RunSec Detection [DJA-018]: CWE-20'
|
|
179
|
+
languages:
|
|
180
|
+
- python
|
|
181
|
+
severity: WARNING
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
rules:
|
|
2
|
+
- id: runsec.python-security.py-001
|
|
3
|
+
pattern-either:
|
|
4
|
+
- pattern: |-
|
|
5
|
+
app = FastAPI(debug=True)
|
|
6
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-001\\b'
|
|
7
|
+
message: 'RunSec Detection [PY-001]: FastAPI deployment hardening'
|
|
8
|
+
languages:
|
|
9
|
+
- python
|
|
10
|
+
severity: WARNING
|
|
11
|
+
- id: runsec.python-security.py-002
|
|
12
|
+
pattern-either:
|
|
13
|
+
- pattern: |-
|
|
14
|
+
try:
|
|
15
|
+
...
|
|
16
|
+
except Exception as e:
|
|
17
|
+
return dict(error=str(e))
|
|
18
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-002\\b'
|
|
19
|
+
message: 'RunSec Detection [PY-002]: OWASP Error Handling'
|
|
20
|
+
languages:
|
|
21
|
+
- python
|
|
22
|
+
severity: WARNING
|
|
23
|
+
- id: runsec.python-security.py-003
|
|
24
|
+
pattern-either:
|
|
25
|
+
- pattern: |-
|
|
26
|
+
pickle.loads(data)
|
|
27
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-003\\b'
|
|
28
|
+
message: 'RunSec Detection [PY-003]: CWE-502'
|
|
29
|
+
languages:
|
|
30
|
+
- python
|
|
31
|
+
severity: WARNING
|
|
32
|
+
- id: runsec.python-security.py-004
|
|
33
|
+
pattern-either:
|
|
34
|
+
- pattern: |-
|
|
35
|
+
subprocess.run(cmd, shell=True)
|
|
36
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-004\\b'
|
|
37
|
+
message: 'RunSec Detection [PY-004]: CWE-78'
|
|
38
|
+
languages:
|
|
39
|
+
- python
|
|
40
|
+
severity: WARNING
|
|
41
|
+
- id: runsec.python-security.py-005
|
|
42
|
+
pattern-either:
|
|
43
|
+
- pattern: |-
|
|
44
|
+
yaml.load(data, Loader=yaml.Loader)
|
|
45
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-005\\b'
|
|
46
|
+
message: 'RunSec Detection [PY-005]: PyYAML security'
|
|
47
|
+
languages:
|
|
48
|
+
- python
|
|
49
|
+
severity: WARNING
|
|
50
|
+
- id: runsec.python-security.py-006
|
|
51
|
+
pattern-either:
|
|
52
|
+
- pattern: |-
|
|
53
|
+
tempfile.mktemp()
|
|
54
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-006\\b'
|
|
55
|
+
message: 'RunSec Detection [PY-006]: CWE-377'
|
|
56
|
+
languages:
|
|
57
|
+
- python
|
|
58
|
+
severity: WARNING
|
|
59
|
+
- id: runsec.python-security.py-007
|
|
60
|
+
pattern-either:
|
|
61
|
+
- pattern: |-
|
|
62
|
+
requests.get(user_url)
|
|
63
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-007\\b'
|
|
64
|
+
message: 'RunSec Detection [PY-007]: OWASP SSRF'
|
|
65
|
+
languages:
|
|
66
|
+
- python
|
|
67
|
+
severity: WARNING
|
|
68
|
+
- id: runsec.python-security.py-008
|
|
69
|
+
pattern-either:
|
|
70
|
+
- pattern: |-
|
|
71
|
+
requests.get(url)
|
|
72
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-008\\b'
|
|
73
|
+
message: 'RunSec Detection [PY-008]: Reliability/security baseline'
|
|
74
|
+
languages:
|
|
75
|
+
- python
|
|
76
|
+
severity: WARNING
|
|
77
|
+
- id: runsec.python-security.py-009
|
|
78
|
+
pattern-either:
|
|
79
|
+
- pattern: |-
|
|
80
|
+
SECRET_KEY = "dev-secret"
|
|
81
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-009\\b'
|
|
82
|
+
message: 'RunSec Detection [PY-009]: CWE-798'
|
|
83
|
+
languages:
|
|
84
|
+
- python
|
|
85
|
+
severity: WARNING
|
|
86
|
+
- id: runsec.python-security.py-010
|
|
87
|
+
pattern-either:
|
|
88
|
+
- pattern: |-
|
|
89
|
+
token = str(random.random())
|
|
90
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-010\\b'
|
|
91
|
+
message: 'RunSec Detection [PY-010]: Python secrets guidance'
|
|
92
|
+
languages:
|
|
93
|
+
- python
|
|
94
|
+
severity: WARNING
|
|
95
|
+
- id: runsec.python-security.py-011
|
|
96
|
+
pattern-either:
|
|
97
|
+
- pattern: |-
|
|
98
|
+
jwt.decode(token, key, options={"verify_signature": True})
|
|
99
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-011\\b'
|
|
100
|
+
message: 'RunSec Detection [PY-011]: JWT BCP'
|
|
101
|
+
languages:
|
|
102
|
+
- python
|
|
103
|
+
severity: WARNING
|
|
104
|
+
- id: runsec.python-security.py-012
|
|
105
|
+
pattern-either:
|
|
106
|
+
- pattern: |-
|
|
107
|
+
session.execute(f"SELECT * FROM t WHERE id={id}")
|
|
108
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-012\\b'
|
|
109
|
+
message: 'RunSec Detection [PY-012]: CWE-89'
|
|
110
|
+
languages:
|
|
111
|
+
- python
|
|
112
|
+
severity: WARNING
|
|
113
|
+
- id: runsec.python-security.py-013
|
|
114
|
+
pattern-either:
|
|
115
|
+
- pattern: |-
|
|
116
|
+
Model(**request.json())
|
|
117
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-013\\b'
|
|
118
|
+
message: 'RunSec Detection [PY-013]: OWASP Mass Assignment'
|
|
119
|
+
languages:
|
|
120
|
+
- python
|
|
121
|
+
severity: WARNING
|
|
122
|
+
- id: runsec.python-security.py-014
|
|
123
|
+
pattern-either:
|
|
124
|
+
- pattern: |-
|
|
125
|
+
open(base + "/" + filename)
|
|
126
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-014\\b'
|
|
127
|
+
message: 'RunSec Detection [PY-014]: CWE-22'
|
|
128
|
+
languages:
|
|
129
|
+
- python
|
|
130
|
+
severity: WARNING
|
|
131
|
+
- id: runsec.python-security.py-015
|
|
132
|
+
pattern-either:
|
|
133
|
+
- pattern: |-
|
|
134
|
+
eval(user_expr)
|
|
135
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-015\\b'
|
|
136
|
+
message: 'RunSec Detection [PY-015]: CWE-95'
|
|
137
|
+
languages:
|
|
138
|
+
- python
|
|
139
|
+
severity: WARNING
|
|
140
|
+
- id: runsec.python-security.py-016
|
|
141
|
+
pattern-either:
|
|
142
|
+
- pattern: |-
|
|
143
|
+
allow_origins=["*"], allow_credentials=True
|
|
144
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-016\\b'
|
|
145
|
+
message: 'RunSec Detection [PY-016]: CORS hardening'
|
|
146
|
+
languages:
|
|
147
|
+
- python
|
|
148
|
+
severity: WARNING
|
|
149
|
+
- id: runsec.python-security.py-017
|
|
150
|
+
pattern-either:
|
|
151
|
+
- pattern: |-
|
|
152
|
+
@app.post("/login")
|
|
153
|
+
async def login():
|
|
154
|
+
...
|
|
155
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-017\\b'
|
|
156
|
+
message: 'RunSec Detection [PY-017]: OWASP API4'
|
|
157
|
+
languages:
|
|
158
|
+
- python
|
|
159
|
+
severity: WARNING
|
|
160
|
+
- id: runsec.python-security.py-018
|
|
161
|
+
pattern-either:
|
|
162
|
+
- pattern: |-
|
|
163
|
+
async def $F():
|
|
164
|
+
...
|
|
165
|
+
requests.get(...)
|
|
166
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-018\\b'
|
|
167
|
+
message: 'RunSec Detection [PY-018]: Async runtime safety'
|
|
168
|
+
languages:
|
|
169
|
+
- python
|
|
170
|
+
severity: WARNING
|
|
171
|
+
- id: runsec.python-security.py-019
|
|
172
|
+
pattern-either:
|
|
173
|
+
- pattern: |-
|
|
174
|
+
browser = p.chromium.launch(args=["--no-sandbox"])
|
|
175
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-019\\b'
|
|
176
|
+
message: 'RunSec Detection [PY-019]: Browser automation hardening'
|
|
177
|
+
languages:
|
|
178
|
+
- python
|
|
179
|
+
severity: WARNING
|
|
180
|
+
- id: runsec.python-security.py-020
|
|
181
|
+
pattern-either:
|
|
182
|
+
- pattern: |-
|
|
183
|
+
@app.get("/users/{id}")
|
|
184
|
+
async def get_user(id: int):
|
|
185
|
+
return db_user
|
|
186
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-020\\b'
|
|
187
|
+
message: 'RunSec Detection [PY-020]: FastAPI response_model safety'
|
|
188
|
+
languages:
|
|
189
|
+
- python
|
|
190
|
+
severity: WARNING
|
|
191
|
+
- id: runsec.python-security.py-021
|
|
192
|
+
pattern-either:
|
|
193
|
+
- pattern: |-
|
|
194
|
+
text(f"SELECT * FROM users WHERE name='{name}'")
|
|
195
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-021\\b'
|
|
196
|
+
message: 'RunSec Detection [PY-021]: SQLAlchemy text injection'
|
|
197
|
+
languages:
|
|
198
|
+
- python
|
|
199
|
+
severity: WARNING
|
|
200
|
+
- id: runsec.python-security.py-022
|
|
201
|
+
pattern-either:
|
|
202
|
+
- pattern: |-
|
|
203
|
+
UserModel.model_construct(**payload)
|
|
204
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-022\\b'
|
|
205
|
+
message: 'RunSec Detection [PY-022]: Pydantic security'
|
|
206
|
+
languages:
|
|
207
|
+
- python
|
|
208
|
+
severity: WARNING
|
|
209
|
+
- id: runsec.python-security.py-023
|
|
210
|
+
pattern-either:
|
|
211
|
+
- pattern: |-
|
|
212
|
+
SHARED_PAGE = browser.new_page()
|
|
213
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-023\\b'
|
|
214
|
+
message: 'RunSec Detection [PY-023]: Playwright isolation'
|
|
215
|
+
languages:
|
|
216
|
+
- python
|
|
217
|
+
severity: WARNING
|
|
218
|
+
- id: runsec.python-security.py-024
|
|
219
|
+
pattern-either:
|
|
220
|
+
- pattern: |-
|
|
221
|
+
httpx.Client(verify=False)
|
|
222
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-024\\b'
|
|
223
|
+
message: 'RunSec Detection [PY-024]: TLS hardening'
|
|
224
|
+
languages:
|
|
225
|
+
- python
|
|
226
|
+
severity: WARNING
|
|
227
|
+
- id: runsec.python-security.py-025
|
|
228
|
+
pattern-either:
|
|
229
|
+
- pattern: |-
|
|
230
|
+
def handle_hook(body: bytes):
|
|
231
|
+
data = json.loads(body)
|
|
232
|
+
return data
|
|
233
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-025\\b'
|
|
234
|
+
message: 'RunSec Detection [PY-025]: Webhook security'
|
|
235
|
+
languages:
|
|
236
|
+
- python
|
|
237
|
+
severity: WARNING
|
|
238
|
+
- id: runsec.python-security.py-026
|
|
239
|
+
pattern-either:
|
|
240
|
+
- pattern: |-
|
|
241
|
+
logger.info("token=%s", token)
|
|
242
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-026\\b'
|
|
243
|
+
message: 'RunSec Detection [PY-026]: OWASP Logging'
|
|
244
|
+
languages:
|
|
245
|
+
- python
|
|
246
|
+
severity: WARNING
|
|
247
|
+
- id: runsec.python-security.py-027
|
|
248
|
+
pattern-either:
|
|
249
|
+
- pattern: |-
|
|
250
|
+
limit = int(request.args["limit"])
|
|
251
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-027\\b'
|
|
252
|
+
message: 'RunSec Detection [PY-027]: Resource abuse prevention'
|
|
253
|
+
languages:
|
|
254
|
+
- python
|
|
255
|
+
severity: WARNING
|
|
256
|
+
- id: runsec.python-security.py-028
|
|
257
|
+
pattern-either:
|
|
258
|
+
- pattern: |-
|
|
259
|
+
@app.post("/account/delete")
|
|
260
|
+
async def delete_account():
|
|
261
|
+
...
|
|
262
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-028\\b'
|
|
263
|
+
message: 'RunSec Detection [PY-028]: OWASP CSRF'
|
|
264
|
+
languages:
|
|
265
|
+
- python
|
|
266
|
+
severity: WARNING
|
|
267
|
+
- id: runsec.python-security.py-029
|
|
268
|
+
pattern-either:
|
|
269
|
+
- pattern: |-
|
|
270
|
+
CELERY_TASK_SERIALIZER = "pickle"
|
|
271
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-029\\b'
|
|
272
|
+
message: 'RunSec Detection [PY-029]: Celery security'
|
|
273
|
+
languages:
|
|
274
|
+
- python
|
|
275
|
+
severity: WARNING
|
|
276
|
+
- id: runsec.python-security.py-030
|
|
277
|
+
pattern-either:
|
|
278
|
+
- pattern: |-
|
|
279
|
+
return RedirectResponse(next_url)
|
|
280
|
+
- pattern-regex: 'Vulnerable:\\s*PY\\-030\\b'
|
|
281
|
+
message: 'RunSec Detection [PY-030]: OWASP Open Redirect'
|
|
282
|
+
languages:
|
|
283
|
+
- python
|
|
284
|
+
severity: WARNING
|