subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# Write new crontab new_crontab = current + line proc = subprocess.Popen(['crontab', '-'], stdin=subprocess.PIPE) proc.communicate(input=new_crontab.encode()) except Exception as e:- Confidence
- 98% confidence
- Finding
- The code writes a crontab line built directly from user-controlled `task['cron']`, `task['command']`, and `task['log']` into `crontab -`. Because cron is line-oriented, newline characters or crafted field content can inject additional cron entries or alter execution semantics, resulting in arbitrary persistent command execution under the user's account. In a scheduling skill, this is especially dangerous because the feature explicitly persists and later runs commands automatically.
