Back to skill

Security audit

Node.js API 客户端黄金标准

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent API client skill, but it has real credential-handling risks that should be reviewed before use.

Review this skill before installing or using it with real API keys. Only use trusted HTTPS endpoints, do not pass user-controlled request paths, and patch the client to reject cross-origin absolute URLs or strip credentials when the destination differs from the configured endpoint.

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
reliable-api-client.js:554
Finding

API Credential Disclosure and SSRF Through Absolute Request URLs

Content
View full analysis
{ return await this.backoff.retry(async () => { try { return await this.doRequest(url, method, data, entry.key, entry.auth, options); } catch (err) { this.endpointManager.markError(entry.url, this.extractErrorType(err)); throw err; } }); }); ``` ```javascript resolvePath(path, entry, type) { // If a complete URL is supplied, return it directly if (path.startsWith('http')) return path; // Infer the request type from the path if (!type) { if (path.includes('chat')) type = 'chat'; else if (path.includes('completions') && !path.includes('chat')) type = 'completions'; else if (path.includes('embeddings')) type = 'embeddings'; } const paths = entry.paths || this.defaultPaths; const basePath = paths[type] || this.defaultPaths[type] || path; return basePath; } ``` ```javascript doRequest(url, method, data, apiKey, auth, options) { return new Promise((resolve, reject) => { const parsed = new URL(url); const isHttps = parsed.protocol === 'https:'; const client = isHttps ? https : http; const body = data ? (typeof data === 'string' ? data : JSON.stringify(data)) : null; const prefix = auth?.prefix; const authValue = (prefix === '' || prefix == null) ? String(apiKey) : `${String(prefix).trimEnd()} ${apiKey}`; const req = client.request({ hostname: parsed.hostname, port: parsed.port || (isHttps ? 443 : 80), path: parsed.pathname + parsed.sear ...[truncated 2533 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
reliable-api-client.js:27
Finding

Authentication Credentials Can Be Transmitted Over Plaintext HTTP

Content
View full analysis
{ const parsed = new URL(url); const isHttps = parsed.protocol === 'https:'; const client = isHttps ? https : http; const body = data ? (typeof data === 'string' ? data : JSON.stringify(data)) : null; const prefix = auth?.prefix; const authValue = (prefix === '' || prefix == null) ? String(apiKey) : `${String(prefix).trimEnd()} ${apiKey}`; const req = client.request({ hostname: parsed.hostname, port: parsed.port || (isHttps ? 443 : 80), path: parsed.pathname + parsed.search, method, headers: { 'User-Agent': 'ReliableAPIClient/3.3', [auth.header]: authValue, ...this.headers, ...options.headers }, timeout: this.timeout }, (res) => { ``` ### Technical Analysis Endpoint normalization checks only whether the supplied string begins with `http`. This accepts both secure `https://` endpoints and insecure `http://` endpoints. When an HTTP endpoint is used, `doRequest()` deliberately selects Node.js's plaintext `http` module. The function still constructs and attaches the endpoint's API key or bearer token to the request. No secure-transport enforcement, explicit insecure-mode option, loopback restriction, or warning prevents credentials and payloads from being sent without transport encryption. TLS is necessary here to protect both confidentiality and integrity. Plaintext HTTP permits a network-positioned adversary to observe credentials and request content or modify requests and responses in transit. ### Attack Path 1. A user ...[truncated 1115 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 96)May include surrounding context.

md
- `reliable-api-client.js` - 主代码

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill documents and encourages outbound network access to multiple API endpoints, but its metadata does not declare any tool scope or permissions for network use. This creates a governance gap: an agent or reviewer may not understand that the skill can transmit data externally, increasing the risk of unintended exfiltration or unreviewed third-party communications.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language content of the skill forces a specific language/locale for users, and there is no indication that users may choose another language or that the Chinese-only presentation is required for a region-specific purpose. This matches the policy category for language or locale constraints without user opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill prominently demonstrates API requests, multiple endpoints, and API key rotation without any warning about transmitting data to external services or safely handling credentials. In this context, the omission is security-relevant because users may embed secrets directly in code examples and send sensitive data to remote systems without understanding storage, logging, or exposure risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The client sends messages, prompt, and input data to configured remote endpoints via HTTP(S), but the code provides no explicit user-facing disclosure beyond implementation comments. For a reusable client skill, this means potentially sensitive user content is transmitted off-system without any confirmation prompt, visible notice, or warning in the file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation shows client.addEndpoint('https://new-endpoint.com', priority: 8);, which is not valid JavaScript argument syntax. Because this is presented as executable usage for the advertised client, the example contradicts the implied intent that the snippet demonstrates how the API actually works.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file header and many inline comments are written in Chinese, presenting the skill as a fixed-language implementation without offering any language or locale choice. This can violate language/locale policy when a skill assumes a specific language rather than documenting user choice or regional scope.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.