T09 · Insecure Skill Coding Practices
Note
- Location
- SKILL.md:33
- Finding
- Unfiltered Internal Error Disclosure to Telegram Users## Vulnerability Details **File Location**: `SKILL.md`, lines 33-35 **Vulnerability Type**: Information disclosure through verbose error handling **Risk Level**: Low **Vulnerable Code**: ```javascript } catch (err) { await context.reply("Error during marketing audit: " + err.message); } ``` ### Technical Analysis The handler directly concatenates the exception message from the downstream `marketing-orchestrator` skill into a Telegram response. Exception messages are intended for diagnostics and may contain internal service names, filesystem paths, request details, collector or API responses, and other operational information. Because the error is returned without filtering or mapping it to a safe user-facing message, any Telegram user permitted to invoke this command may receive internal diagnostic details when an input or downstream condition causes an exception. The reviewed code does not establish that secrets are necessarily present in these messages, so direct credential disclosure is not confirmed. ### Attack Path 1. An attacker with access to the `/marketing_audit` command submits malformed, edge-case, or failure-inducing values for `instagramHandle` or `websiteDomain`. 2. The handler passes those values to `marketing-orchestrator`. 3. The orchestrator or one of its collectors throws an exception containing diagnostic details. 4. The `catch` block reads the exception's `message` property without sanitization. 5. The complete message is sent to the attacker through Telegram. 6. The attacker may repeat the process with different inputs to collect operational information for reconnaissance. ### Impact Assessment Successful exploitation is limited to information exposed by downstream exception messages. A user may learn internal implementation details, service identifiers, filesystem paths, request information, or third-party API error content. This can facilitate reconnaissance and help refine later attacks, b ...[truncated 134 chars]
- Remediation
- ## Remediation Suggestions Return a generic error to Telegram users and send detailed exception information only to an access-controlled logging system: ```javascript } catch (err) { context.logger?.error({ err }, "Marketing audit failed"); await context.reply("The marketing audit failed. Please try again later."); } ``` Additionally: - Avoid including raw exception messages, stack traces, API responses, paths, or request details in user-facing replies. - Assign a non-sensitive correlation identifier to each failure so operators can locate the corresponding server-side log entry. - Configure production logging to redact API keys, authorization headers, tokens, cookies, and user-supplied sensitive data. - Validate and normalize `instagramHandle` and `websiteDomain` before forwarding them to the orchestrator to reduce avoidable downstream failures. - Restrict command access where appropriate and apply rate limits to make repeated error probing more difficult.
