T09 · Insecure Skill Coding Practices
- Location
SKILL.md:327- Finding
Local Development Mode Exposes Sensitive Email Data in Agent Output
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 327–333
Vulnerability Type: Sensitive data exposure through logging
Risk Level: MediumVulnerable Code Snippet:
markdown ## Local Dev Mode If `TRUNCUS_API_KEY` is not set in the environment, do not attempt to call the API. Instead: 1. Print the full request payload that would be sent (to, from, subject, body preview). 2. Log: `[truncus-email] Simulated send — set TRUNCUS_API_KEY to send for real.` 3. Return a simulated success with `message_id: "local-simulated"`.Technical Analysis
When
TRUNCUS_API_KEYis unavailable, the Skill instructs the Agent to print the email request payload. This includes recipient and sender addresses, the subject, and a body preview. Transactional emails may contain personal information, operational incident details, financial reports, password-reset content, or account information.Agent output can be retained in conversation histories, terminal output, CI/CD logs, debugging systems, or centralized observability platforms. Consequently, an absent or misconfigured API key changes the workflow from transmitting the message to the intended email service into disclosing its contents through local output channels.
The issue is particularly relevant because the documented use cases include reports, receipts, password resets, monitoring alerts, and messages containing account details. The exposure does not require compromise of the Truncus API or possession of its API key.
Attack Path
- A user or automated workflow asks the Agent to construct an email containing sensitive information.
TRUNCUS_API_KEYis absent, expired from the environment, or unavailable because of deployment misconfiguration.- The Skill automatically enters local development mode.
- Following the Skill instructions, the Agent prints the recipient, sender, subject, and body preview.
- The output is retained in an Agent transcript, terminal log, CI log, or monit ...[truncated 711 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not print email bodies or full payloads by default in local development mode.
- Return only a simulation status and non-sensitive request metadata, such as whether required fields were present.
- Redact recipient and sender addresses, for example
a***@example.com. - Omit or heavily truncate subjects and body previews because they may contain credentials, tokens, personal data, or operational details.
- Require an explicit debug option, such as
TRUNCUS_DEBUG_PAYLOAD=true, before displaying any payload preview. - Display a confidentiality warning and request user confirmation before enabling verbose payload output.
- Apply automated redaction for API keys, authorization headers, passwords, reset links, access tokens, session identifiers, and common personal-data fields.
- Ensure production and CI environments disable verbose simulation output and configure log retention and access controls appropriately.
- Clearly label the operation as simulated without returning a response shape that downstream workflows could mistake for an actual delivery.
A safer default would be:
markdown If `TRUNCUS_API_KEY` is not set: 1. Do not print the body, attachments, metadata, or complete email addresses. 2. Log only: `[truncus-email] Simulated send; no email was delivered.` 3. Return `status: "simulated"` and `message_id: "local-simulated"`. 4. Reveal a redacted payload preview only after explicit user confirmation.
