mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fix(security): replace shell=True subprocess calls with list args (B602)
- factor.py: check_output([python_bin, path]) instead of shell string - env.py QlibCondaEnv: all four conda commands use list args Shell=True with a constructed string allows shell injection if python_bin or path contain shell metacharacters. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -161,8 +161,7 @@ class FactorFBWorkspace(FBWorkspace):
|
||||
|
||||
try:
|
||||
subprocess.check_output(
|
||||
f"{FACTOR_COSTEER_SETTINGS.python_bin} {execution_code_path}",
|
||||
shell=True,
|
||||
[FACTOR_COSTEER_SETTINGS.python_bin, str(execution_code_path)],
|
||||
cwd=self.workspace_path,
|
||||
stderr=subprocess.STDOUT,
|
||||
timeout=FACTOR_COSTEER_SETTINGS.file_based_execution_timeout,
|
||||
|
||||
Reference in New Issue
Block a user