Back to skill

Security audit

Gosmtp

Security checks for vulnerabilities and agentic risk

Overview

This email-sending skill is mostly coherent, but it exposes concrete-looking SMTP credentials and can send data to external email addresses without enough user control.

Review before installing. Do not use the published SMTP credentials; rotate or revoke them if they belong to you. Configure your own dedicated low-privilege mailbox, restrict approved recipients and attachment paths, and require explicit confirmation before any agent sends email or attaches local files.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
README.md:15
Finding

Exposed SMTP Account Credential in Documentation

Content
View full analysis
Remediation
View remediation
" ``` 4. Remove the credential from Git history, package archives, release artifacts, caches, and mirrors. Rotation remains mandatory even after history rewriting. 5. Store production secrets in a secret manager, protected deployment variable, or local environment configuration excluded from version control. 6. Add automated secret scanning to pre-commit hooks and CI pipelines. 7. Use a dedicated, least-privileged notification mailbox with provider-side sending limits and monitoring. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
main.go:52
Finding

SMTP Header Injection Through Unvalidated Message Fields

Content
View full analysis
\r\n", config.FromName, config.From)) msg.WriteString(fmt.Sprintf("To: %s\r\n", strings.Join(e.To, ", "))) msg.WriteString(fmt.Sprintf("Subject: %s\r\n", e.Subject)) msg.WriteString(fmt.Sprintf("MIME-Version: 1.0\r\n")) if len(e.Files) > 0 { msg.WriteString(fmt.Sprintf("Content-Type: multipart/mixed; boundary=\"%s\"\r\n", boundary)) } else { msg.WriteString("Content-Type: text/html; charset=\"UTF-8\"\r\n") } msg.WriteString("\r\n") ``` ### Technical Analysis The message's `From`, `To`, and `Subject` header values are constructed through direct string interpolation. The code does not reject carriage-return (`\r`) or line-feed (`\n`) characters and does not use standards-aware MIME header encoding. An attacker who can influence a header-bearing field—particularly `Email.Subject` or `MailConfig.FromName`—can terminate the intended header and inject additional headers or manipulate the MIME structure. For example: ```text Quarterly Report\r\nReply-To: attacker@example.com\r\nX-Forged: true ``` When supplied as the subject, this produces multiple physical message-header lines rather than one subject value. Injecting an additional `Bcc` header alone does not add a new SMTP envelope recipient in this implementation because envelope recipients are separately passed to `client.Rcpt`. However, an attacker can still manipulate visible metadata, reply routing, content interpretation, and other MIME headers. The exploitability boundary depends on how this API is integrated. The current CLI uses constant values, but the exported-style mail structures and documented library usage encourage cal ...[truncated 1412 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The README exposes what appear to be real SMTP credentials and then contradicts itself by claiming passwords are not hardcoded. Publishing usable email service credentials enables unauthorized email sending, account abuse, phishing, and potential access to other mailbox-integrated services. In the context of an agent skill that automates outbound email, this is especially dangerous because it directly facilitates external communication using a third-party account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation promotes automatic email sending and attachments without a prominent warning that data will leave the local environment and be transmitted to external recipients or SMTP providers. In an agent context, this can lead to unintentional exfiltration of sensitive task outputs, files, or personal data, especially if users treat the tool as a generic notification component without understanding the privacy implications.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documents use of environment variables containing SMTP credentials and clearly implies network-capable behavior, but it declares no explicit tool scope or permissions. This creates a transparency and governance gap: an agent or user may invoke email-sending behavior without clear permission boundaries, increasing the chance of unintended data transmission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation shows how to send emails, including attachments, over SMTP but does not warn that message bodies, recipient addresses, and attached files will be transmitted to an external mail server. In this context, the omission is especially risky because the skill is explicitly an email-sending tool, so users may unknowingly expose sensitive data or trigger unauthorized outbound communications.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The attachment helper opens any path supplied in e.Files and reads its contents into the outbound email without any allowlist, path restriction, or user confirmation. In an agent context, this creates a file-exfiltration primitive: if untrusted input can influence attachment paths, local secrets such as SSH keys, tokens, or config files could be emailed to an external recipient.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The send command transmits email to an external SMTP server and uses a hard-coded recipient address without any runtime confirmation or clear user-facing disclosure. In an agent setting, this can cause unintended outbound data transfer and potentially leak generated content or attached files to a recipient the operator did not explicitly approve.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The natural-language instructions and examples are entirely in Chinese, including the description and operational guidance, with no indication that this is a region-specific or Chinese-only skill. Under the policy, forcing a specific language without user opt-in can be a locale-policy issue when no choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file uses Chinese-only descriptive text and sets a Chinese display name ("Agent通知系统") without indicating that the skill is region-specific or giving users a language/locale option. This can violate the language/locale policy when a specific locale is imposed without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

User-facing comments, logs, and CLI help are presented in Chinese throughout the file, including success/error messages and usage text, with no option for users to select another language. This can violate language or locale policy when the skill is expected to be generally usable without forcing a specific language.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The code loads SMTP username, password, and sender metadata from environment variables. While common for implementation, this is a sensitive configuration-reading capability that is not reflected in the manifest's very terse description, which only says the skill sends email.

Content

No source excerpt is available for this finding.