T09 · Insecure Skill Coding Practices
Warning
- Location
- style_report.json:2475
- Finding
- Packaged Report Exposes Internal Infrastructure Information<![CDATA[ ## Vulnerability Details **File Location**: `style_report.json`, lines 2475–2629; generation logic in `scripts/analyze_style.py`, lines 82–86 and 184–191 **Vulnerability Type**: Sensitive infrastructure information exposure **Risk Level**: Medium ### Vulnerable Code ```python value = cell.get('value', '') if value and value.strip(): stats['labels'].append(value.strip()[:60]) ``` ```python serializable = [] for s in all_stats: if 'error' in s: serializable.append(s) continue d = {k: (dict(v) if isinstance(v, Counter) else v) for k, v in s.items()} serializable.append(d) with open(out, 'w', encoding='utf-8') as fp: json.dump(serializable, fp, ensure_ascii=False, indent=2) ``` ### Technical Analysis The analysis script indiscriminately extracts diagram labels and serializes them into `style_report.json`. The packaged report consequently retains private and public IP addresses, service roles, ports, environment names, database systems, gateways, web application firewalls, monitoring systems, deployment repositories, and other topology information. The declared purpose of this report is to summarize drawing styles such as colors, fonts, shapes, and dimensions. Raw labels and infrastructure identifiers are not required for those statistics. Including the generated report in the distributed project therefore exposes information beyond the Skill's functional requirements. This is a data-minimization and artifact-sanitization failure. No credential or private key was observed, but the disclosed topology can materially improve an attacker's reconnaissance. ### Attack Path 1. An attacker downloads or otherwise obtains the Skill package. 2. The attacker opens the bundled `style_report.json`. 3. The attacker extracts IP addresses, ports, system roles, network zones, database products, gateways, and public endpoints. 4. The attacker correlates public endpoints with the disclosed internal architecture and identifies high- ...[truncated 830 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove the existing `style_report.json` from the distributed package and repository history where practical. 2. Regenerate demonstration reports exclusively from synthetic or comprehensively redacted diagrams. 3. Stop collecting labels by default because they are unnecessary for style statistics: ```python # Do not retain raw labels in routine style reports. stats['labels'] = [] ``` 4. If label analysis is explicitly requested, require an opt-in flag and redact: - IPv4 and IPv6 addresses - Hostnames and domain names - URLs - Port numbers - Environment and network-zone names - Usernames, tokens, credentials, and keys 5. Store only aggregate keyword counts or irreversible hashes when raw values are unnecessary. 6. Add a pre-release secret and sensitive-data scan covering JSON, Markdown, DrawIO, and generated artifacts. 7. Document that generated reports may contain source-diagram content and must be reviewed before sharing. ]]>
