T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- scripts/hardware_id.py:32
- Finding
- Persistent Hardware-Derived Device Fingerprint Is Transmitted to Remote Services<![CDATA[ ## Vulnerability Details **File Location**: `scripts/hardware_id.py:32-83`; transmitted through `adapters/bug_report.py:152-167, 185, 300-305` **Vulnerability Type**: Persistent device fingerprinting beyond the minimum privileges required **Risk Level**: Medium ### Vulnerable Code ```python def _raw_hw_token() -> str: """Return the first available raw hardware token.""" 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() i ...[truncated 4471 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove access to SMBIOS UUID, MachineGuid, IOPlatformUUID, and machine-ID files from this Skill. 2. Do not automatically add a device identifier in `sanitize_report()`. 3. If request deduplication is required, generate a random per-report nonce using `secrets.token_urlsafe()` or `uuid.uuid4()`. 4. If installation-level correlation is operationally essential: - Make it explicitly opt-in. - Generate a random local installation identifier rather than deriving one from hardware. - Provide a documented reset and deletion mechanism. - Scope it to this Skill only. - Define and disclose retention periods. 5. Show every transmitted field, including any correlation identifier, during the final consent preview. 6. Use server-side rate limiting based on short-lived session properties rather than durable hardware fingerprints. 7. Add tests asserting that bug reports and online searches contain no hostname, hardware ID, machine ID, or deterministic derivative of those values. ]]>
