From 0d4fd05058a855eef627a65f2b005a7c557ae022 Mon Sep 17 00:00:00 2001 From: Kyrylo Yatsenko Date: Thu, 16 Apr 2026 22:30:29 +0300 Subject: T8497: image_installer: fix vulnarability image_installer.py was using data from untrusted source to pass to shell without escaping in case VRF was activated. Change to list in call to `cmd` to fix this, remove extra code for VRF wrappers to library parameters. --- src/op_mode/image_installer.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py index fb28f182e..b325df9bd 100755 --- a/src/op_mode/image_installer.py +++ b/src/op_mode/image_installer.py @@ -737,10 +737,7 @@ def image_fetch(image_path: str, vrf: str = None, # Latest version gets url from configured "system update-check url" if image_path == 'latest': - command = external_latest_image_url_script - if vrf: - command = f'ip vrf exec {vrf} {command}' - code, output = rc_cmd(command, env=environ) + code, output = rc_cmd(external_latest_image_url_script, vrf=vrf, env=environ) if code: print(output) exit(MSG_INFO_INSTALL_EXIT) -- cgit v1.2.3