os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
cfg[k.strip()] = v.strip() token, chat_id = cfg.get('BOT_TOKEN'), cfg.get('CHAT_ID') if token and chat_id: os.system(f"curl -s 'https://api.telegram.org/bot{token}/sendMessage?chat_id={chat_id}&text={urllib.parse.quote_plus(msg)}' > /dev/null") def check(): try:- Confidence
- 95% confidence
- Finding
- The code builds a shell command with untrusted values from /root/.openclaw/telegram_config and executes it via os.system(). Because BOT_TOKEN and CHAT_ID are interpolated directly into a single-quoted shell string, a malicious value containing quotes or shell metacharacters can break out of the command and achieve command injection as the script's user, likely root.
