summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2026-11-03 18:27:23 +0200
committerNataliia Solomko <natalirs1985@gmail.com>2026-11-04 11:25:49 +0200
commit53dc51f02ac94a6a1a32efb454ecdc994aa99bfd (patch)
treea601b4f337d9b1f63167ca860ac295d353b1711c /python
parenta100a7f62325beac2c9c3a75778bca09da3e9d08 (diff)
downloadvyos-1x-53dc51f02ac94a6a1a32efb454ecdc994aa99bfd.tar.gz
vyos-1x-53dc51f02ac94a6a1a32efb454ecdc994aa99bfd.zip
remote: T9568: Do not send HTTP credentials to another host after a redirect
Downloads that were redirected to a different host sent the user's credentials to that host. Credentials are now dropped when the redirect leaves the original host.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/remote.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/remote.py b/python/vyos/remote.py
index 6a475eb13..81acd0913 100644
--- a/python/vyos/remote.py
+++ b/python/vyos/remote.py
@@ -444,6 +444,9 @@ class HttpC:
# In case the server does not supply the header.
except KeyError:
size = None
+ # Do not send credentials to a different host after a redirect
+ if s.should_strip_auth(self.urlstring, final_urlstring):
+ s.auth = None
with s.get(final_urlstring, stream=True, timeout=self.timeout) as r:
r.raise_for_status()
if size is None: