T09 · Insecure Skill Coding Practices
Warning
- Location
- sentinel.py:35
- Finding
- Unredacted notification content may disclose sensitive information to an external service## Vulnerability Details **File Location**: `sentinel.py`, lines 35–45 **Vulnerability Type**: Unfiltered transmission of potentially sensitive diagnostic data **Risk Level**: Medium ```python def notify(message): """Sends notification via the configured channel.""" target = os.getenv("NEXUS_REPORT_CHANNEL") api_key = os.getenv("MATON_API_KEY") if not target or not api_key: print(f"NOTIFY_STDOUT: {message}") return # We use Maton API for secure relay payload = {"to": target, "message": f"[NEXUS] {message}"} try: requests.post(f"{API_GATEWAY}/whatsapp/send", json=payload, headers={"Authorization": f"Bearer {api_key}"}, timeout=10) ``` ### Technical Analysis The function sends caller-controlled `message` content to `https://gateway.maton.ai/whatsapp/send` without redaction, classification, or explicit approval. The request also includes the configured WhatsApp destination and the `MATON_API_KEY` bearer credential. Sending a bearer token to the API endpoint is necessary for the documented WhatsApp integration and is not, by itself, evidence of malicious exfiltration. However, the unrestricted message field creates a sensitive-data disclosure channel. Service logs and diagnostic output commonly contain credentials, authorization headers, connection strings, personal information, and internal infrastructure details. The current command-line entry point does not invoke `notify()`, so this package does not presently demonstrate an automatic path from log collection to network transmission. Exploitation requires another caller to pass sensitive content to the function. ### Attack Path 1. A monitored Docker or PM2 service emits a credential, token, connection string, or other confidential value in its logs. 2. Diagnostic logic or another caller obtains that content and passes it to `notify()`. 3. The function places the complete content in the JSON `message` ...[truncated 829 chars]
- Remediation
- ## Remediation Suggestions - Apply a centralized redaction function before constructing the notification payload. - Detect and remove API keys, bearer tokens, passwords, private keys, connection strings, cookies, and authorization headers. - Prefer structured, allowlisted notification fields over arbitrary log or exception text. - Require explicit user approval before sending log-derived content externally. - Reject messages containing suspected secrets rather than relying solely on substitution. - Limit message length and avoid transmitting full stack traces or raw logs. - Validate the destination and restrict outbound access to the documented Maton HTTPS endpoint. - Check the HTTP response and report failures securely rather than suppressing every exception. - Ensure fallback output does not print secrets to terminals or centralized process logs.
