Skip to content

Commit b93c55d

Browse files
dependabot[bot]nikolas
authored andcommitted
Bump bandit from 1.7.4 to 1.8.6
Bumps [bandit](https://github.com/PyCQA/bandit) from 1.7.4 to 1.8.6. - [Release notes](https://github.com/PyCQA/bandit/releases) - [Commits](PyCQA/bandit@1.7.4...1.8.6) --- updated-dependencies: - dependency-name: bandit dependency-version: 1.8.6 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
1 parent d525e69 commit b93c55d

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ ctlsettings==0.4.3
104104
pbr==7.0.0
105105
PyYAML==6.0.2
106106
stevedore==5.5.0
107-
bandit==1.7.4
107+
rich==14.2.0 # bandit
108+
bandit==1.8.6
108109

109110
defusedxml==0.7.1
110111
lxml==6.0.0

wardenclyffe/main/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,12 @@ def _subscription_confirmation(self, request):
13781378
if "SubscribeURL" not in message:
13791379
return HttpResponse("no subscribe url", status=400)
13801380
url = message["SubscribeURL"]
1381-
r = requests.get(url)
1381+
parsed_url = urlparse(url)
1382+
1383+
if parsed_url.scheme != 'https':
1384+
return HttpResponse('invalid subscribe url', status=400)
1385+
1386+
r = requests.get(url, timeout=5)
13821387
if r.status_code == 200:
13831388
return HttpResponse("OK")
13841389
return HttpResponse("Failed to confirm")

wardenclyffe/mediathread/tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def submit_to_mediathread(operation):
9696
audio, width, height
9797
)
9898

99-
r = requests.post(mediathread_base + "save/", params)
99+
r = requests.post(mediathread_base + "save/", params, timeout=5)
100100
if r.status_code == 200:
101101
# requests follows redirects, so we need to get the location
102102
# out of the history
@@ -136,7 +136,7 @@ def update_mediathread(operation):
136136

137137
params = mediathread_update_params(video, mediathread_secret)
138138

139-
r = requests.post(mediathread_base + 'update/', params)
139+
r = requests.post(mediathread_base + 'update/', params, timeout=5)
140140
if r.status_code == 200:
141141
return ("complete", "")
142142
elif r.status_code == 404:

wardenclyffe/mediathread/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class MediathreadCourseGetter(object):
109109
def run(self, username):
110110
try:
111111
url = mediathread_url(username)
112-
r = requests.get(url)
112+
r = requests.get(url, timeout=5)
113113
courses = r.json()['courses']
114114
courses = [dict(id=k, title=v['title'])
115115
for (k, v) in courses.items()]

0 commit comments

Comments
 (0)