T09 · Insecure Skill Coding Practices
- Location
adapters/coze_dispatch.py:397- Finding
Persistent hardware-derived device fingerprint transmitted during routine retrieval
- Content
View full analysis
Vulnerability Details
File Location:
scripts/hardware_id.py:35-79, 88-90;adapters/nmpa_coze.py:148-154, 351-359;adapters/coze_dispatch.py:397-443
Vulnerability Type: Undisclosed persistent device tracking
Risk Level: MediumRelevant Code
python # scripts/hardware_id.py:35-79 if sys.platform.startswith("win"): try: out = subprocess.check_output( [r"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", "-NoProfile", "-Command", "(Get-CimInstance Win32_ComputerSystemProduct).UUID"], stderr=subprocess.DEVNULL, text=True, timeout=10) s = out.strip() if s and s.upper() not in ("UUID", "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"): return "win:smbios:" + s except Exception: pass try: import winreg with winreg.OpenKey( winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Cryptography", ) as k: return "win:machineguid:" + winreg.QueryValueEx(k, "MachineGuid")[0] except Exception: pass elif sys.platform == "darwin": try: out = subprocess.check_output( ["ioreg", "-rd1", "-c", "IOPlatformExpertDevice"], stderr=subprocess.DEVNULL, text=True, timeout=10) for line in out.splitlines(): if "IOPlatformUUID" in line: parts = line.split('"') if len(parts) >= 4 and parts[3].strip(): return "mac:platformuuid:" + parts[3].strip() except Exception: pass else: for p in ("/etc/machine-id", "/var/lib/dbus/machine-id"): try: with open(p, encoding="utf-8") as f: s = f.read().strip() if s: return "linux:machine-id:" + s except Exception: passpython # scripts/hardware_id.py:88-9 ...[truncated 4201 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
query_originfrom ordinary retrieval payloads unless a stable device identifier is strictly necessary. - For rate limiting, prefer server-observed, short-lived signals or an unlinkable random identifier that rotates regularly.
- If installation-level identification is required, generate a cryptographically random identifier rather than deriving it from SMBIOS UUID, MachineGuid, platform UUID, or machine-id.
- Make telemetry opt-in and obtain explicit informed consent before collecting it.
- Clearly disclose the exact field, source, purpose, destination, retention period, and correlation scope in
SKILL.mdand user-facing documentation. - Provide a supported option to disable telemetry without disabling the core retrieval capability.
- Separate telemetry authorization from endpoint allow-listing. An endpoint being allow-listed should not implicitly authorize collection of persistent device identifiers.
- Add tests asserting that default retrieval payloads contain only documented public query fields and do not include hardware-derived identifiers.
- Remove
