Back to skill

Security audit

Sendflare

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Sendflare email skill with proportionate API-token and network access, but users should verify recipients because it can send email immediately after parsing a command.

Install only if you intend to let the agent send email through your Sendflare account. Review recipients, subjects, and message bodies carefully before asking it to send, and avoid placing secrets or regulated data in messages unless you accept Sendflare processing that content. Treat contact-management commands as unreliable or incomplete in this version.

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 (1)

T09 · Insecure Skill Coding Practices

Note
Location
package/src/index.ts:56
Finding

Raw Exception Stack Trace Disclosure

Content
View full analysis

Vulnerability Details

File Location: package/src/index.ts:56-61
Vulnerability Type: Information disclosure through verbose error handling
Risk Level: Low

Vulnerable Code

ts
} catch (error: any) {
  return {
    success: false,
    message: `执行失败:${error.message}`,
    error: error.stack,
  };
}

The same behavior is present in the generated runtime artifact at package/dist/index.js:56-62.

Technical Analysis

The top-level execute() exception handler returns both the raw exception message and complete stack trace to the caller. Stack traces commonly contain absolute filesystem paths, package and module names, function names, line numbers, and details about the runtime environment.

An unauthenticated or otherwise untrusted caller who can submit skill input may be able to trigger an exception through malformed execution context, unexpected data types, SDK behavior, or another runtime failure. Returning error.stack crosses the trust boundary between internal diagnostics and user-visible output.

No direct API-token disclosure was demonstrated in the reviewed code. Exploitability also depends on whether the host platform exposes the error field to callers.

Attack Path

  1. An attacker invokes the skill with malformed context or input designed to trigger an uncaught exception.
  2. The exception propagates to the top-level catch block in execute().
  3. The handler copies error.message into the public message and error.stack into the returned result.
  4. If the hosting platform exposes the result, the attacker receives internal filesystem, dependency, and implementation details.
  5. The disclosed information can support reconnaissance and the development of more targeted follow-up attacks.

Impact Assessment

The direct impact is limited to information disclosure. An attacker may learn deployment paths, runtime structure, dependency names, and internal call flow. This issue does not independently provide code ex ...[truncated 220 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not include error.stack or raw SDK exception details in skill results returned to callers.
  • Return a generic, user-safe error such as “The operation failed. Please try again or contact support.”
  • Record detailed diagnostics only in a restricted server-side logging system.
  • Sanitize logs to prevent API tokens, email content, recipient addresses, or other sensitive values from being recorded.
  • Associate public failures with a random correlation identifier so administrators can locate the corresponding internal log entry.
  • Normalize unknown thrown values before handling them instead of assuming every value has message and stack properties.
  • Apply the fix to the TypeScript source and rebuild dist/index.js so the distributed runtime artifact no longer exposes stack traces.

A safer implementation would be:

ts
} catch (error: unknown) {
  const incidentId = crypto.randomUUID();

  // Send sanitized diagnostics to a restricted internal logger.
  logger.error({ incidentId, error }, 'Sendflare skill execution failed');

  return {
    success: false,
    message: `The operation failed. Reference: ${incidentId}`,
  };
}
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (42)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · package/dist/index.js (reported line 13)May include surrounding context.

js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SendflareSkill = void 0;
/**
 * Sendflare Skill
 *
 * 通过 Sendflare SDK 发送电子邮件和管理联系人
 */
const Sendflare_client_1 = require("./Sendflare-client");
class SendflareSkill {
    constructor() {
        this.name = 'Sendflare-email';
        this.description = '通过 Sendflare 发送电子邮件和管理联系人';
        this.version = '1.0.0';
        this.client = null;
        this.config = null;
    }
    /**
     * 初始化方法(OpenClaw 会在加载时调用)
     */
    async initialize(config) {
        this.config = {
            apiToken: config.apiToken,
        };
        this.client = new Sendflare_client_1.SendflareClient(this.config);
    }
    /**
     * 核心执行方法
     */
    async execute(context) {
        try {
            // 如果还没初始化,先初始化
            if (!this.client && conte

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The deleteContact method performs a destructive remote deletion via this.client.deleteContact, but the file contains no confirmation prompt, warning comment, or user-facing disclosure about the irreversible nature of the action. Deletion of user data is safety-critical and should be explicitly disclosed or confirmed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file documents a contact-deletion capability and provides a direct example command, but it does not include any warning about data loss, permanence, or the need for confirmation. Under the markdown criteria for missing user warnings, destructive operations that can affect user data should be disclosed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation exposes a contact deletion capability but does not clearly warn users that this action is destructive or recommend confirmation before execution. In a skill with contact management features, this increases the risk of accidental or socially engineered deletion of address-book data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The help trigger is documented as a generic everyday term ("帮助" / "help"), which can overlap with normal user conversation and unintentionally invoke the skill. In a skill that can send email and manage contacts, accidental activation can expose contact data or trigger unintended actions if the agent routes ambiguous requests into this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The send-email functionality does not clearly disclose that recipient addresses, subject lines, and message bodies are transmitted to the external Sendflare service. Users may unknowingly send sensitive content or personal data to a third party without adequate notice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Deleting contacts is a destructive operation, but the skill description does not clearly warn users about that risk or indicate whether confirmation is required. Without explicit caution, users may trigger irreversible changes to external contact data by mistake.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrase "帮助" is extremely broad and overlaps with normal conversational language, increasing the chance that the skill is invoked unintentionally. Accidental activation can expose account-linked actions or cause users to enter sensitive requests into the wrong skill context.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The privacy statement says the skill only accesses necessary contact information when sending email, but the documented features also include listing, saving, and deleting contacts. This creates a misleading disclosure about data access and processing, which can cause users to underestimate what personal data the skill may retrieve or modify.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The natural-language descriptions, prompts, examples, and command patterns are all written to require Chinese interaction, and the matching logic is primarily built around Chinese trigger phrases. There is no documented opt-in or language selection mechanism to justify this locale constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill sends email immediately after parsing a natural-language request, with no explicit confirmation step, preview, or recipient verification. In an agent setting, this increases the risk of prompt-triggered unintended outbound messages, data leakage, or accidental delivery to the wrong recipient.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The help text and skill description present 'get contacts', 'save contact', and 'delete contact' as supported capabilities. However, the corresponding handlers at L173-L182, L187-L207, and L212-L231 only parse input and return configuration error messages without invoking any client operation, so the documented behavior contradicts the implemented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This file includes hard-coded Chinese natural-language strings in comments and returned messages such as '发送邮件' and '邮件发送成功', with no indication that users can opt into another language. That creates a language-policy issue because the skill appears to force a specific language rather than offering user choice or documenting a justified locale constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The sendEmail method transmits message content and recipient data to an external service via this.client.sendEmail(emailReq), but the file provides only a brief method comment and no confirmation prompt, logging, or user-facing disclosure about that outbound transmission. Because this is a code file handling potentially sensitive user data, the absence of any visible warning meets the missing-user-warning criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The getContactList method makes a network call to retrieve contact data using appId and pagination parameters, but this file does not include a visible warning, logging statement, or explanatory comment indicating that contact information is fetched from an external service. For code files, transmitting or retrieving user-related data over the network should have some form of disclosure unless clearly documented elsewhere in-scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The saveContact method sends emailAddress and associated contact data to this.client.saveContact, which is a network operation involving personal contact information. Although there is an internal comment about cleaning undefined values, there is no user-facing warning or explicit comment documenting that contact data is transmitted and stored remotely.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest presents the skill description and all trigger phrases only in Chinese, which effectively constrains use to a specific language without indicating user choice or locale scope. This can violate language/locale policy when no opt-in or documented regional justification is provided.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The simplified trigger regex 发送邮件到 (.*)|发邮件给 (.*) is overly permissive and can activate on vague user input without requiring subject, content, or clear argument boundaries. In an email-sending skill, broad activation increases the chance of unintended invocation, mis-parsing recipient data, or sending messages based on incomplete context.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

An exact trigger of 帮助 is extremely generic and may collide with global help requests unrelated to this skill. While less severe than a send action trigger, it can still cause unexpected activation, confuse routing, and expose skill behavior when the user did not intend to invoke this package specifically.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module/class description says the skill can '发送电子邮件和管理联系人' (send email and manage contacts). However, the only implemented action is email sending; the get/save/delete contact paths in L193-L263 parse input but never call any client method and always return 'please configure App ID' responses. This is an active contradiction between the documented capability and the code's actual behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description and user-facing messages are written in Chinese, which effectively forces a specific language experience without any visible user opt-in or explanation that the skill is region- or locale-specific. This can violate language/locale policy when users are not given a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill sends email content to an external service immediately after parsing a natural-language request, without any explicit confirmation, preview, or trust-boundary warning. In an agent context, this increases the risk of unintended exfiltration or accidental transmission of sensitive data if a prompt, user message, or chained workflow triggers email sending unexpectedly.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help message presents contact operations as available user commands, implying the skill supports them. In reality, L193-L263 shows each contact-related handler exits with a failure asking for App ID configuration and contains no actual contact-management call, so the inline user-facing documentation contradicts runtime behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file uses Chinese-only comments and user-facing success/error messages such as '邮件发送成功' and '删除联系人失败', which imposes a specific language choice on users without offering a locale option or documenting a justified region-specific scope. This matches the language/locale policy violation category for natural-language content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The sendEmail method transmits message content and recipient data over the network via this.client.sendEmail, but the code provides no confirmation prompt, logging, or comment/docstring warning users that email contents will be sent externally. Because this is a code file and the operation handles potentially sensitive user data, it meets the missing-user-warning criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.