Skip to content

Commit ccfedc0

Browse files
authored
HOTFIX: Possible SSRF
1 parent 8a59d68 commit ccfedc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mobsf/StaticAnalyzer/views/common/shared_func.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
is_safe_path,
3333
print_n_send_error_response,
3434
upstream_proxy,
35+
valid_host,
3536
)
3637
from mobsf.MobSF.views.scanning import (
3738
add_to_recent_scan,
@@ -254,6 +255,9 @@ def get_avg_cvss(findings):
254255
def open_firebase(url):
255256
# Detect Open Firebase Database
256257
try:
258+
if not valid_host(url):
259+
logger.warning('Invalid Firebase URL')
260+
return url, False
257261
purl = urlparse(url)
258262
base_url = '{}://{}/.json'.format(purl.scheme, purl.netloc)
259263
proxies, verify = upstream_proxy('https')

0 commit comments

Comments
 (0)