deploy-folder-to-modelscope
Audited by Socket on Sep 16, 2026
2 alerts found:
SecurityAnomalyThis is a deployment utility with a legitimate apparent purpose, but it has a significant command-injection vulnerability: user- or .env-controlled URL and directory values are interpolated into a shell command executed with shell=True without escaping. The ModelScope URL may contain credentials, which are stored in .env, printed in the command, and passed as a process argument. No direct malware behavior is evident in the provided fragment, but the subprocess design creates a meaningful security risk and should be changed to subprocess.run([...], shell=False) with validated arguments; credentials should also be kept out of logs and command-line arguments.
The code is a deployment utility with no clear malicious payload or evidence of credential theft, persistence, cryptomining, or data exfiltration. Its main security issue is command injection caused by interpolating the user-provided modelscope_url into shell=True commands without quoting or validation. The automatic destructive cleanup and git push are intentional but operationally sensitive. Use subprocess argument lists with shell=False, validate the repository URL, and avoid unnecessary shell commands.