PT-2025-32492 · Pypi · Ms-Swift

Published

2025-07-31

·

Updated

2025-07-31

CVSS v4.0

5.1

Medium

VectorAV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P
I. Detailed Description:
This includes scenarios, screenshots, vulnerability reproduction methods. For account-related vulnerabilities, please provide test accounts. If the reproduction process is complex, you may record a video, upload it to Taopan, and attach the link.
  1. Install ms-swift
pip install ms-swift -U
  1. Start web-ui
swift web-ui --lang en
  1. After startup, access through browser at http://localhost:7860/ to see the launched fine-tuning framework program
  2. Fill in necessary parameters In the LLM Training interface, fill in required parameters including Model id, Dataset Code. The --output dir can be filled arbitrarily as it will be modified later through packet capture
  3. Click Begin to start training. Capture packets and modify the parameter corresponding to --output dir
You can see the concatenated command being executed in the terminal where web-ui was started
  1. Wait for the program to run (testing shows it requires at least 5 minutes), and you can observe the effect of command execution creating files
II. Vulnerability Proof (Write POC here):
/tmp/xxx'; touch /tmp/inject success 1; #
III. Fix Solution:
  1. The swift.ui.llm train.llm train.LLMTrain#train() method should not directly concatenate parameters with commands after receiving commands from the frontend
  2. The swift.ui.llm train.llm train.LLMTrain#train local() method should not use os.system for execution, but should be changed to subprocess.run([cmd, arg1, arg2...]) format

Author

Fix

Weakness Enumeration

Related Identifiers

GHSA-7C78-RM87-5673

Affected Products

Ms-Swift