T09 · Insecure Skill Coding Practices
- Location
scripts/bloomin8_cli.py:319- Finding
Plaintext and Unauthenticated Transport for Sensitive Device Operations
- Content
View full analysis
bool: """Check if device is online via HTTP whistle""" try: async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=timeout)) as session: async with session.get(f"http://{ip}/whistle") as resp: return resp.status == 200 except Exception: return False async def get_device_info_http(self, ip: str) -> Optional[dict]: """Get device info via HTTP""" try: async with aiohttp.ClientSession(timeout=HTTP_TIMEOUT) as session: async with session.get(f"http://{ip}/deviceInfo") as resp: if resp.status == 200: return await resp.json() except Exception as e: print(f"❌ HTTP deviceInfo failed: {e}") return None ``` ```python async with aiohttp.ClientSession(timeout=aiohttp.ClientTimeout(total=60)) as session: form = FormData() form.add_field("image", image_data, filename=filename, content_type="image/jpeg") params = { "filename": filename, "gallery": gallery, "show_now": "1" if show_now else "0", } async with session.post(f"http://{ip}/upload", params=params, data=form) as resp: ``` ```python async def get_upstream_settings(self, ip: str) -> Optional[dict]: """Get upstream controller settings""" try: async with aiohttp.ClientSession(timeout=HTTP_TIMEOUT) as session: async with session.get(f"http://{ip}/upstream/pull_settings") as resp: if resp.status == 200: return await resp.json() except Exception as e: print(f"❌ Get upstream settings failed: {e}") return None async def se ...[truncated 3428 chars]- Remediation
View remediation
