Back to skill

Security audit

Frontend Composition Patterns

Security checks for vulnerabilities and agentic risk

Overview

The skill is a straightforward React coding guide; the main caution is that its installation docs use mutable, unpinned sources.

This skill appears safe as React architecture guidance. Before installing from the README commands, prefer a pinned ClawHub version or immutable Git commit and review the installer source, especially if installing globally into Cursor or Claude Code skill directories.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:34
Finding
Unpinned npm Package Execution Through the Mutable latest Tag## Vulnerability Details **File Location**: `SKILL.md:34-40`; `README.md:29-33` **Vulnerability Type**: Unpinned executable dependency **Risk Level**: Medium **Vulnerable code in `SKILL.md`:** ```bash ## Installation ### OpenClaw / Moltbot / Clawbot ```bash npx clawhub@latest install composition-patterns ``` ``` **Vulnerable code in `README.md`:** ```bash ### OpenClaw / Moltbot / Clawbot ```bash npx clawhub@latest install composition-patterns ``` ``` ### Technical Analysis The installation instructions use `npx` to download and execute the npm package identified by `clawhub@latest`. The `latest` distribution tag is mutable and provides no guarantee that users will execute the same package version that was reviewed during this audit. Because `npx` can execute package entry points and npm lifecycle behavior, a compromised package release or publisher account could cause arbitrary code to run during installation. The project does not pin an exact audited version, verify package integrity, or provide a checksum against which the downloaded artifact can be validated. This is a supply-chain weakness rather than evidence that the current `clawhub` package is malicious. ### Attack Path 1. An attacker compromises the npm publisher account, package publishing workflow, or another component of the package distribution chain. 2. The attacker publishes a malicious `clawhub` release and assigns it the `latest` tag. 3. A user follows the documented installation command. 4. `npx` resolves `clawhub@latest` to the attacker-controlled release and downloads it. 5. The malicious package executes with the privileges and environment of the user running the command. 6. The payload can access resources available to that user before or while installing the requested Skill. ### Impact Assessment Successful exploitation could permit arbitrary code execution with the installing user's privileges. Depending on the exe ...[truncated 464 chars]
Remediation
## Remediation Suggestions - Replace `@latest` with an exact, reviewed package version, such as `clawhub@X.Y.Z`. - Use npm lockfiles and integrity metadata where the installation workflow supports them. - Verify the expected npm publisher, package provenance, and registry before execution. - Publish and document a cryptographic checksum or signed release artifact for the installer. - In automated environments, install dependencies separately with lifecycle scripts disabled where feasible, inspect them, and execute only after verification. - Periodically review and deliberately update the pinned version rather than allowing installation behavior to change automatically.

T08 · Insecure Dependencies

Warning
Location
README.md:23
Finding
Execution of an Unpinned Installer Against a Mutable GitHub Branch## Vulnerability Details **File Location**: `README.md:23-27` **Vulnerability Type**: Unsafe external dependency and mutable installation source **Risk Level**: Medium **Vulnerable code:** ```bash ## Installation ```bash npx add https://github.com/wpank/ai/tree/main/skills/frontend/composition-patterns ``` ``` ### Technical Analysis This command asks `npx` to resolve and execute the npm package named `add`, then passes it content hosted on the mutable `main` branch of an external GitHub repository. Two independently mutable supply-chain components are therefore involved: 1. The executable npm package selected for the command is not pinned to an exact version. 2. The requested repository content is referenced by a branch name rather than an immutable commit identifier or signed release. The behavior of the installation can consequently change after this project has been audited. The concise package name `add` also makes the command's trust boundary and expected publisher unclear to users. No checksum, commit hash, release signature, or package-integrity verification is provided. This finding identifies an unsafe installation design; the reviewed files do not establish that either the current npm package or GitHub repository is malicious. ### Attack Path 1. An attacker compromises the npm package publisher or the referenced GitHub account or repository. 2. The attacker changes the installer package or modifies content reachable through the repository's `main` branch. 3. A user executes the installation command from the documentation. 4. `npx` downloads and executes the currently resolved `add` package. 5. The installer retrieves or processes the attacker-controlled repository content. 6. Malicious installer logic can execute immediately, or malicious Skill content can be placed into an agent's Skill directory and affect later sessions. ### Impact Assessment Compromise of the executable npm dependency cou ...[truncated 570 chars]
Remediation
## Remediation Suggestions - Replace the generic, unpinned `npx add` invocation with a clearly identified and trusted installer pinned to an exact version. - Reference the GitHub source by an immutable full commit SHA or a signed release tag rather than `main`. - Provide a cryptographic checksum for the expected Skill archive and verify it before installation. - Document the expected npm publisher and GitHub organization so users can validate the source. - Prefer downloading the immutable artifact, validating its signature or checksum, reviewing its contents, and only then copying it into the agent's Skill directory. - Ensure installation fails closed if provenance, commit identity, or integrity validation cannot be established.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The README instructs users to run `npx add` against a remote GitHub URL without pinning to a specific immutable version or commit. That means future changes to the remote package or installer could alter what gets executed at install time, creating a supply-chain risk if the source is compromised or unexpectedly changed.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The command `npx clawhub@latest install composition-patterns` explicitly tracks the latest version, which is not reproducible and allows newly published code to run without prior review. If the package or its dependency chain is compromised, users following the README could execute attacker-controlled code during installation.

Session Persistence

Medium
Category
Rogue Agent
Content
From your project root:

```bash
mkdir -p .cursor/skills
cp -r ~/.ai-skills/skills/frontend/composition-patterns .cursor/skills/composition-patterns
```
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Skill Enumeration

Medium
Category
Agent Snooping
Content
From your project root:

```bash
mkdir -p .claude/skills
cp -r ~/.ai-skills/skills/frontend/composition-patterns .claude/skills/composition-patterns
```
Confidence
85% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Skill Enumeration

Medium
Category
Agent Snooping
Content
#### Claude Code (global)

```bash
mkdir -p ~/.claude/skills
cp -r ~/.ai-skills/skills/frontend/composition-patterns ~/.claude/skills/composition-patterns
```
Confidence
85% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

External Model or Provider Selection

Medium
Category
Excessive Agency
Content
---
name: react-composition-patterns
model: standard
---

# React Composition Patterns
Confidence
90% confidence
Finding
Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The installation command uses `npx clawhub@latest`, which fetches and executes whatever code is currently published under that package/version tag. Because `latest` is mutable, a compromised publisher account, malicious release, or breaking update could cause users to run unreviewed code at install time.

Static analysis

No suspicious patterns detected.