Back to skill

Security audit

Clean Code

Security checks for vulnerabilities and agentic risk

Overview

The skill content is ordinary clean-code guidance, but its installation instructions use mutable unpinned remote commands and one README command names a different skill.

Review the install path before using this skill. Prefer a pinned ClawHub version or an audited local checkout, and verify whether you intend to install `clean-code` rather than `clean-code-review`. After installation, expect the skill to influence coding/refactoring style in the selected project or global agent environment.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Warning
Location
README.md:23
Finding

Mutable Remote Source Passed to an Unpinned npx Package

Content
View full analysis
Remediation
View remediation
\ https://github.com///tree//skills/testing/clean-code ``` The exact package, version, commit, and integrity value should be selected and verified by the project maintainer. ]]>

T08 · Insecure Dependencies

Warning
Location
README.md:29
Finding

Installation Instructions Execute Unpinned Latest-Version Packages

Content
View full analysis
Remediation
View remediation
install clean-code ``` 2. Ensure the package name, publisher, and registry provenance are verified before documenting the command. 3. Make the skill identifier consistent across all documentation. Based on the audited metadata, both files should refer to `clean-code`, not `clean-code-review`. 4. Commit and distribute a lockfile or integrity metadata where the installation mechanism supports it. 5. Prefer signed releases and verify package signatures or checksums before execution. 6. Consider using `npx --package=clawhub@` or an equivalent explicit invocation that makes the executed package identity clear. 7. Add installation guidance warning that npm packages execute with the current user's permissions and should not be run with elevated privileges. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (12)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| [Code Smells](references/code-smells.md) | Classic code smells catalog with detection patterns — Bloaters, OO Abusers, Change Preventers, Dispensables, Couple

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/refactoring-catalog.md (reported line 83)May include surrounding context.

md
1. Create new function named after what it does (not how)
2. Copy the code fragment to the new function
3. Pass any needed variables as parameters
4. Replace the original code with a call to the new function

---

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The README instructs users to execute a remote package/installer command via npx add without pinning to a specific immutable version or commit. This creates a supply-chain risk because the content fetched at install time can change, allowing a compromised upstream package, repo, or tag to execute unexpected code on the user's machine.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

Using npx clawhub@latest install clean-code-review explicitly tracks the moving latest release, so users will execute whatever code is published most recently. If the package is compromised or a bad release is pushed, installation can run attacker-controlled code in the local environment.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · README.md (reported line 42)May include surrounding context.

From your project root:

bash
mkdir -p .cursor/skills
cp -r ~/.ai-skills/skills/testing/clean-code .cursor/skills/clean-code

Skill Enumeration

Medium
Category
Agent Snooping
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.

Content

Scanner excerpt · README.md (reported line 58)May include surrounding context.

From your project root:

bash
mkdir -p .claude/skills
cp -r ~/.ai-skills/skills/testing/clean-code .claude/skills/clean-code

Skill Enumeration

Medium
Category
Agent Snooping
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.

Content

Scanner excerpt · README.md (reported line 65)May include surrounding context.

Claude Code (global)

bash
mkdir -p ~/.claude/skills
cp -r ~/.ai-skills/skills/testing/clean-code ~/.claude/skills/clean-code

External Model or Provider Selection

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

Content

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

md
---
name: clean-code
model: standard
category: testing
description: Pragmatic coding standards for writing clean, maintainable code — naming, functions, structure, anti-patterns, and pre-edit safety checks. Use when writing new code, refactoring existing code, reviewing code quality, or establishing coding standards.
version: 2.0

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The description says the skill should be used for writing new code, refactoring, reviewing code quality, or establishing coding standards, which are broad triggers that could activate across many ordinary development tasks. Overly broad activation increases the chance this skill influences tasks outside its narrow intended scope, potentially overriding more task-specific safeguards or introducing unintended autonomous behavior in coding workflows.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The installation command uses npx clawhub@latest install clean-code, which fetches and executes the latest package version at runtime rather than a pinned, reviewed release. This creates a supply-chain risk: if the upstream package is compromised or a breaking/malicious version is published, users of the skill could execute untrusted code during installation.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% 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 · SKILL.md (reported line 254)May include surrounding context.

md
4. **NEVER write functions longer than 20 lines** — extract sub-functions until each does one thing
5. **NEVER nest deeper than 2 levels** — use guard clauses, early returns, or extract functions
6. **NEVER use magic numbers or strings** — define named constants with clear semantics
7. **NEVER edit a file without checking what depends on it** — broken imports and missing updates are the most common source of bugs in multi-file changes
8. **NEVER leave a task with failing lint or type checks** — fix all errors before marking complete

---

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file includes example code that performs safety-relevant actions such as charging via Stripe, writing orders to a database, sending email, and mutating inventory. Under the markdown-file criteria, the description does not provide any warning that these behaviors affect external systems or user data, so readers could reuse the example without seeing disclosure of those impacts.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.