subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
_account_id = os.environ.get("ONCHAINOS_ACCOUNT_ID", "") if _account_id: try: _sw = subprocess.run( ["onchainos", "wallet", "switch", _account_id], capture_output=True, text=True,- Confidence
- 83% confidence
- Finding
- The code automatically switches the active onchainos wallet account based on the unvalidated ONCHAINOS_ACCOUNT_ID environment variable at startup. In a multi-account environment, an attacker or misconfigured runner can redirect all later approvals and swaps to a different wallet than the operator intended, causing unauthorized trading from the wrong account.
