T09 · Insecure Skill Coding Practices
- Location
scripts/setup.sh:303- Finding
Persistent Shell Command Injection Through Unescaped Configuration Values
- Content
View full analysis
/dev/null; then cat >> "$SHELL_RC" <- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Qiniu storage skill is purpose-aligned overall, but it has under-disclosed credential persistence, risky installation behavior, and unsafe delete flows that could cause credential exposure or cloud data loss.
Review before installing. Use a narrowly scoped Qiniu key, avoid pasting long-lived secrets into shared shells, inspect and back up shell startup files and mcporter config, and do not use delete or batch-delete on production buckets unless you have independent backups and have verified the exact target objects. Prefer fixing the setup script to avoid global installs, unverified downloads, shell-profile secret exports, and unenforced delete confirmations.
scripts/setup.sh:303Persistent Shell Command Injection Through Unescaped Configuration Values
scripts/setup.sh:54Cloud Secret Key Exposure Through Command-Line Arguments
scripts/setup.sh:247Remote Binary Installed Without Integrity or Authenticity Verification
scripts/setup.sh:202Unpinned Global Package Installation and Unsafe MCP Configuration Replacement
scripts/qiniu_node.mjs:369Deletion Proceeds Without the Documented User Confirmation
The declared description focuses on object storage operations, but the documented behavior also includes software installation, persistent credential storage, shell profile modification, and account configuration. This mismatch is dangerous because users or orchestrators may authorize the skill for routine storage tasks without realizing it can alter the local environment and persist secrets.
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
Referenced artifact was not completely inspected
node scripts/qiniu_node.mjs test-connection
The delete command prints what looks like a confirmation prompt when --force is absent, but immediately continues to perform the deletion without actually reading or enforcing user consent. This creates a deceptive safety mechanism that can cause irreversible remote object deletion when a user believes execution is paused awaiting confirmation.
Remote object deletion is destructive and irreversible, yet the command proceeds even without the advertised force/confirmation safeguard. In a storage-management skill, users may run commands against production buckets, so accidental deletion can directly cause data loss and operational disruption.
Batch deletion reads keys from a file and deletes them with no warning, preview, or confirmation, making large-scale accidental data loss easy. Because this operates on cloud object storage, a mistaken file, malformed list, or automation error could delete many production objects in one run.
The skill documentation instructs users to provide cloud access credentials directly in a setup command, but does not warn about protecting those secrets or avoiding exposure in shell history and shared terminals. For markdown files, omission of warnings about behaviors affecting privacy or credential safety is in scope.
This markdown file includes a delete command example for object storage, including a force flag, but provides no user warning about permanent deletion or impact on stored data. Under the markdown-specific warning rule, destructive behavior that can affect user data should be disclosed clearly in the skill description.
The skill invokes shell commands such as bash setup scripts and node CLI operations, but it does not declare any tool scope restrictions like allowed-tools or permissions. This weakens policy enforcement and makes it easier for the skill to trigger broader shell actions than a user may expect, especially because installation and configuration steps are performed through the shell.
The skill documentation instructs users to pass AccessKey and SecretKey directly on the command line without any warning about secret exposure. Command-line secrets may be captured in shell history, process listings, logs, or transcripts, making credential theft more likely and enabling unauthorized access to the storage account.
The documentation includes deletion of remote objects with a force flag but provides no warning about irreversible data loss, scope of deletion, or confirmation expectations. In a storage-management skill, destructive operations are contextually expected, but omitting safeguards increases the chance of accidental deletion of production data.
The batch-delete example demonstrates irreversible destructive operations without an explicit warning, dry-run mode, or verification guidance. In a storage-management skill, this increases the chance that users or agents will execute mass deletions on production objects, causing avoidable data loss.
The OpenClaw example shows a successful file move operation as if the skill can already perform it, but the immediately following command-line notes say move/copy '需要扩展' and are not yet implemented in the script. That is an active contradiction in the documentation about whether these capabilities currently exist.
The automated backup script includes both local and cloud cleanup logic that permanently deletes backups based on time thresholds, but it provides no safety warning, validation step, or recovery guidance. In backup workflows, unsafe deletion examples are especially risky because mistakes can silently destroy retention history and undermine disaster recovery.
Comments and especially user-visible console messages throughout the script are written exclusively in Chinese, including success, error, and usage text. The file provides no mechanism for locale selection or explicit limitation to a Chinese-only audience, which violates the language-choice policy described.
The manifest and module header describe the skill as supporting upload, download, list, delete, and URL retrieval operations. The code additionally provides move and copy capabilities, which are object-modification actions beyond the stated operation set rather than an obvious implementation detail of those listed features.
The script installs globally executable components via npm and also downloads a qshell ZIP directly from the internet, then places the resulting binary into a user or system PATH location. This creates supply-chain and integrity risk because external code is fetched and made executable without checksum/signature verification or pinning to a trusted digest.
The script writes Qiniu credentials into ~/.mcporter/mcporter.json, persisting secrets on disk for another tool without notifying the user of the storage location or retention risk. Because this is a cloud storage skill, these credentials may provide broad access to buckets and objects, so silent persistence expands the attack surface and complicates secret management and rotation.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
cd "$TEMP_DIR"
if wget -q "$QSHELL_URL" -O qshell.zip && unzip -q qshell.zip && chmod +x qshell; then
sudo mv qshell /usr/local/bin/ 2>/dev/null || mv qshell "$HOME/.local/bin/"
log_info "✅ qshell 安装成功"
cd - > /dev/null
rm -rf "$TEMP_DIR"
The script writes access and secret keys into a persistent JSON config file and into shell startup files without clearly warning the user that sensitive credentials will remain on disk. Even though the config file is chmod 600, persistence still raises exposure risk through backups, local compromise, terminal history workflows, and accidental sharing of dotfiles or project directories.
No suspicious patterns detected.