T09 · Insecure Skill Coding Practices
- Location
scripts/scan_and_report.py:45- Finding
Cross-Channel Disclosure of Recipient Metadata
- Content
View full analysis
Vulnerability Details
File Location:
scripts/scan_and_report.py:45-91, 233
Vulnerability Type: Sensitive metadata disclosure
Risk Level: MediumVulnerable Code
python sessions_file = Path.home() / ".openclaw" / "agents" / "main" / "sessions" / "sessions.json" if sessions_file.exists(): try: with open(sessions_file) as f: sessions = json.load(f) for session_key, info in sessions.items(): delivery = info.get('deliveryContext', {}) channel = delivery.get('channel') to = delivery.get('to') if channel and to: entry = {'channel': channel, 'to': to} if entry not in channels: channels.append(entry) except Exception as e: print(f"Warning: Could not read sessions: {e}", file=sys.stderr) config_file = Path.home() / ".openclaw" / "openclaw.json" if config_file.exists(): try: with open(config_file) as f: config = json.load(f) channel_configs = config.get('channels', {}) for channel_name, channel_cfg in channel_configs.items(): if channel_cfg.get('enabled'): for session_key, info in sessions.items() if 'sessions' in dir() else []: if info.get('lastChannel') == channel_name: to = info.get('lastTo', '') if to: entry = {'channel': channel_name, 'to': to} if entry not in channels: channels.append(entry) except Exception as e: print(f"Warning: Could not read config: {e}", file=sys.stderr)python print(f"\n<!-- CHANNELS: {json.dumps(channels)} -->")Technical Analysis
The script reads delivery destinations from the OpenClaw session database and configuration, including c ...[truncated 1644 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
CHANNELScomment from standard output. - Do not enumerate all configured recipients merely to generate a scan report.
- Delegate recipient selection to the trusted OpenClaw delivery layer.
- If routing data is operationally necessary, pass only the current destination over a private IPC or structured control channel rather than embedding it in report content.
- Minimize access to
sessions.jsonandopenclaw.json, and avoid retaining recipient identifiers longer than required. - Add a regression test confirming that generated reports and logs contain no channel or recipient metadata.
- Remove the
