Back to skill

Security audit

Ftp Sync

Security checks for vulnerabilities and agentic risk

Overview

The skill presents itself as an FTP/SFTP sync and backup tool, but the included script is mostly a placeholder while the documentation asks users to pass server credentials on the command line.

Review this before installing. Do not rely on it for backups or deployments in its current form, and do not paste real server passwords into the documented commands. If used at all, treat it as a nonfunctional demo until the documentation and implementation are aligned, credentials are handled safely, and remote sync behavior is tested.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
scripts/ftp_sync.py:65
Finding
Plaintext server credentials accepted and documented as command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ftp_sync.py:65-75`; usage examples also appear in `SKILL.md:27-29` and `SKILL.md:42-47` **Vulnerability Type**: Plaintext credential exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```python p_up = subparsers.add_parser("upload", help="上传同步") p_up.add_argument("local", help="本地目录") p_up.add_argument("--host", required=True, help="服务器地址") p_up.add_argument("--user", required=True, help="用户名") p_up.add_argument("--password", help="密码") p_up.add_argument("--remote", required=True, help="远程目录") p_down = subparsers.add_parser("download", help="下载同步") p_down.add_argument("local", help="本地目录") p_down.add_argument("--host", required=True, help="服务器地址") p_down.add_argument("--user", required=True, help="用户名") p_down.add_argument("--password", help="密码") ``` The project documentation actively demonstrates this interface: ```bash python3 scripts/ftp_sync.py upload ./local_folder/ --host 192.168.1.1 --user root --password xxx python3 scripts/ftp_sync.py upload ./dist/ --host example.com --user ftpuser --password pass123 --remote /var/www/html/ python3 scripts/ftp_sync.py upload ./data/ --host example.com --user user --password pass --sync ``` ### Technical Analysis Supplying a secret through a command-line option can expose it outside the intended process. Depending on the operating system and host configuration, command-line arguments may be visible through process inspection facilities, process-monitoring software, audit logs, terminal capture, CI logs, or diagnostic tooling. Interactive shells may also retain the complete command in persistent history. The current implementation parses the password but does not perform network synchronization. This means the credential is exposed without providing the advertised authentication benefit. If synchronization is implemented later without changing this interface, the same weakness will affect functional server ...[truncated 1366 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the `--password` command-line option from both upload and download subcommands. 2. Prompt interactively with `getpass.getpass()` when password authentication is explicitly requested: ```python from getpass import getpass password = getpass("Server password: ") ``` 3. Prefer SSH agent authentication, protected private keys, or a platform credential manager over password authentication. 4. If non-interactive operation is necessary, integrate with a secret manager or accept a narrowly scoped environment variable only after documenting its residual exposure risks. Do not print or log its value. 5. Clear references to secrets as soon as practical and ensure exceptions, debug output, and synchronization reports never include credentials. 6. Remove all plaintext `--password` examples from `SKILL.md`. 7. Avoid examples that encourage direct remote login as `root`; document a dedicated, least-privileged synchronization account instead. 8. Add tests confirming that passwords are not present in command-line arguments, logs, generated reports, or exception messages. ]]>

T08 · Insecure Dependencies

Note
Location
scripts/ftp_sync.py:43
Finding
Unpinned third-party dependency installation recommendation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ftp_sync.py:43-46` **Vulnerability Type**: Unconstrained dependency installation and supply-chain risk **Risk Level**: Low ### Vulnerable Code ```python # 实际同步需要 paramiko 库,这里简化处理 print("⚠️ 完整同步需要安装: pip install paramiko") print(" 或者使用系统命令: rsync -avz local/ user@host:/remote/") ``` ### Technical Analysis The script directs users to install `paramiko` without a reviewed version constraint, lock file, or integrity hash. Consequently, the package version and transitive dependency set are resolved from the user's configured package index at installation time and can change independently of the audited project. The package name shown is not evidence of typosquatting, dependency confusion, or a currently malicious release. The risk arises from recommending mutable, unverified dependency resolution. A compromised package release, package-index configuration, mirror, or transitive dependency could introduce code that was not included in this audit. Python packages and their build backends can execute code during installation, while installed libraries execute with the privileges of the invoking process when imported. Although the current script does not import `paramiko`, the displayed instruction encourages a separate installation action. ### Attack Path 1. A user runs the script and receives the recommendation to execute `pip install paramiko`. 2. The user runs that command in an environment whose package index or mirror determines the resolved artifacts. 3. Pip selects the latest compatible package and transitive dependencies rather than an audited, immutable dependency set. 4. If the selected artifact, dependency, configured mirror, or package-index response is compromised, attacker-controlled code may execute during installation or later import. 5. That code executes with the operating-system permissions of the user performing the installation. This path is conditional on supply-chain or pac ...[truncated 649 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Declare reviewed dependencies in a project dependency file rather than printing an ad hoc installation command. 2. Pin direct and transitive dependencies to reviewed versions using a lock file. 3. Use hash verification, such as pip's `--require-hashes`, for reproducible installation from approved artifacts. 4. Configure and document an approved HTTPS package index; do not rely on arbitrary user-configured mirrors for security-sensitive deployments. 5. Install dependencies in an isolated virtual environment under an unprivileged account rather than into the system Python environment. 6. Add automated dependency vulnerability and provenance checks to the release process. 7. If `paramiko` is implemented as an optional dependency, define a pinned optional dependency group and provide a reviewed installation procedure. 8. Keep the lock file and hashes under version control and re-audit them before upgrades. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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 (8)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The skill claims FTP/SFTP upload, download, diff, and incremental sync capabilities, but the analysis indicates those behaviors are not actually implemented and may be placeholders. This is dangerous because users may rely on it for administrative or backup tasks, assume files were synchronized, and make operational decisions based on false expectations, potentially causing data loss, missed backups, or unsafe server state.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger phrases are broad enough to match ordinary file synchronization or server-related requests without sufficient specificity, which can cause the agent to invoke this skill in contexts the user did not intend. In a tool that can modify remote files, unintended activation increases the risk of accidental overwrite, misuse of credentials, or execution of an incomplete or misleading workflow.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill describes remote synchronization commands but does not warn users about overwrite, deletion, drift, credential exposure, or the need to verify destination paths before syncing. In a server-management context, missing safety warnings materially increases the chance of destructive operator error, especially because users may run examples as-is with privileged accounts like 'root'.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This code file contains user-facing natural language in Chinese in the module description, help text, and status messages, which indicates the skill is oriented to a single language. Under the policy, locale or language restrictions should not be imposed without user opt-in or clear justification, and none is provided here.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The skill advertises FTP/SFTP synchronization and incremental backup, but the implementation only lists local files and prints placeholder messages instead of performing any authenticated remote transfer. This is dangerous because users may rely on it for backups or server synchronization and falsely believe critical data has been transferred or protected when no such operation occurred.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
All user-facing natural-language content, including description, headings, and usage guidance, is presented only in Chinese. There is no indication that the skill is region-specific or that users may opt into another language, which may violate language/locale policy requirements.

Intent-Code Divergence

Low
Confidence
92% confidence
Finding
The function docstring states that it synchronizes local files to a remote destination, but the code never establishes a network connection or transfers data. Misleading operational descriptions can cause administrators to trust a nonfunctional sync path, leading to missed deployments or absent backups.

Static analysis

No suspicious patterns detected.