From 53dc51f02ac94a6a1a32efb454ecdc994aa99bfd Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Tue, 3 Nov 2026 18:27:23 +0200 Subject: 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. --- python/vyos/remote.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python') 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: -- cgit v1.2.3