Back to skill

Security audit

one-click dev and dploy

Security checks for vulnerabilities and agentic risk

Overview

This is a real web deployment helper, but it can overwrite, commit, push, and publish broad project contents without strong built-in safeguards.

Review this skill before installing. Use it only on projects that do not contain secrets such as .env files, private keys, npm tokens, or cloud credentials; prefer --skip-github and --skip-deploy until you have reviewed exactly what will be committed and deployed, and set a dedicated build output directory instead of deploying the project root.

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
deploy.js:109
Finding
Build output path traversal can publish files outside the project## Vulnerability Details **File Location**: `deploy.js:109-112`, `deploy.js:492-496`, `deploy.js:525-527` **Vulnerability Type**: Unrestricted deployment path / path traversal **Risk Level**: High ### Vulnerable Code ```js pagesBuildOutputDir: process.env.PAGES_BUILD_OUTPUT_DIR || fileConfig.pagesBuildOutputDir || DEFAULTS.pagesBuildOutputDir ``` ```js const buildOutputDir = config.pagesBuildOutputDir || '.'; const buildPath = path.resolve(projectPath, buildOutputDir); if (!fs.existsSync(buildPath)) { error(`Build output directory does not exist: ${buildPath}`); } ``` ```js ['pages', 'deploy', buildOutputDir, `--project-name=${name}`, `--branch=${branch}`] ``` ### Technical Analysis The build output directory is accepted from an environment variable or configuration file without enforcing that it remains inside the selected project directory. `path.resolve(projectPath, buildOutputDir)` permits both absolute paths and parent-directory traversal such as `../`. The code only verifies that the resolved path exists. It does not: - Verify that the path is a directory. - Confirm that it is contained within `projectPath`. - Reject absolute paths. - Detect symbolic links that resolve outside the project. - Pass the validated canonical path to Wrangler. Consequently, Wrangler can be instructed to deploy an arbitrary directory that the current operating-system user can read. ### Attack Path 1. An attacker influences the environment or deployment configuration, or convinces the operator to use an unsafe configuration. 2. The attacker sets `PAGES_BUILD_OUTPUT_DIR` or `pagesBuildOutputDir` to a value such as `../`, `../../sensitive-directory`, or an absolute path. 3. `path.resolve()` resolves the value outside the intended project. 4. The existence check succeeds because the external path exists. 5. The untrusted path is passed to `wrangler pages deploy`. 6. Wrangler uploads files from that directory to Cloudflare Pages, making them remotely accessible. # ...[truncated 633 chars]
Remediation
## Remediation Suggestions 1. Resolve and canonicalize both the project path and requested output path: ```js const projectRoot = fs.realpathSync(projectPath); const requestedPath = path.resolve(projectRoot, buildOutputDir); const outputPath = fs.realpathSync(requestedPath); const relative = path.relative(projectRoot, outputPath); if ( relative === '' || (!relative.startsWith('..' + path.sep) && !path.isAbsolute(relative)) ) { // Path is contained within the project. } else { error('Build output directory must be inside the project directory'); } ``` 2. Use `fs.statSync(outputPath).isDirectory()` to require a directory. 3. Reject absolute configuration values unless there is a documented, explicitly approved use case. 4. Resolve symbolic links before performing the containment check. 5. Pass the validated `outputPath`, rather than the original untrusted value, to Wrangler. 6. Display the canonical directory and require explicit confirmation before deployment. 7. Prefer a fixed build directory such as `dist` or `public` over deploying arbitrary configurable paths.

T09 · Insecure Skill Coding Practices

Error
Location
deploy.js:210
Finding
Broad source copying, Git staging, and deployment can disclose project secrets## Vulnerability Details **File Location**: `deploy.js:210-218`, `deploy.js:445-449`, `deploy.js:492-496`, `deploy.js:525-527` **Vulnerability Type**: Sensitive file exposure through indiscriminate copying, commits, and deployment **Risk Level**: High ### Vulnerable Code ```js function copyDir(sourcePath, targetPath) { fs.cpSync(sourcePath, targetPath, { recursive: true, force: true, filter: src => { const base = path.basename(src); if (base === '.git') return false; return true; } }); } ``` ```js execFileSync('git', ['init', '-b', branch], { stdio: 'pipe' }); execSync('git add .', { stdio: 'pipe' }); if (hasUncommittedChanges()) { execSync('git commit -m "Initial commit"', { stdio: 'pipe' }); } ``` ```js const buildOutputDir = config.pagesBuildOutputDir || '.'; const buildPath = path.resolve(projectPath, buildOutputDir); if (!fs.existsSync(buildPath)) { error(`Build output directory does not exist: ${buildPath}`); } ``` ```js ['pages', 'deploy', buildOutputDir, `--project-name=${name}`, `--branch=${branch}`] ``` ### Technical Analysis When an existing project is copied, the filter excludes only `.git`. All other files are retained, including common secret-bearing files and directories such as: - `.env` and environment-specific variants. - Private keys and certificates. - Cloud provider configuration. - Package-manager authentication files. - Editor or local deployment configuration. - Backup files and development artifacts. The script subsequently executes `git add .`, which stages every unignored file. If GitHub integration is enabled, those files can be pushed to a remote repository. Independently, the default Cloudflare build output directory is `.`, so the entire project directory can be uploaded rather than a dedicated public build artifact directory. A `.gitignore` may reduce Git exposure when one is already present, but it does not reliably protect the Cloudflare deployment directory. The script perfor ...[truncated 1498 chars]
Remediation
## Remediation Suggestions 1. Require a dedicated deployment output directory such as `dist`, `build`, or `public`; do not deploy the project root by default. 2. Before copying, staging, or deployment, reject common sensitive patterns, including: - `.env`, `.env.*` - `*.pem`, `*.key`, `*.p12`, `*.pfx` - `.npmrc`, `.pypirc` - Cloud and SSH credential directories - Backup and database files 3. Generate or validate an appropriate `.gitignore` before running `git add`. 4. Use an explicit allowlist of generated public assets for deployment. 5. List all files that will be committed and deployed, and require explicit user approval. 6. Integrate a secret scanner before commits and deployment. 7. If a potential secret is detected, abort by default rather than silently excluding it. 8. Document that `.gitignore` does not necessarily prevent files from being uploaded by Wrangler. 9. If disclosure has already occurred, remove the files from deployment and repository history, invalidate caches where relevant, and rotate every exposed credential.

T09 · Insecure Skill Coding Practices

Warning
Location
deploy.js:210
Finding
Existing project files can be overwritten without an enforced confirmation boundary## Vulnerability Details **File Location**: `deploy.js:210-218`, `deploy.js:360-367`, `deploy.js:390-393`; documented confirmation requirement at `SKILL.md:19-35` **Vulnerability Type**: Unconfirmed destructive file overwrite **Risk Level**: Medium ### Vulnerable Code ```js function copyDir(sourcePath, targetPath) { fs.cpSync(sourcePath, targetPath, { recursive: true, force: true, filter: src => { const base = path.basename(src); if (base === '.git') return false; return true; } }); } ``` ```js if (fs.existsSync(projectPath)) { const stat = fs.lstatSync(projectPath); if (!stat.isDirectory()) { error(`Target path is not a directory: ${projectPath}`); } log(`Directory already exists: ${projectPath}`, 'warning'); return projectPath; } ``` ```js copyDir(sourcePath, projectPath); log('Existing project copied', 'success'); return; ``` ### Technical Analysis The skill documentation instructs the Agent to obtain explicit authorization before operations that may overwrite existing files. The executable script does not enforce this boundary. When the target directory already exists, the script only emits a warning and continues. `fs.cpSync()` is then called with `force: true`, allowing source files to replace matching target files. There is no: - Interactive confirmation. - Explicit `--force` or `--overwrite` option. - Non-empty-directory rejection. - Dry-run or overwrite manifest. - Backup or rollback mechanism. Security-critical protections implemented only as natural-language Agent instructions are not reliable enforcement. The script can be run directly, invoked by another automation layer, or called after an Agent misunderstanding. ### Attack Path 1. The operator or automation selects a project name whose target directory already exists. 2. A source directory is supplied that contains paths matching files in the target. 3. The script detects the existing target but only prints a warning. 4. `copyDir()` r ...[truncated 876 chars]
Remediation
## Remediation Suggestions 1. Abort if the target directory exists and is non-empty unless an explicit `--force` or `--overwrite` option is provided. 2. Require interactive confirmation before destructive copying when a terminal is available. 3. For non-interactive execution, require a separate explicit acknowledgment flag rather than treating silence as consent. 4. Generate a dry-run manifest identifying every file that would be created, replaced, or removed. 5. Back up files before replacement or copy into a new staging directory and use an atomic rename after validation. 6. Prefer `force: false` by default. 7. Detect source and target overlap, including nested paths and symbolic-link aliases. 8. Ensure Agent instructions and script-level controls are consistent; natural-language guidance should supplement, not replace, technical enforcement.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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 (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The description claims strong safety confirmation around file overwrite, Git push, and system modification, but the skill text only states policy expectations and also includes automation paths for repository creation, deployment, and dependency installation guidance. A mismatch between advertised safeguards and actual enforceable controls is dangerous because operators may trust the skill to prevent destructive actions when no technical mechanism in the skill guarantees that behavior.

Ae1

High
Category
analysis-evasion
Content
1. **执行计划确认**:在调用 `deploy.js` 之前,必须简要向用户说明将要执行的参数和动作,并征得用户同意。
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
1. **执行计划确认**:在调用 `deploy.js` 之前,必须简要向用户说明将要执行的参数和动作,并征得用户同意。
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The skill metadata claims there is a safety confirmation mechanism for file overwrite, Git push, and system modification, but the implementation performs destructive and externally visible actions automatically once invoked. It can create directories, copy files with overwrite enabled, initialize Git, create/push to remotes, and deploy to Cloudflare without any explicit per-action user confirmation, creating a misleading trust boundary.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
case '--public':
        options.public = true;
        break;
      case '--skip-test':
        options.skipTest = true;
        break;
      case '--skip-github':
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
case '--public':
        options.public = true;
        break;
      case '--skip-test':
        options.skipTest = true;
        break;
      case '--skip-github':
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
case '--public':
        options.public = true;
        break;
      case '--skip-test':
        options.skipTest = true;
        break;
      case '--skip-github':
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill declares operational capabilities in metadata (`requires` for binaries and environment secrets) and documents commands that use networked services and environment variables, but it does not provide an explicit tool scope such as `permissions` or `allowed-tools`. That creates ambiguity about what the agent may access or invoke, increasing the chance of unintended network calls, secret use, or command execution beyond user expectations.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The file's description and operating instructions are presented in Chinese throughout, including required safety and execution steps. This effectively forces a specific language for users and agents without any opt-in, fallback, or stated region-specific justification, which matches the language/locale policy violation criteria.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The skill description, CLI help, prompts, and generated HTML hard-code Chinese-language content and locale-specific output, indicating the skill is intended to operate in Chinese only. There is no visible option for the user to choose language or locale, which conflicts with the policy against forcing a specific language without opt-in.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
}

// 步骤 6: 设置自动部署
function showAutoDeployGuidance(options) {
  log('自动部署提示...', 'step');

  if (options.skipGithub || options.skipDeploy) {
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
}

// 步骤 6: 设置自动部署
function showAutoDeployGuidance(options) {
  log('自动部署提示...', 'step');

  if (options.skipGithub || options.skipDeploy) {
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
After deployment testing fails, the script may modify repository contents by creating a default index.html, commit those changes, and push them to the remote automatically. This extends the tool from deployment into autonomous source modification and publication, which is risky because a transient test failure can trigger unintended changes to a live repository.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
const githubUrl = results.githubUrl || '未创建';
  const deployUrl = results.deployUrl || '未部署';
  const autoDeploy = options.skipGithub || options.skipDeploy ? '未启用' : '需要在控制台连接 GitHub';

  console.log(`
本地路径:     ${results.projectPath}
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
const githubUrl = results.githubUrl || '未创建';
  const deployUrl = results.deployUrl || '未部署';
  const autoDeploy = options.skipGithub || options.skipDeploy ? '未启用' : '需要在控制台连接 GitHub';

  console.log(`
本地路径:     ${results.projectPath}
Confidence
85% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Static analysis

Detected: suspicious.dangerous_exec, suspicious.env_credential_access, suspicious.exposed_secret_literal

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
deploy.js:137

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
deploy.js:74

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
deploy.js:551