Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion test_testping1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import subprocess
import sys
from unittest.mock import patch, MagicMock
from testping1 import is_reachable

Expand Down Expand Up @@ -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
Expand Down
Loading