Skip to content

Commit aa6a174

Browse files
committed
[patch] Patch remote OS command injection vulnerability
1 parent c8f1998 commit aa6a174

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/llamafactory/webui/runner.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ def _launch(self, data: Dict["Component", Any], do_train: bool) -> Generator[Dic
320320
if args.get("deepspeed", None) is not None:
321321
env["FORCE_TORCHRUN"] = "1"
322322

323-
self.trainer = Popen(f"llamafactory-cli train {save_cmd(args)}", env=env, shell=True)
323+
cmd = [
324+
"llamafactory-cli",
325+
"train",
326+
*save_cmd(args).split(),
327+
]
328+
self.trainer = Popen(cmd, env=env)
324329
yield from self.monitor()
325330

326331
def _form_config_dict(self, data: Dict["Component", Any]) -> Dict[str, Any]:

0 commit comments

Comments
 (0)