CVE-2025-41419: Ms swift Remote Code Execution Vulnerability
MODERATECVE-2025-41419 is a MODERATE remote code execution vulnerability (CWE-117: Improper Output Neutralization for Logs) affecting Ms swift libraries in the PyPI ecosystem. The issue involves ms swift web-ui rce vulnerability. Remediation is available by upgrading affected packages to version 3.7.0.
CVE-2025-41419 at a Glance
How to Fix CVE-2025-41419
To remediate this vulnerability, upgrade all affected Ms swift dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install ms-swift>=3.7.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ms-swift
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-41419, inspect your installed packages using pip:
pip show ms-swift
Analyze the terminal output to locate any version of Ms swift in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.0), your application is affected.
Note: The pip show ms-swift command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-117: Improper Output Neutralization for Logs, where the product constructs a log message from external input, but it does not neutralize or incorrectly neutralizes special elements when the message is written to a log file. In Ms swift, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-41419 Affected Ms swift Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ms-swift
|
PyPI |
< 3.7.0
|
3.7.0
|
References
Frequently Asked Questions
What is CVE-2025-41419?
Which Ms swift versions are affected?
What version fixes CVE-2025-41419?
Is ms-swift affected?
What CWE is associated with CVE-2025-41419?
How can I check PyPI dependencies for CVE-2025-41419?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7c78-rm87-5673",
"modified" : "2025-10-23T17:42:54Z",
"published" : "2025-07-31T14:04:24Z",
"aliases" : [ "CVE-2025-41419" ],
"summary" : "MS SWIFT WEB-UI RCE Vulnerability",
"details" : "**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)*",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ms-swift"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.7.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/modelscope/ms-swift/security/advisories/GHSA-7c78-rm87-5673"
}, {
"type" : "WEB",
"url" : "https://github.com/modelscope/ms-swift/commit/32f09e9b0a44f19d44210e2b5b47c58ab01740e1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/modelscope/ms-swift"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-117" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-07-31T14:04:24Z",
"nvd_published_at" : null
}
}