Back to skill

Security audit

Publisher

Security checks for vulnerabilities and agentic risk

Overview

This skill is a publishing helper, but it can upload the whole current directory to a public GitHub repository without enough file scoping or secret-safety checks.

Review the directory carefully before using this skill. It can initialize git, commit everything under the current directory that is not ignored, create a public GitHub repository, push the contents, and publish to ClawdHub. Do not run it in a folder containing secrets, private code, .env files, logs, backups, or unreviewed files unless the script is tightened first with file previews, allowlists, secret scanning, and private-by-default repository creation.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/publish.sh:174
Finding
Unrestricted Directory Contents May Be Published to a Public GitHub Repository<![CDATA[ ## Vulnerability Details **File Location**: `scripts/publish.sh`, lines 174-187 **Vulnerability Type**: Uncontrolled publication of potentially sensitive files **Risk Level**: High ### Vulnerable Code ```bash # Initialize git if needed if [ ! -d ".git" ]; then echo "🔧 Initializing git..." git init git add . git commit -m "Initial commit: $SKILL_NAME v$VERSION" fi # Create GitHub repo echo "🐙 Creating GitHub repository..." if ! gh repo view >/dev/null 2>&1; then gh repo create "$SKILL_NAME" --public --source=. --remote=origin --push || { ``` ### Technical Analysis The script executes `git add .`, recursively staging every non-ignored file under the selected skill directory. It subsequently invokes `gh repo create` with the `--public` and `--push` options, causing the staged contents to be uploaded to a publicly accessible GitHub repository. No controls are implemented to: - Restrict publication to an explicit allowlist of expected skill files. - Detect credentials, private keys, access tokens, `.env` files, logs, backups, or local configuration. - Verify that an effective `.gitignore` exists. - Display and validate the complete staged file list before publication. - Scan the commit or Git history for secrets. - Obtain a dedicated confirmation acknowledging that the repository will be public. The general publication confirmation does not identify the files that will be exposed. Although ignored files are not staged, the script does not establish or validate ignore rules. Sensitive files already tracked in an existing repository may also be pushed through the existing-repository branch. ### Attack Path 1. A sensitive file, such as `.env`, a private key, an API token file, a configuration backup, or a log containing credentials, is present in the selected skill directory. 2. The file is not covered by an existing `.gitignore` rule, or it is already tracked by Git. 3. The user approves the general GitHub and ClawdHub publicat ...[truncated 1294 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Replace recursive staging with an allowlist.** Stage only files expected in a skill package, such as: ```bash git add -- SKILL.md README.md VERSION scripts/ ``` 2. **Validate the selected directory before staging.** Reject common sensitive paths and file patterns, including: - `.env` and `.env.*` - `*.pem`, `*.key`, `*.p12`, and `*.pfx` - SSH keys - Cloud credential files - Authentication tokens - Database exports, logs, archives, and backup files 3. **Require and validate `.gitignore`.** Provide secure defaults and verify that sensitive local files are excluded. Do not rely on `.gitignore` as the only security control because previously tracked files remain publishable. 4. **Show the exact publication set.** Before committing or pushing, display: ```bash git status --short git diff --cached --name-only ``` Require explicit confirmation after the user reviews this list. 5. **Run secret detection before publication.** Scan both staged content and relevant Git history using a maintained secret scanner. Abort publication when high-confidence credentials or private keys are detected. 6. **Default to a private repository.** Create private repositories unless the user separately and explicitly confirms public visibility: ```bash gh repo create "$SKILL_NAME" --private --source=. --remote=origin --push ``` 7. **Validate existing repositories as well.** Before `git push`, inspect tracked files, staged changes, repository visibility, remote ownership, and Git history for sensitive material. 8. **Provide incident guidance.** If a secret has already been published, instruct the user to revoke and rotate it immediately, remove it from Git history, invalidate affected sessions, and review access logs. Deleting only the working-tree file is insufficient. ]]>
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Self-Modification

High
Category
Rogue Agent
Content
**Examples:**
- "Automatically refresh tokens before expiry"
- "Automatically backup workspace daily"
- "Automatically update skills on schedule"

**Validation (good one-liners have):**
- ✅ Specific (not generic)
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.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The skill’s top-level description frames it as a documentation/publishing helper, but the documented behavior includes sensitive actions: modifying local files, creating repositories, pushing code to GitHub, and publishing to ClawdHub. This mismatch can mislead users about the scope and risk of execution, increasing the chance they approve actions that expose source code or secrets to remote services.

Credential Access

High
Category
Privilege Escalation
Content
```
Keep [thing] [desired state] [timeframe]
```
Example: "Keep your Claude access token fresh 24/7"

### Pattern B: Elimination
```
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```
Keep [thing] [desired state] [timeframe]
```
Example: "Keep your Claude access token fresh 24/7"

### Pattern B: Elimination
```
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md` (name, description, requirements)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Self-Modification

High
Category
Rogue Agent
Content
echo "✅ Chosen: $CHOSEN_DESC"
    echo ""
    
    # Update SKILL.md frontmatter if needed
    if [ "$SKILL_DESC" != "$CHOSEN_DESC" ]; then
        echo "📝 Updating SKILL.md frontmatter..."
        awk -v desc="$CHOSEN_DESC" '
Confidence
90% confidence
Finding
The script self-modifies repository content by rewriting SKILL.md based on interactive input, which can silently alter package metadata before publication. In a publishing tool this is contextually relevant, but it is still risky because it changes tracked files automatically and those changes are subsequently committed/pushed, potentially causing unintended metadata tampering or accidental publication of misleading content.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README prominently advertises automatic publishing to GitHub and ClawdHub, including repository creation, but does not give a clear up-front warning that running the tool may push local code and metadata to external services. In a publishing skill, this behavior is expected, but insufficient disclosure can still lead users to expose private or incomplete code by mistake.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The publishing workflow describes creating GitHub repositories and pushing code without warning about potential data exposure, accidental publication of private code, or irreversible remote changes. In a skill that automates release actions, omission of these risks makes unsafe use more likely, especially for users running it from the wrong directory or with unreviewed files present.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The script's stated purpose is documentation/publishing assistance, but it also performs networked side effects: creating a GitHub repository, pushing code, and publishing to ClawdHub. This is dangerous because users may invoke it expecting local formatting/help, while it actually transfers repository contents to external services, increasing the risk of unintended data disclosure if run in the wrong directory or with sensitive files present.

Missing User Warnings

Low
Confidence
93% confidence
Finding
The README describes generating and overwriting README.md and updating SKILL.md frontmatter, but it does not clearly warn users that local project files will be modified. This is a safety and integrity issue rather than an exploit primitive, but undisclosed file modification can still cause accidental loss of local edits or unintended content changes.

Intent-Code Divergence

Low
Confidence
98% confidence
Finding
The inline comment says 'Generate README (simplified - use template)', which implies the script will create README.md. In practice, if README.md is missing, the script only prints instructions and waits for the user to create it manually, so the documentation overstates what the code does.

Context-Inappropriate Capability

Low
Confidence
82% confidence
Finding
When GitHub repo creation fails, the script writes a reminder note to /tmp about granting GitHub access. That local reminder-file capability is not an obvious requirement of a skill whose stated purpose is making skills understandable/publishable, and it adds side effects outside the core publishing flow.

Missing User Warnings

Low
Confidence
89% confidence
Finding
On GitHub repo creation failure, the script creates /tmp/github-access-reminder.txt, which is a filesystem write affecting the local system. Although the script logs many major actions, it does not warn the user that it will create this temporary file before doing so.

Static analysis

No suspicious patterns detected.