{"id":"CVE-2025-41419","aliases":["CVE-2025-41419","GHSA-7c78-rm87-5673","PYSEC-2026-1682"],"related":[],"kind":"vulnerability","state":"published","title":"MS SWIFT WEB-UI RCE Vulnerability","summary":"**I. Detailed Description:** \n\nThis 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.\n\n1. Install ms-swift\n   ```\n   pip install ms-swift -U\n   ```\n\n2. Start web-ui\n   ```\n   swift web-ui --lang en\n   ```\n\n3. After startup, access through browser at [http://localhost:7860/](http://localhost:7860/) to see the launched fine-tuning framework program\n\n4. Fill in necessary parameters\n   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\n\n5. Click Begin to start training. Capture packets and modify the parameter corresponding to --output_dir\n\n   You can see the concatenated command being executed in the terminal where web-ui was started\n\n6. 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\n\n**II. Vulnerability Proof (Write POC here):**\n```\n/tmp/xxx'; touch /tmp/inject_success_1; #\n```\n\n**III. Fix Solution:**\n1. The swift.ui.llm_train.llm_train.LLMTrain#train() method should not directly concatenate parameters with commands after receiving commands from the frontend\n2. 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\n\n## Author\n\n* Discovered by: [TencentAISec](https://github.com/TencentAISec)\n* Contact: *[security@tencent.com](mailto:security@tencent.com)*","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"**I. Detailed Description:** \n\nThis 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.\n\n1. Install ms-swift\n   ```\n   pip install ms-swift -U\n   ```\n\n2. Start web-ui\n   ```\n   swift web-ui --lang en\n   ```\n\n3. After startup, access through browser at [http://localhost:7860/](http://localhost:7860/) to see the launched fine-tuning framework program\n\n4. Fill in necessary parameters\n   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\n\n5. Click Begin to start training. Capture packets and modify the parameter corresponding to --output_dir\n\n   You can see the concatenated command being executed in the terminal where web-ui was started\n\n6. 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\n\n**II. Vulnerability Proof (Write POC here):**\n```\n/tmp/xxx'; touch /tmp/inject_success_1; #\n```\n\n**III. Fix Solution:**\n1. The swift.ui.llm_train.llm_train.LLMTrain#train() method should not directly concatenate parameters with commands after receiving commands from the frontend\n2. 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\n\n## Author\n\n* Discovered by: [TencentAISec](https://github.com/TencentAISec)\n* Contact: *[security@tencent.com](mailto:security@tencent.com)*","format":"markdown","source":"ghsa"}],"published":"2025-07-31T14:04:24.000Z","modified":"2026-07-07T17:56:28.358Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P","rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"}],"cwes":["CWE-117"],"affected":[{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.7.0"}],"ecosystem":"PyPI","package":"ms-swift","purl":"pkg:pypi/ms-swift","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.7.0"}],"ecosystem":"PyPI","package":"ms-swift","purl":"pkg:pypi/ms-swift","source":"pysec"}],"references":[{"url":"https://github.com/modelscope/ms-swift/security/advisories/GHSA-7c78-rm87-5673","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/modelscope/ms-swift/commit/32f09e9b0a44f19d44210e2b5b47c58ab01740e1","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/modelscope/ms-swift","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/ms-swift","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-7c78-rm87-5673","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-41419","tags":["advisory"],"sources":["pysec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7c78-rm87-5673","url":"https://github.com/advisories/GHSA-7c78-rm87-5673","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:28.358Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1682","url":"https://osv.dev/vulnerability/PYSEC-2026-1682","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:17.642Z"}],"updatedAt":"2026-11-25T22:56:38.458Z"}