Back to skill

Security audit

InspirAI Deploy

Security checks for vulnerabilities and agentic risk

Overview

This deployment skill is mostly coherent, but it includes an unsafe pattern that can execute repository-controlled deployment commands with the user's deployment privileges.

Review before installing. Only use this skill on repositories whose deployment configuration you trust, avoid running production deploys through free-form config commands, and require explicit review of any generated command, especially when using skip or force options.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:412
Finding
Arbitrary Command Execution Through Repository-Controlled Deployment Configuration## Vulnerability Details **File Location**: `SKILL.md`, lines 412–416 **Vulnerability Type**: Shell command injection through unsafe `eval` **Risk Level**: High ```bash # 从 .deploy.yaml 或自动发现获取命令 DEPLOY_CMD=$(get_command "deploy" "$ENV") # 通常是: just deploy $ENV 或 helm upgrade ... echo "[INFO] 执行部署: $DEPLOY_CMD" eval "$DEPLOY_CMD" ``` ### Technical Analysis The deployment command is retrieved from `.deploy.yaml`, a project-controlled configuration file, and passed directly to the shell through `eval`. The Skill does not require validation, an executable allowlist, safe argument parsing, or rejection of shell control syntax before execution. Because `eval` reparses its input as shell code, a crafted deployment value can contain command separators, command substitutions, redirections, pipelines, or other shell constructs. Consequently, a repository contributor who can modify `.deploy.yaml` can turn a normal deployment invocation into arbitrary command execution when a user or Agent runs the Skill. This issue crosses a trust boundary: repository content is treated as executable code while deployment credentials and infrastructure access may be available in the invoking environment. ### Attack Path 1. An attacker gains the ability to contribute to or otherwise modify a repository containing `.deploy.yaml`. 2. The attacker changes the configured deployment command to include a legitimate-looking deployment operation followed by malicious shell syntax. 3. A user or Agent reviews the repository and invokes `/deploy run` for an environment. 4. `get_command "deploy" "$ENV"` reads the attacker-controlled command into `DEPLOY_CMD`. 5. `eval "$DEPLOY_CMD"` reparses the entire value as shell code. 6. The injected command executes with the operating-system identity, environment variables, credentials, network access, and deployment permissions available to the invoking process. ### Impact Assessment Successful exploitation permits arbitrary command execution with th ...[truncated 699 chars]
Remediation
## Remediation Suggestions 1. Remove `eval` and do not execute a configuration value as a shell program. 2. Replace free-form command strings with structured configuration containing: - An allowlisted executable or deployment strategy. - A list of separately parsed arguments. - Explicit environment and component fields. 3. Execute the command using an argument array so shell metacharacters are not interpreted. For example: ```bash cmd=(just deploy "$ENV") "${cmd[@]}" ``` 4. Prefer fixed, strategy-specific implementations for Helm, Kubernetes, Docker Compose, Vercel, and Fly.io rather than arbitrary repository-defined command templates. 5. Validate environment names, component names, file paths, release names, namespaces, and other interpolated values against strict allowlists or conservative character patterns. 6. Reject configuration containing shell control operators, command substitution, redirection, or unexpected executable names. This validation should be defense in depth rather than a substitute for removing `eval`. 7. Display the fully resolved executable and arguments and require explicit user confirmation before production deployment. 8. Treat repository deployment configuration as untrusted during review, especially when the deployment process has access to production credentials.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

Credential Access

High
Category
Privilege Escalation
Content
# 1. 环境变量检查
echo "[CHECK] 环境变量..."
# 检查 .env / .env.{env} 是否存在必需变量

# 2. Git 状态检查
echo "[CHECK] Git 状态..."
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
components   要部署的组件列表(默认: 全部)

选项:
  --skip-check         跳过所有预检查
  --skip-image-check   跳过镜像推送检查
  --skip-config-check  跳过配置同步检查
  --force              强制部署
Confidence
94% confidence
Finding
The skill exposes options such as '--skip-check', '--skip-image-check', '--skip-config-check', and '--force', allowing safety gates to be bypassed during deployment. In a deployment automation context this is dangerous because it can permit releases with missing images, bad configuration, wrong branches, or broken connectivity, increasing the likelihood of outages or misdeployments.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```
/deploy run uat                    # 完整流程部署到 uat
/deploy run prd core ops           # 只部署 core 和 ops 到生产
/deploy run dev --skip-check       # 开发环境跳过检查
/deploy run uat --strategy compose # 强制使用 compose 策略
```
Confidence
91% confidence
Finding
The example explicitly encourages using '--skip-check' for deployment, normalizing bypass of validation steps. Because examples shape operator behavior, this increases the chance that users will imitate unsafe patterns and deploy without guardrails.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger list includes broad generic terms such as 'deploy', '发布', and '上线', which can cause the skill to activate in routine conversation or unrelated contexts. Because this skill performs deployment-oriented actions and suggests command execution, accidental invocation could lead to unintended operational changes or unsafe guidance.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill content is written entirely in Chinese and presents behavior as Chinese-first without any indication of honoring the user's language preference. This can cause misunderstandings during high-risk deployment workflows, increasing the chance that a user approves or runs commands they did not fully understand.

Static analysis

No suspicious patterns detected.