Back to skill

Security audit

Ftp Client Php

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be an FTP file manager as described, but it handles credentials and downloads in unsafe ways that could expose secrets or overwrite local files.

Review before installing. Use this only with a trusted, self-managed PHP proxy, HTTPS with proper certificate validation, a non-empty proxy API key, and a least-privilege FTP account. Avoid highly sensitive data until the transport validation, secret-redaction, and download filename handling are fixed; use explicit --out paths and carefully confirm delete targets.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ftp-api.mjs:94
Finding

TLS Certificate Validation Is Disabled for Proxy Requests

Content
View full analysis
{ const url = new URL(apiUrl); const isHttps = url.protocol === "https:"; const transport = isHttps ? https : http; const jsonData = JSON.stringify(body); const headers = { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(jsonData), }; if (apiKey) { headers["X-API-Key"] = apiKey; } const options = { hostname: url.hostname, port: url.port || (isHttps ? 443 : 80), path: url.pathname + url.search, method: "POST", headers: headers, rejectUnauthorized: false, // 允许自签证书 }; const req = transport.request(options, (res) => { const chunks = []; res.on("data", (chunk) => chunks.push(chunk)); res.on("end", () => { const raw = Buffer.concat(chunks).toString("utf-8"); try { const json = JSON.parse(raw); resolve(json); } catch { reject(new Error(`PHP 代理返回非 JSON 响应 (HTTP ${res.statusCode}):\n${raw.substring(0, 500)}`)); } }); }); req.on("error", (e) => reject(new Error(`请求 PHP 代理失败: ${e.message}`))); req.setTimeout(120000, () => { req.destroy(); reject(new Error("请求 PHP 代理超时 (120s)")); }); req.write(jsonData); req.end(); }); } ``` The same `rejectUnauthorized: false` setting is also present in the multipart request at lines 178-185 and the raw-download request at lines 229-236. ### Technical Analysis Setting `rejectUnauthorized` to `false` disables validation of the HTTPS server's certificate chain and hostname. Consequently, encryption alone does not authentic ...[truncated 1832 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/download.mjs:18
Finding

Proxy-Controlled Download Filename Allows Local Path Traversal

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ftp-api.mjs:27
Finding

Malformed Configuration Error Discloses FTP Credentials and API Keys

Content
View full analysis
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 (19)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill requires sensitive environment-based configuration including FTP credentials and a proxy endpoint, but it does not declare an explicit tool scope or permissions boundary. That omission can mislead reviewers and users about what the skill accesses, reducing transparency and increasing the chance that secrets are exposed or the skill is used with broader privileges than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill routes FTP credentials and file contents through an HTTP-accessible PHP proxy, but the documentation does not provide a clear security/privacy warning about this trust boundary. Because the proxy can observe credentials and transferred data, and may be internet-reachable, users may underestimate the risk of credential compromise, file disclosure, or server-side abuse if the proxy is misconfigured or malicious.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill exposes delete operations, including recursive directory deletion, without an explicit warning that these actions are destructive and may be irreversible. In a file-management context, this increases the risk of accidental mass deletion of remote data, especially when executed by an agent or user relying on abbreviated documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code hard-codes all user-facing CLI messages in Chinese, including usage, progress, success, and error output. That imposes a specific language on all users without opt-in or any documented region-specific justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The client accepts an arbitrary proxy URL and will send FTP host, username, and password to it even when the configured scheme is plain HTTP. In addition, TLS certificate verification is explicitly disabled with rejectUnauthorized: false, so even HTTPS connections are vulnerable to man-in-the-middle interception and credential theft.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The upload path reads arbitrary local files and forwards their contents to the remote PHP proxy, which creates a real exfiltration path from the local environment to an external service. In the context of a file-management/FTP skill this behavior is expected, but it is still sensitive and dangerous if users are not clearly informed which local files are being transmitted and to what endpoint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script uses Chinese-only natural-language strings in the operation label and all user-facing console messages, such as "列出目录", "目录 ... 为空", and "错误". This enforces a specific language/locale for all users without offering a language choice or documenting a justified locale constraint, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code emits all user-facing usage, progress, success, and error messages in Chinese only. For a general-purpose move script, hard-coding a single language without opt-in or documented region-specific scope is a natural-language policy concern under the locale/language rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User-visible strings such as the usage and error messages are hard-coded in Chinese, which imposes a specific language on all users. The policy allows locale constraints only when users are given a choice or the restriction is clearly documented and justified, neither of which is present in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's usage, status, and error messages are presented only in Chinese, which imposes a specific language on users. The file does not provide any opt-in, fallback, or documentation indicating that the skill is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's usage, progress, success, and error messages are all hard-coded in Chinese. For a general-purpose copy utility, this imposes a specific language on users without offering a choice or documenting that the skill is intended only for a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script's user-facing usage, progress, success, and error messages are all hard-coded in Chinese. For a general-purpose download utility, this imposes a specific language on users without opt-in or any documented locale limitation, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file's natural-language comments and runtime error messages are written in Chinese, and there is no indication that the skill supports user language selection or opt-in. This can violate a language/locale policy when skills are expected to avoid forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest describes an FTP/FTPS file manager routed through an HTTP PHP proxy, but does not mention accessing process environment variables to obtain connection secrets. Reading runtime configuration is common, but pulling remote-host credentials and API keys from environment state is an extra capability beyond the user-facing file-management purpose.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The comment at L211 says the function gets a base64 response and writes it to local storage, which implies a filesystem side effect. In reality, httpDownloadRaw only performs an HTTP request and resolves with either parsed JSON or a raw buffer; it does not write anything to disk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The user-facing strings for usage, output, and errors are all fixed in Chinese, which enforces a specific language for all users. This matches the language/locale policy violation category because there is no opt-in, fallback, or documented justification for the locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's user-facing strings are entirely in Chinese, including usage, progress, and error messages. This imposes a specific language on all users without any opt-in, selection mechanism, or documented region-specific justification, which matches the natural-language policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code performs a network/API read of remote file content via apiCall("read", ...) and immediately processes the response, but the script itself provides no confirmation prompt, user-facing notice, or comment/docstring warning that remote data will be transmitted and displayed. For code files, network calls that transmit user or system data should have some form of disclosure unless the behavior is clearly documented elsewhere.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's user-facing messages, including usage, progress, success, and error text, are all hard-coded in Chinese. This creates a language/locale policy concern because the tool does not provide opt-in, selection, or documentation showing that it is intentionally limited to a Chinese-speaking context.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.