From 22fa6e1101c51dc22c6cd053adb6ba264d7e9c8b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 02:22:58 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20Fix=20B607?= =?UTF-8?q?=20partial=20path=20execution=20in=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ManupaKDU <95234271+ManupaKDU@users.noreply.github.com> --- test_testping1.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test_testping1.py b/test_testping1.py index 4dc94a5..2b6efd7 100644 --- a/test_testping1.py +++ b/test_testping1.py @@ -1,5 +1,6 @@ import unittest import subprocess +import sys from unittest.mock import patch, MagicMock from testping1 import is_reachable @@ -425,8 +426,11 @@ def test_main_block_log_injection_prevention(self): malicious_payload = "192.168.43.1\nERROR:root:System Compromised" env["MALICIOUS_IP"] = malicious_payload + # 🛡️ Sentinel: Fix Bandit B607 by using sys.executable instead of a hardcoded "python3" string. + # This ensures a secure, absolute path to the active interpreter is used, preventing + # local PATH interception attacks that could execute a malicious local file named 'python3'. result = subprocess.run( - ["python3", temp_script_path], + [sys.executable, temp_script_path], capture_output=True, text=True, env=env