T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:124
- Finding
- Undisclosed Transmission of Sensitive Suricata Telemetry to Telegram<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:3, 12, 124-133` **Vulnerability Type**: Privacy violation and external transmission of sensitive security telemetry **Risk Level**: Medium ### Vulnerable Code ```python **To Telegram** (use telegram-notifier skill): ```python # After building the report string above: import os, requests requests.post( f"https://api.telegram.org/bot{os.environ['TELEGRAM_BOT_TOKEN']}/sendMessage", json={"chat_id": os.environ['TELEGRAM_CHAT_ID'], "text": report}, timeout=10 ) ``` ``` This behavior conflicts with the Skill's declared privacy properties: ```yaml description: Read and triage Suricata IDS/IPS alerts from eve.json into a structured threat report — severity-ranked findings, attacker IPs, top triggered signatures, and recommended blocks. Use when you want an automated threat intelligence snapshot from your Suricata deployment, after a scan triggers alerts, or as a daily security briefing module. No external API. Reads your local Suricata log only. ``` ```text **Privacy:** Reads `/var/log/suricata/eve.json` only. No data leaves your machine. ``` ### Technical Analysis The generated report may contain source and destination IP addresses, destination ports, protocols, alert signatures, alert timestamps, attack categories, and an assessment of the deployment's security posture. The delivery code sends the complete report to Telegram's external API. Although Telegram delivery is documented in a later section, it directly contradicts the prominent assertions that the Skill uses no external API and that no data leaves the machine. Users relying on those assertions may execute or schedule the Skill without understanding that sensitive incident telemetry can be disclosed to a third party. The bot token is also placed in the request URL. HTTPS protects it in transit, but URL-bearing credentials may be exposed to HTTP client diagnostics, proxy logs, exception reports, or monitoring systems that re ...[truncated 1536 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove or correct the claims that the Skill uses no external API and that no data leaves the machine. 2. Make external delivery strictly opt-in and require explicit user confirmation before the first transmission. 3. Keep local report generation as the default behavior and place Telegram delivery in a clearly separated optional workflow. 4. Display the categories of data that will be transmitted before enabling delivery. 5. Redact or pseudonymize private destination addresses, host identifiers, ports, and sensitive signature details unless they are explicitly required by the recipient. 6. Permit an allowlist of approved report fields rather than sending the complete report by default. 7. Apply restrictive access controls to the Telegram bot and target chat, and document Telegram's retention and third-party processing implications. 8. Avoid exposing the bot token in logs. Disable verbose HTTP logging, sanitize errors, and ensure proxies and monitoring systems redact Telegram bot URLs. 9. Provide a local-only scheduling example separately from the Telegram-enabled cron example. ]]>
