Back to skill

Security audit

Permission Manifest Guard

Security checks for vulnerabilities and agentic risk

Overview

This permission-auditing skill is mostly coherent, but its CLI can write through target-controlled symlinks and its scanner can miss executable code hidden by target-controlled ignores, so it needs review before use.

Install or run this only in a low-privilege environment and avoid pointing the CLI at untrusted directories until symlink-safe output handling and scanner coverage rules are fixed. Treat its generated recommendations as advisory, especially for packages with dist, package entry points, or custom ignore files.

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
src/cli.ts:55
Finding

Predictable manifest output follows attacker-controlled symbolic links

Content
View full analysis
/permission-manifest.json`. It does not use `lstat`, a no-follow file-open option, or another check to establish that an existing output path is a regular file rather than a symbolic link. Node.js `writeFile` follows an existing symbolic link. A malicious Skill can therefore provide `permission-manifest.json` as a symlink to another file writable by the account running the audit. The manifest write then truncates and replaces the symlink target. This write is a documented side effect of the CLI, but following target-controlled symlinks is not necessary for the declared static-analysis functionality and exceeds the minimum safe write privilege. The programmatic `analyzeSkill` API does not itself perform this write; the issue specifically affects the CLI entry point. ### Attack Path 1. An attacker creates a Skill directory containing otherwise reviewable files. 2. The attacker adds a symbolic link named `permission-manifest.json`. 3. The link targets a file writable by the reviewer, such as a user configuration, project file, or shell initialization file. 4. The reviewer invokes `permission-manifest-guard `. 5. Analysis completes and the CLI calls `writeFile` on the predictable output path. 6. The operating system follows the symbolic link, truncating and replacing the target with manifest JSON. The attack does not grant operating-system privilege escalation beyond the audit process's existing identity, but it crosses the intended bo ...[truncated 597 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/discovery.ts:5
Finding

Target-controlled exclusions can hide the code that is actually executed

Content
View full analysis
{ const ignorePatterns = loadIgnorePatterns(skillDir); const results: string[] = []; let entries: fs.Dirent[]; try { entries = await fs.promises.readdir(skillDir, { recursive: true, withFileTypes: true }); } catch { return results; } for (const entry of entries) { const parentDir = entry.parentPath; const fullPath = path.join(parentDir, entry.name); const stat = await fs.promises.lstat(fullPath); if (shouldIgnoreEntry(entry.name, ignorePatterns, stat.isSymbolicLink())) continue; if (!stat.isFile()) continue; const relativePath = path.relative(skillDir, fullPath); const segments = relativePath.split(path.sep); if (segments.slice(0, -1).some(seg => shouldIgnoreEntry(seg, ignorePatterns, false))) { continue; } results.push(segments.join('/')); } results.sort(); return results; } ``` The executable package configuration is: ```json "main": "dist/index.js", "bin": { "permission-manifest-guard": "dist/cli.js" } ``` ### Technical Analysis The security boundar ...[truncated 2383 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/discovery.ts:111
Finding

Metadata mismatch and lexical scanning allow disposition manipulation through inert content

Content
View full analysis
typeof p === 'string', ); } ``` The analysis then classifies all discovered file contents without separating runtime source from tests or fixtures: ```typescript const { files, diagnostics: readDiags } = await readDiscoveredFiles(filePaths, skillDir); let risky: string[] = []; try { risky = detectRiskyCapabilities(files).map(r => r.capability); } catch (err) { diagnostics.push({ file: '', stage: 'classification', message: 'Classification failed', error: (err as Error).message }); } ``` Risky-capability detection performs line-oriented regular-expression matching without establishing that a match is executable syntax: ```typescript export function detectRiskyCapabilities(files: DiscoveredFile[]): RiskyCapability[] { const results: RiskyCapability[] = []; for (const file of files) { const lines = file.content.split('\n'); for (let i = 0; i < lines.length; i++) { const line = lines[i]; for (const rp of RISKY_PATTERNS) { if (rp.pattern.test(line)) { results.push({ capability: rp.capability, severity: rp.severity, filePath: file.path, line: i + 1, snippet: line.trimStart().slice(0, MAX_SNIPPET_LENGTH), explanation: rp.explanation, }); } } } } return results; } ``` ### Technical Analysis The Skill's own frontmatter declares: ```yaml capabilities: - read_filesystem ``` However, `parseSkillFrontmatter` only reads `permission ...[truncated 2599 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (177)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding describes concrete undeclared sensitive behaviors: reading local config, accessing process.env.API_KEY, making outbound HTTPS requests, invoking execSync, and contacting an internal host (secret.internal). In the context of a tool positioned as a permission auditor, these actions are highly suspicious because the skill would be trusted to inspect other code while actually possessing data-exfiltration and command-execution capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This finding describes concrete undeclared sensitive behaviors: reading local config, accessing process.env.API_KEY, making outbound HTTPS requests, invoking execSync, and contacting an internal host (secret.internal). In the context of a tool positioned as a permission auditor, these actions are highly suspicious because the skill would be trusted to inspect other code while actually possessing data-exfiltration and command-execution capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding describes concrete undeclared sensitive behaviors: reading local config, accessing process.env.API_KEY, making outbound HTTPS requests, invoking execSync, and contacting an internal host (secret.internal). In the context of a tool positioned as a permission auditor, these actions are highly suspicious because the skill would be trusted to inspect other code while actually possessing data-exfiltration and command-execution capability.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This finding describes concrete undeclared sensitive behaviors: reading local config, accessing process.env.API_KEY, making outbound HTTPS requests, invoking execSync, and contacting an internal host (secret.internal). In the context of a tool positioned as a permission auditor, these actions are highly suspicious because the skill would be trusted to inspect other code while actually possessing data-exfiltration and command-execution capability.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
92% confidence
Finding

The skill directly depends on js-yaml 4.1.1, which has multiple reported denial-of-service issues involving expensive parsing behavior such as merge-key chains and omap resolution. Because this skill inspects skill directories and translates manifests, it is likely to parse YAML from potentially untrusted skill content, making parser-level CPU exhaustion materially relevant in context.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
98% confidence
Finding

The package depends on js-yaml 4.1.1, which is flagged as having multiple CPU-consumption denial-of-service advisories. This skill's stated purpose includes inspecting skill directories and translating requirements, and the presence of js-yaml strongly suggests it may parse attacker-controlled YAML metadata; that makes algorithmic complexity bugs materially more dangerous because a crafted file could hang or significantly degrade the analysis process.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/extract.ts (reported line 67)May include surrounding context.

ts
if (ext && SHELL_ENV_EXTS.has(ext)) return true;
  const basename = path.basename(filePath);
  if (SHELL_ENV_BASENAMES.has(basename)) return true;
  // Dotfiles like .env, .env.local, .env.production
  if (basename === '.env' || basename.startsWith('.env.')) return true;
  return false;
}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/configPatterns.test.ts (reported line 166)May include surrounding context.

ts
if (ext && SHELL_ENV_EXTS.has(ext)) return true;
  const basename = path.basename(filePath);
  if (SHELL_ENV_BASENAMES.has(basename)) return true;
  // Dotfiles like .env, .env.local, .env.production
  if (basename === '.env' || basename.startsWith('.env.')) return true;
  return false;
}

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/extract.test.ts (reported line 1215)May include surrounding context.

ts
if (ext && SHELL_ENV_EXTS.has(ext)) return true;
  const basename = path.basename(filePath);
  if (SHELL_ENV_BASENAMES.has(basename)) return true;
  // Dotfiles like .env, .env.local, .env.production
  if (basename === '.env' || basename.startsWith('.env.')) return true;
  return false;
}

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 · tests/classify.test.ts (reported line 216)May include surrounding context.

ts
});

  it('returns bonus for chmod', () => {
    assert.equal(scorePrivilegeEscalation(entry('shell_command', 'chmod 777 /tmp/file')), 3);
  });

  it('returns bonus for chown', () => {

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% 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 · tests/classify.test.ts (reported line 277)May include surrounding context.

ts
const inputs = [
      entry('network', '*.example.com'),
      entry('file_write', '/etc/passwd'),
      entry('shell_command', 'sudo rm -rf /'),
    ];
    const run1 = classifyRisk(inputs);
    const run2 = classifyRisk(inputs);

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% 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 · tests/classify.test.ts (reported line 277)May include surrounding context.

ts
const inputs = [
      entry('network', '*.example.com'),
      entry('file_write', '/etc/passwd'),
      entry('shell_command', 'sudo rm -rf /'),
    ];
    const run1 = classifyRisk(inputs);
    const run2 = classifyRisk(inputs);

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/classify.test.ts (reported line 378)May include surrounding context.

ts
it('adds privilege escalation bonus for system paths', () => {
    const safe = classifyRisk([entry('file_write', '/tmp/scratch')])[0];
    const system = classifyRisk([entry('file_write', '/etc/shadow')])[0];
    assert.ok(system.riskScore > safe.riskScore,
      `System path score ${system.riskScore} should exceed safe path score ${safe.riskScore}`);
  });

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 · tests/classify.test.ts (reported line 652)May include surrounding context.

ts
});
  });

  // --- fs.chmod/fs.chown ---
  describe('permission modification (fs.chmod/chown)', () => {
    it('detects fs.chmod()', () => {
      const results = detectRiskyCapabilities([file('a.ts', 'fs.chmod("/tmp/file", 0o777, cb);')]);

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/classify.test.ts (reported line 689)May include surrounding context.

ts
assert.ok(results.some(r => r.capability === 'process.env mutation'));
    });

    it('detects process.env["KEY"] = value (bracket notation write)', () => {
      const results = detectRiskyCapabilities([file('a.ts', 'process.env["SECRET"] = token;')]);
      assert.ok(results.some(r => r.capability === 'process.env mutation'));
    });

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/classify.test.ts (reported line 690)May include surrounding context.

ts
});

    it('detects process.env["KEY"] = value (bracket notation write)', () => {
      const results = detectRiskyCapabilities([file('a.ts', 'process.env["SECRET"] = token;')]);
      assert.ok(results.some(r => r.capability === 'process.env mutation'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/extract.ts (reported line 58)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/extract.ts (reported line 68)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/extract.ts (reported line 672)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/extract.ts (reported line 695)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · src/extract.ts (reported line 981)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/configPatterns.test.ts (reported line 27)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/configPatterns.test.ts (reported line 48)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/configPatterns.test.ts (reported line 177)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/configPatterns.test.ts (reported line 266)May include surrounding context.

ts
}

  describe('dotenv', () => {
    it('matches .env', () => {
      assert.ok(matches('dotenv', 'readFile(".env")'));
    });