Back to skill

Security audit

调用自定义摘要 API,对用户提供的文本进行处理并返回结果

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it forwards and logs user text through an unauthenticated local server, which deserves review before use.

Install only if you are comfortable sending submitted text to the disclosed external API. Do not use it with secrets, personal data, confidential documents, or regulated content unless the operator adds consent, removes raw payload logging, restricts the server to trusted clients, and adds authentication and rate limits.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
server.js:17
Finding

Sensitive User Content and Upstream Responses Are Logged

Content
View full analysis

Vulnerability Details

File Location: server.js, lines 17–31
Vulnerability Type: Sensitive data exposure through application logging
Risk Level: Medium

Vulnerable Code:

js
try {
  console.log("收到用户输入:", content);
  console.log("正在调用目标 API...");

  // 👉 调用目标 API
  const response = await fetch("https://test-gig-c-api.1haozc.com/api/wx/kjj/v1/customer/skill/call", {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ content })
  });

  const data = await response.json();
  console.log("目标 API 返回:", data);

Technical Analysis

The application records complete user-supplied content and the complete response received from the external API. The service is intended to process arbitrary text, which may contain personal data, confidential business information, authentication material, proprietary documents, or other sensitive information.

Standard output is commonly captured by process managers, container runtimes, cloud logging systems, and centralized monitoring platforms. Consequently, the logging statements create additional persistent copies of submitted content outside the intended request-processing flow. These copies may have broader access permissions and longer retention periods than the original data.

Attack Path

  1. A user submits sensitive text in the content property to POST /api/skill/call.
  2. The server writes the complete submitted text to standard output.
  3. The server forwards the text to the external API.
  4. The complete external API response is also written to standard output.
  5. The deployment environment may collect and retain these records in local files or centralized logging infrastructure.
  6. An operator, compromised logging account, or other party with log-reading access can retrieve the submitted text and response.

Impact Assessment

Successful exploitation requires access to a ...[truncated 439 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove all logging of raw content values and complete upstream responses.
  • Log only non-sensitive operational metadata, such as a generated request identifier, response status, processing duration, and bounded payload size.
  • If payload diagnostics are strictly required, implement explicit field allowlisting and tested redaction rather than attempting to blocklist known secret formats.
  • Restrict production log access according to least privilege and require authenticated, audited access.
  • Configure appropriate log retention, encryption, and deletion policies.
  • Review existing logs and securely remove historical payload data where operational and legal requirements permit.
  • Add automated tests or static-analysis rules that detect logging of request bodies and upstream response bodies.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
server.js:7
Finding

External API Forwarding Endpoint Lacks Access Control and Abuse Protection

Content
View full analysis

Vulnerability Details

File Location: server.js, lines 7–40
Vulnerability Type: Unauthenticated access to an external API forwarding capability
Risk Level: Medium

Vulnerable Code:

js
app.post("/api/skill/call", async (req, res) => {
  const { content } = req.body;

  if (!content) {
    return res.json({
      success: false,
      message: "content 不能为空"
    });
  }

  try {
    console.log("收到用户输入:", content);
    console.log("正在调用目标 API...");

    // 👉 调用目标 API
    const response = await fetch("https://test-gig-c-api.1haozc.com/api/wx/kjj/v1/customer/skill/call", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify({ content })
    });

    const data = await response.json();
    console.log("目标 API 返回:", data);

    // 返回目标 API 的结果给用户
    res.json({
      success: true,
      result: data
    });
  } catch (error) {
    console.error("API 调用失败:", error);
    res.json({
      success: false,
      message: "调用 API 失败: " + error.message
    });
  }
});

Technical Analysis

The forwarding route has no authentication or authorization middleware. Any client that can connect to the service can cause it to submit attacker-selected content to the fixed external API and return the resulting data.

The only validation is a truthiness check on content. The route has no per-client rate limit, request quota, strict content type validation, payload-specific size limit, or concurrency control. Although express.json() applies its default JSON-body limit, that control does not prevent repeated requests or automated consumption of upstream and local resources.

This is not a general server-side request forgery issue because the destination URL is fixed and cannot be selected by the requester. The exposed capability is unauthorized use of the server as a relay to the configured external s ...[truncated 1181 chars]

Remediation
View remediation

Remediation Suggestions

  • Require authentication before permitting access to /api/skill/call, such as a validated API key, signed service token, or authenticated user session.
  • Enforce authorization so only approved identities can invoke the external processing capability.
  • Apply per-identity and per-source rate limits, concurrency limits, and usage quotas.
  • Restrict the service at the network layer to trusted clients or internal networks when public access is unnecessary.
  • Explicitly bind the listener to a trusted interface, such as loopback, if the service is intended only for local use.
  • Validate that content is a string and enforce an application-specific maximum length.
  • Set explicit upstream connection and response timeouts and cancel requests that exceed those limits.
  • Define safe handling for non-successful upstream HTTP responses instead of treating every parseable response as successful.
  • Monitor invocation rates and alert on anomalous or automated usage.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill invokes an external HTTP API and therefore has network/data egress capability, but the manifest does not declare any explicit tool scope such as permissions or allowed-tools. This weakens governance and reviewability because operators and downstream systems cannot clearly constrain or audit what external access the skill is expected to use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill is designed to send user-provided text directly to a third-party external service, but it does not provide an explicit user-facing warning or consent notice about data transmission. This is dangerous because users may paste sensitive, confidential, or regulated content into the skill without realizing it will leave the local trust boundary and be processed by an external domain.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This code transmits user-controlled content to an external API endpoint, which is a genuine data exfiltration boundary even if it is the intended feature of the skill. In this skill context, the behavior is expected for summarization, but it remains security-relevant because there are no safeguards around sensitive data submission, third-party trust, or output/error handling.

Content

Scanner excerpt · server.js (reported line 22)May include surrounding context.

js
console.log("正在调用目标 API...");

    // 👉 调用目标 API
    const response = await fetch("https://test-gig-c-api.1haozc.com/api/wx/kjj/v1/customer/skill/call", {
      method: "POST",
      headers: {
        "Content-Type": "application/json"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The endpoint forwards raw user-provided content to a third-party domain without any consent flow, disclosure, or server-side restriction on what may be sent. This creates a real privacy and data-handling risk because users may submit sensitive text that is then transmitted externally and logged locally, with no indication of trust boundaries or retention practices.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest description and most operational instructions are presented only in Chinese, which can amount to a language-policy issue if the skill effectively forces a specific language without user opt-in. There is no indication that the skill offers multilingual use or that Chinese-only behavior is required for a region-specific or compliance reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description is written only in Chinese ('调用自定义 API 做文本处理 / 总结'), which may indicate a language-specific constraint without any opt-in or explanation. The policy requires avoiding forced language or locale constraints unless the user is given a choice or the limitation is clearly documented and justified.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dependency uses a caret range (^4.18.2), which allows installation of different Express patch/minor releases over time. This weakens supply-chain reproducibility and makes it harder to verify whether deployed instances include vulnerable or unexpected versions, especially when the skill processes user-supplied text via a network-facing API.

Content

Scanner excerpt · package.json (reported line 12)May include surrounding context.

json
"dev": "node --watch server.js"
  },
  "dependencies": {
    "express": "^4.18.2"
  }
}

Unverifiable Dependency: express has 5 known advisory(ies) (CVE-2024-10491 (Express ressource injection); CVE-2014-6393 (No Charset in Content-Type Header in express); CVE-2024-9266 (Express Open Redirect vulnerability) +2 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Express has multiple known advisories, and because the manifest does not pin an exact version, it is not possible to determine from this file alone whether an affected release may be installed. In a server-side skill exposing HTTP functionality, this uncertainty increases risk because framework-level issues such as open redirect or response-handling flaws can become remotely reachable.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The natural-language strings and user-visible messages in this skill are exclusively in Chinese, and the file provides no option for users to choose another language. This can violate language or locale policy where skills should not force a specific language without explicit opt-in or documented justification.

Content

No source excerpt is available for this finding.