fix: use subprocess instead of os.system in resume.py#13730
Conversation
Automated security fix generated by Orbis Security AI
|
All Contributors have signed the CLA. ✅ |
|
👋 Hello @orbisai0security, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
The diff looks clean. Switching from os.system() to subprocess.Popen() with argv lists removes shell parsing risks and preserves the non-blocking relaunch behavior for both single-GPU and DDP resume paths. I did not find any clear bugs or regressions in the changed lines.
|
I have read the CLA Document and I sign the CLA |
Summary
Fix critical severity security issue in
utils/aws/resume.py.Vulnerability
V-001utils/aws/resume.py:43Description: The utils/aws/resume.py file executes shell commands using os.system(cmd) without input validation. The 'cmd' variable is constructed from user-controllable inputs, allowing arbitrary command injection through shell metacharacters.
Changes
utils/aws/resume.pyVerification
Automated security fix by OrbisAI Security
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
🔧 This PR updates
utils/aws/resume.pyto usesubprocess.Popen()instead ofos.system()when relaunching resumed training jobs.📊 Key Changes
import oswithimport subprocess.os.system(cmd)withsubprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)./dev/nullequivalents." ".join(cmd)for readable logging.🎯 Purpose & Impact