From 7c573ecddae087b3b43533d5d21dc2d226d78d02 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Sun, 29 Nov 2026 23:44:44 +0100 Subject: [PATCH] security: name why the upgrade's exec_command line is safe (bandit B601) --- napalm_bsd/updates.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/napalm_bsd/updates.py b/napalm_bsd/updates.py index f62f29e..bc32b0e 100644 --- a/napalm_bsd/updates.py +++ b/napalm_bsd/updates.py @@ -125,7 +125,9 @@ class BsdUpdatesMixin: try: channel.set_combine_stderr(True) channel.settimeout(IDLE_TIMEOUT) - channel.exec_command(line) + # The line is built from this module's constants and package names that + # passed PACKAGE_NAME and are shell-quoted, never from free text. + channel.exec_command(line) # nosec B601 if prefix: channel.sendall(prefix) channel.shutdown_write()