other
Warning
- Location
- scripts/list_listeners.py:12
- Finding
- Unfiltered Local Listener Inventory Is Submitted to a Third-Party Service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/list_listeners.py:12-56`; data submission and scheduling instructions in `SKILL.md:111-134` and `SKILL.md:163-200` **Vulnerability Type**: Excessive environment reconnaissance and third-party metadata disclosure **Risk Level**: Medium ### Vulnerable Code ```python def parse_ss() -> list: proc = run(['ss', '-lntpH']) if proc.returncode != 0: raise RuntimeError(proc.stderr.strip() or 'ss failed') listeners = [] for line in proc.stdout.splitlines(): parts = line.split() if len(parts) < 4: continue local = parts[3] proc_info = parts[-1] if parts else '' ip, port = split_host_port(local) listeners.append({ 'proto': 'tcp', 'ip': ip, 'port': int(port) if str(port).isdigit() else port, 'process_name': extract_process_name(proc_info), 'pid': extract_pid(proc_info), }) return listeners def parse_lsof() -> list: proc = run(['lsof', '-nP', '-iTCP', '-sTCP:LISTEN']) if proc.returncode != 0: raise RuntimeError(proc.stderr.strip() or 'lsof failed') lines = proc.stdout.splitlines() if not lines: return [] listeners = [] for line in lines[1:]: parts = line.split() if len(parts) < 9: continue name = parts[0] pid = int(parts[1]) if parts[1].isdigit() else None endpoint = parts[-2] if '(LISTEN)' in parts[-1] else parts[-1] ip, port = split_lsof_endpoint(endpoint) listeners.append({ 'proto': 'tcp', 'ip': ip, 'port': int(port) if str(port).isdigit() else port, 'process_name': name, 'pid': pid, }) return listeners ``` The Skill directs the agent to collect and submit this data: ```markdown #### For `port-check` Collect listening TCP sockets and process names with `{baseDir}/scripts/lis ...[truncated 3265 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Filter records locally before transmission.** Retain only listeners positively associated with OpenClaw or an explicitly documented set of adjacent processes. Do not rely solely on broad substring matching; use validated executable identities or user-confirmed process mappings. 2. **Remove PIDs from remote payloads.** Exposure classification requires protocol, bind address, and port. Process identifiers should remain local unless a user explicitly authorizes their disclosure. 3. **Use local classification where possible.** Determine whether a listener is loopback-only, bound to all interfaces, or bound to another interface locally. Submit only minimal aggregate results, such as the number of relevant risky listeners. 4. **Require informed consent.** Before the first upload, clearly identify the destination service and enumerate the metadata fields that will be sent. Scheduled scans should require separate consent for recurring transmission. 5. **Apply an explicit allowlist.** Add a collector option such as `--process openclaw` and make filtered collection the default. An unfiltered diagnostic mode should require an explicit user request. 6. **Minimize scheduled-scan retention and transmission.** Avoid repeatedly sending unchanged listener inventories. Store a local digest and send only newly detected OpenClaw-related exposure findings. 7. **Document the trust boundary.** State that listener metadata is transmitted to a third party, identify applicable retention practices, and distinguish local collection from remote analysis. ]]>
