T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- bin/tesla-control.py:52
- Finding
- Undocumented Destructive Charge-Schedule Removal Command<![CDATA[ ## Vulnerability Details **File Location**: `bin/tesla-control.py`, lines 52 and 80-82 **Vulnerability Type**: Undocumented destructive vehicle-control operation **Risk Level**: Medium ### Technical Analysis The command-line interface defines and implements `--remove-schedules`, which permanently removes all charging schedules associated with the selected vehicle: ```python parser.add_argument("--remove-schedules", action="store_true", help="Completely remove all charge schedules") ``` The corresponding command handler sends an authenticated request to the MyTeslaMate API: ```python elif args.remove_schedules: # According to Tesla Fleet API, remove_charge_schedule completely deletes the configuration print(json.dumps(call_api("command/remove_charge_schedule", method="POST", data={}, vin=args.vin))) ``` This operation is not listed among the supported options in `SKILL.md`. The documented `--clear-schedule` operation only disables scheduled charging, whereas this hidden option completely deletes the schedule configuration. Because the tool is intended for use by an AI agent, exposing an undocumented destructive capability increases the likelihood that the command will be invoked without the user understanding that it differs materially from merely disabling a schedule. The operation also lacks a confirmation mechanism, dry-run mode, or other safeguard. ### Attack Path 1. An attacker, automated agent, or user with access to the skill execution interface discovers the `--remove-schedules` argument from the source code or command help. 2. The process runs with a valid `TESLA_MATE_TOKEN` and a target VIN supplied through `--vin` or `TESLA_VIN`. 3. The following command is invoked: ```bash ./bin/tesla-control.py --remove-schedules ``` 4. The tool sends an authenticated POST request to the `command/remove_charge_schedule` API endpoint. 5. The selected vehicle's charging-schedule configuration is removed without an additional confi ...[truncated 518 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `--remove-schedules` if permanent schedule deletion is not an intended public capability. 2. If the operation is required, document it clearly in `SKILL.md`, including the distinction between disabling and deleting schedules. 3. Require explicit confirmation before issuing the destructive request, such as: ```bash ./bin/tesla-control.py --remove-schedules --confirm-remove-schedules ``` 4. Return an error when the confirmation flag is absent. 5. Consider providing a dry-run mode that reports the target vehicle and intended operation without sending the request. 6. Log a non-sensitive audit event recording the operation and target VIN while ensuring that the API token is never logged. 7. Where supported by the service, use an API token scoped only to the minimum vehicle-control operations required by the skill. ]]>
