Skip to content

Commit 62a8f1c

Browse files
committed
add an additional scheme check
1 parent b0bae4c commit 62a8f1c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mobsf/MobSF/security.py

+5
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,17 @@ def valid_host(host):
265265
if not host.startswith(prefixs):
266266
host = f'http://{host}'
267267
parsed = urlparse(host)
268+
scheme = parsed.scheme
268269
domain = parsed.netloc
269270
hostname = parsed.hostname
270271
path = parsed.path
271272
query = parsed.query
272273
params = parsed.params
273274

275+
# Allow only http and https schemes
276+
if scheme not in ('http', 'https'):
277+
return False
278+
274279
# Check for hostname
275280
if not hostname:
276281
return False

0 commit comments

Comments
 (0)