T09 · Insecure Skill Coding Practices
- Location
scripts/sniper.py:1087- Finding
Managed Execution Defaults to Live Financial Operations
- Content
View full analysis
Vulnerability Details
File Location:
scripts/sniper.py:1087-1096; related live-mode selection atscripts/sniper.py:1208-1209and managed entrypoint declaration atclawhub.json:8-12
Vulnerability Type:T09: Insecure Skill Coding Practices
Risk Level: HighVulnerable Code
python def agent_tool_main(): input_data = {} try: input_data = json.load(sys.stdin) except Exception: pass dry_run = input_data.get("dry_run", False) try: stats = run_once(dry_run=dry_run) result = {"status": "success", "message": "Sniper cycle completed", "live": not dry_run, "timestamp": datetime.utcnow().isoformat() + "Z", "stats": stats}The command-line execution path also treats a managed environment as authorization for live trading:
python live = args.live or bool(os.environ.get("AUTOMATON_MANAGED")) dry_run = not liveThe package declares managed execution:
json "automaton": { "managed": true, "entrypoint": "scripts/sniper.py" }Technical Analysis
The documented behavior states that dry-run is the default and that live trading requires the explicit
--liveargument. The managed and non-interactive execution paths violate that safety boundary.agent_tool_main()treats a missingdry_runfield asFalse. Consequently, empty input, malformed JSON, or an invocation that omits this optional field results inrun_once(dry_run=False). The command-line path independently promotes execution to live mode wheneverAUTOMATON_MANAGEDcontains any non-empty value.Once live mode is selected, the program creates a live Simmer client and can execute order and redemption operations. An environment marker or omitted JSON property is not sufficient evidence of informed authorization for financial transactions.
Attack Path
- A user installs or enables the Skill under the managed OpenClaw configuration.
- T ...[truncated 1092 chars]
- Remediation
View remediation
Remediation Suggestions
-
Change every execution path to default to dry-run:
python dry_run = input_data.get("dry_run", True) -
Require an explicit boolean live authorization rather than inferring it from a missing field or environment marker.
-
Do not treat
AUTOMATON_MANAGEDas authorization to trade. It should identify the runtime only. -
Require two independent controls for live operation, such as an invocation-level
live: truevalue and a persistentSIMMER_SNIPER2_LIVE_ENABLED=truesetting. -
Reject malformed or absent input instead of silently continuing with transaction-capable defaults.
-
Return a clear preview of proposed orders and require user confirmation before the first live operation.
-
Add regression tests proving that empty input, malformed JSON, omitted options, and managed mode cannot initiate live transactions.
-
Update the documentation to describe all execution modes and their exact authorization requirements.
-
