T09 · Insecure Skill Coding Practices
- Location
scripts/start_ac.py:29- Finding
Climate Start Proceeds After Command-Access Verification Failure
- Content
View full analysis
time_span 3. hvac_params = ClimateStartParams( temperature=21.0, time_span=minutes_to_time_span(20), ) print("🌬️ Starting A/C...") result = await client.start_climate(vin=vin, params=hvac_params) ``` ### Technical Analysis The script treats `verify_command_access()` as a non-blocking advisory check. It catches every exception through `except Exception`, prints a warning, and continues to call `start_climate()`. Consequently, failures caused by an invalid control PIN, denied command access, authentication problems, API errors, network failures, or unexpected library behavior do not stop the physical vehicle-control operation. This is a fail-open authorization pattern. The remote BYD service or `pybyd` library may independently reject an unauthorized climate request, but that downstream behavior is external to this project and does not correct the insecure control flow in the script. The local code should require a successful verification result before attempting the command. ### Attack Path 1. An operator or automation invokes `scripts/start_ac.py` with access to the configured BYD account. 2. `verify_command_access(vin)` raises an exception because verification is denied, invalid, unavailable, or otherwise unsuccessful. 3. The broad exception handler suppresses the failure and only prints a warning. 4. The script constructs the climate-control parameters. 5. The script submits `start_climate()` for the selected vehicle despite the i ...[truncated 889 chars]- Remediation
View remediation
