T09 · Insecure Skill Coding Practices
- Location
sentinel.py:35- Finding
Unredacted notification content may disclose sensitive information to an external service
- Content
View full analysis
Vulnerability Details
File Location:
sentinel.py, lines 35–45
Vulnerability Type: Unfiltered transmission of potentially sensitive diagnostic data
Risk Level: Mediumpython 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
messagecontent tohttps://gateway.maton.ai/whatsapp/sendwithout redaction, classification, or explicit approval. The request also includes the configured WhatsApp destination and theMATON_API_KEYbearer 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
- A monitored Docker or PM2 service emits a credential, token, connection string, or other confidential value in its logs.
- Diagnostic logic or another caller obtains that content and passes it to
notify(). - The function places the complete content in the JSON
message...[truncated 829 chars]
- Remediation
View 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.
