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

Content
View full analysis

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
View 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');
}
  1. Use fs.statSync(outputPath).isDirectory() to require a directory.
  2. Reject absolute configuration values unless there is a documented, explicitly approved use case.
  3. Resolve symbolic links before performing the containment check.
  4. Pass the validated outputPath, rather than the original untrusted value, to Wrangler.
  5. Display the canonical directory and require explicit confirmation before deployment.
  6. 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

Content
View full analysis

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
View 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

Content
View full analysis

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
View 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.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 24)May include surrounding context.

md
1. **执行计划确认**:在调用 `deploy.js` 之前,必须简要向用户说明将要执行的参数和动作,并征得用户同意。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 142)May include surrounding context.

md
1. **执行计划确认**:在调用 `deploy.js` 之前,必须简要向用户说明将要执行的参数和动作,并征得用户同意。

Description-Behavior Mismatch

High
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

Scanner excerpt · SKILL.md (reported line 111)May include surrounding context.

md
case '--public':
        options.public = true;
        break;
      case '--skip-test':
        options.skipTest = true;
        break;
      case '--skip-github':

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

Scanner excerpt · deploy.js (reported line 284)May include surrounding context.

js
case '--public':
        options.public = true;
        break;
      case '--skip-test':
        options.skipTest = true;
        break;
      case '--skip-github':

Tool Parameter Abuse

High
Category
Tool Misuse
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).

Content

Scanner excerpt · deploy.js (reported line 337)May include surrounding context.

js
case '--public':
        options.public = true;
        break;
      case '--skip-test':
        options.skipTest = true;
        break;
      case '--skip-github':

Undeclared Tool Scope

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
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.

Content

Scanner excerpt · deploy.js (reported line 613)May include surrounding context.

js
}

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

  if (options.skipGithub || options.skipDeploy) {

Autonomous Decision Making

Medium
Category
Excessive Agency
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.

Content

Scanner excerpt · deploy.js (reported line 734)May include surrounding context.

js
}

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

  if (options.skipGithub || options.skipDeploy) {

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
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.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
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.

Content

Scanner excerpt · deploy.js (reported line 693)May include surrounding context.

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

  console.log(`
本地路径:     ${results.projectPath}

Autonomous Decision Making

Medium
Category
Excessive Agency
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.

Content

Scanner excerpt · deploy.js (reported line 699)May include surrounding context.

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

  console.log(`
本地路径:     ${results.projectPath}