Back to skill

Security audit

Architecture Review

Security checks for vulnerabilities and agentic risk

Overview

This architecture-review skill is coherent, but it can run untrusted project scripts and dynamically downloaded npm tools during broad automatic scans.

Install only if you are comfortable with an architecture-review workflow that may execute project-controlled npm scripts and download analyzer CLIs at runtime. Prefer using it in a sandbox, review commands before running them, avoid exposing credentials, and replace the npm script and unpinned npx calls with pinned or already-installed local tools.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:34
Finding

Execution of Unpinned Third-Party Packages Through npx

Content
View full analysis
/dev/null || npx madge --circular src/ # SKILL.md:51 npx ts-prune 2>/dev/null || npx madge --not --extensions ts,tsx # SKILL.md:72 npx complexity-report --dest ./complexity-report.html 2>/dev/null # SKILL.md:115 npx npm-check-updates 2>/dev/null ``` ### Technical Analysis The Skill recommends invoking multiple packages through `npx` without fixed versions, integrity verification, a committed lockfile requirement, or the `--no-install` restriction. If a requested package is not already installed locally, `npx` may retrieve and immediately execute it from the configured package registry. This creates a supply-chain exposure because the code executed during an audit can change independently of the reviewed Skill. A compromised package release, registry account, dependency chain, or registry configuration could cause arbitrary package code to run under the Agent's identity. The commands also do not require a previously reviewed local installation. ### Attack Path 1. The architecture-review Skill is activated for a target repository. 2. One of the documented `npx` commands is invoked. 3. The requested package is unavailable in the local dependency installation. 4. `npx` resolves and downloads the package from the configured registry. 5. Package lifecycle behavior or CLI entry-point code executes locally. 6. A malicious or compromised package performs actions with the same filesystem, process, and network permissions available to the Agent. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the privileges of the Agent process. Depending on the execution environment, this may permit reading accessible source code and configuration, modifying the audited workspace, spawning child processes, ...[truncated 231 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:34
Finding

Execution of a Repository-Controlled npm Script During Static Review

Content
View full analysis
/dev/null || npx madge --circular src/ ``` ### Technical Analysis The command executes the `list:deps` script defined in the audited repository's `package.json`. An npm script is an arbitrary shell-command execution mechanism; its name does not constrain its behavior. A repository author can therefore define `list:deps` to execute commands unrelated to dependency analysis. Because the Skill is intended to inspect unfamiliar codebases, the target repository must be treated as untrusted input. Executing its npm scripts crosses the boundary between static inspection and execution of repository-controlled code. Redirecting standard error to `/dev/null` also suppresses diagnostics that could otherwise help identify malicious or unexpected behavior. The fallback analyzer runs only if the repository-defined command fails, so a malicious script can return success after executing its payload and prevent the intended analyzer from running. ### Attack Path 1. An attacker provides or modifies a repository that will be audited. 2. The attacker defines a malicious `list:deps` entry in the repository's `package.json`. 3. The architecture-review workflow invokes `npm run list:deps`. 4. npm passes control to the attacker-defined shell command. 5. The command executes with the permissions and environment inherited from the Agent. 6. The command can return a successful status after its payload runs, preventing execution of the fallback `madge` analysis. ### Impact Assessment This can result in arbitrary command execution under the Agent's current account. The malicious script could read files and environment data accessible to that account, alter or delete workspace content, create additional processes, or initiate network connections w ...[truncated 222 chars]
Remediation
View remediation
/dev/null`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrases are broad enough to match common requests like general code review or project inspection, causing the skill to activate outside its intended scope. In an agent system, overbroad activation can unexpectedly run numerous analysis commands, increase exposure to risky tool execution, and interfere with safer or more appropriate workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The listed trigger commands are generic and lack contextual constraints or opt-in confirmation, making accidental invocation likely. Because this skill can chain into other skills and suggests executing multiple analysis commands, broad triggers materially increase operational and security risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The condition 'entering an unfamiliar codebase' is ambiguous and can trigger automatically based on weak context rather than explicit user intent. That makes unintended execution more likely, especially when the skill includes commands that inspect large repositories or invoke external tooling.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Activating on any refactor request without a clear scope conflates ordinary code changes with full architecture review. This can lead to unnecessary broad scans and external tool usage when the user may have intended a small, local edit.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

The skill instructs use of npx madge without pinning a specific version, which can fetch and execute whatever package version is current at runtime. In an agentic workflow, that creates a supply-chain and reproducibility risk because external code may change unexpectedly or be compromised.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
85% confidence
Finding

The fallback to npx madge is also unpinned, so the same supply-chain risk exists even if ts-prune is unavailable. Because this is a fallback path, it may be less scrutinized yet still executes remote package code.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
85% confidence
Finding

The fallback to npx madge is also unpinned, so the same supply-chain risk exists even if ts-prune is unavailable. Because this is a fallback path, it may be less scrutinized yet still executes remote package code.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding

Using npx complexity-report without a fixed version causes the agent to trust and execute the latest resolved package at runtime. This is dangerous in automated skills because the command runs during analysis and can introduce arbitrary code execution via package compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

npx npm-check-updates is another runtime-resolved package execution point with no version pinning. In a security-sensitive agent context, repeated unpinned npx usage increases the attack surface for supply-chain compromise and non-reproducible behavior.

Content

No source excerpt is available for this finding.