Back to skill

Security audit

publish-skill-repo

Security checks for vulnerabilities and agentic risk

Overview

This skill performs the expected publishing workflow, but it handles long-lived credentials and pushes repository content with too little destination validation or user confirmation.

Install only if you are comfortable letting it create or modify GitHub repositories, store a ClawHub token as a GitHub secret, commit all non-ignored files, push branches, and create tags. Before use, verify the target `origin`, review staged files for secrets, consider pinning the ClawHub CLI in the generated workflow, and rotate the ClawHub token if it may have been placed in the wrong repository.

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

Error
Location
scripts/publish-skill-repo.sh:121
Finding

Unpinned ClawHub CLI Executes with Access to a Publishing Token

Content
View full analysis
> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "slug=$REPO_NAME" >> "$GITHUB_OUTPUT" echo "name=$REPO_NAME" >> "$GITHUB_OUTPUT" - name: Validate required files shell: bash run: | test -f SKILL.md || (echo "SKILL.md not found" && exit 1) - name: Login to ClawHub run: clawhub login --token "$CLAWHUB_TOKEN" ``` ### Technical Analysis The generated GitHub Actions workflow installs `clawhub` without specifying an exact version: ```bash npm install -g clawhub ``` Consequently, every tagged build resolves and executes whatever package version is published under that npm package name at build time. The dependency is not protected by an exact version, a committed lockfile, or an integrity hash. The workflow also places `CLAWHUB_TOKEN` in the job-wide environment. Processes executed by any step in the job can therefore inherit the publishing credential. Although npm lifecycle scripts normally run during installation, the installed CLI is also explicitly executed later. A compromised package release, compromised maintainer account, or malicious transitive dependency could run arbitrary code in the CI runner and a ...[truncated 1284 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/publish-skill-repo.sh:217
Finding

Source Code May Be Pushed to an Unvalidated Existing Git Remote

Content
View full analysis
/dev/null 2>&1; then echo "==> 添加远程 origin" git remote add origin "https://github.com/$REPO_FULL.git" fi HAS_NEW_COMMITS=false echo "==> 提交代码" git add . if git diff --cached --quiet; then echo "没有新的变更可提交" else HAS_NEW_COMMITS=true if [[ "$NEW_REPO" == "true" ]]; then git commit -m "chore: init skill repo" else STAGED_FILES="$(git diff --cached --name-only)" COMMIT_PARTS="" echo "$STAGED_FILES" | grep -q '^LICENSE$' && COMMIT_PARTS="$COMMIT_PARTS, add license" echo "$STAGED_FILES" | grep -q '^\.github/workflows/' && COMMIT_PARTS="$COMMIT_PARTS, add publish workflow" OTHER="$(echo "$STAGED_FILES" | grep -v '^LICENSE$' | grep -v '^\.github/workflows/')" [[ -n "$OTHER" ]] && COMMIT_PARTS="$COMMIT_PARTS, update skill files" git commit -m "chore: ${COMMIT_PARTS#, }" fi fi LOCAL_AHEAD="$(git log "origin/$MAIN_BRANCH".."$MAIN_BRANCH" --oneline 2>/dev/null | wc -l | tr -d ' ')" if [[ "$HAS_NEW_COMMITS" == "true" || "${LOCAL_AHEAD:-0}" -gt 0 ]]; then CURRENT_BRANCH="$(git branch --show-current)" if [[ "$CURRENT_BRANCH" != "$MAIN_BRANCH" ]]; then echo "==> 当前在 $CURRENT_BRANCH 分支,合并到 $MAIN_BRANCH" git checkout "$MAIN_BRANCH" git merge "$CURRENT_BRANCH" echo "==> 推送 $MAIN_BRANCH" git push -u origin "$MAIN_BRANCH" git checkout "$CURRENT_BRANCH" else echo "==> 推送 $MAIN_BRANCH" git push -u origin "$MAIN_BRANCH" fi ``` ### Technical Analysis The script only checks whether an `origin` remote exists. If one exists, it does not verify: - That the remote uses an expected GitHub host. - That its owner and repository match `$REPO_FULL`. - That it is the same repository on which the script configured the ClawHub secret ...[truncated 1969 chars]
Remediation
View remediation
/dev/null || true)" if [[ -n "$CURRENT_ORIGIN" && "$CURRENT_ORIGIN" != "$EXPECTED_HTTPS" && "$CURRENT_ORIGIN" != "$EXPECTED_SSH" ]]; then echo "Refusing to push: origin does not match $REPO_FULL" >&2 exit 1 fi ``` 2. Canonicalize URLs before comparison to account safely for supported HTTPS and SSH syntax, optional `.git` suffixes, and letter-case behavior. 3. If the destination differs, stop and require explicit user confirmation rather than silently retaining the existing remote. 4. Display the exact destination immediately before every push. 5. Replace broad `git add .` usage with explicit staging of intended files where practical. 6. Show the staged file list and require confirmation before committing: ```bash git diff --cached --name-status ``` 7. Add or validate `.gitignore` rules for common secret-bearing files such as `.env`, private keys, token files, and local configuration. 8. Run secret scanning against staged content before committing or pushing. 9. Verify that the repository receiving the source code is the same repository targeted by `gh secret set`. ]]>
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 (18)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill description understates several sensitive behaviors: reading a local token file, uploading a GitHub secret, modifying repository files, committing/pushing changes, and creating remote tags. This mismatch is dangerous because users may authorize a seemingly simple publish action without understanding that it can exfiltrate local credentials into a remote service and make irreversible repository changes.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
1. **当前目录包含 `SKILL.md`** — 如果没有,提示用户这不是一个 skill 项目

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 · scripts/publish-skill-repo.sh (reported line 237)May include surrounding context.

sh
echo "$STAGED_FILES" | grep -q '^LICENSE$'         && COMMIT_PARTS="$COMMIT_PARTS, add license"
    echo "$STAGED_FILES" | grep -q '^\.github/workflows/' && COMMIT_PARTS="$COMMIT_PARTS, add publish workflow"
    OTHER="$(echo "$STAGED_FILES" | grep -v '^LICENSE$' | grep -v '^\.github/workflows/')"
    [[ -n "$OTHER" ]] && COMMIT_PARTS="$COMMIT_PARTS, update skill files"
    git commit -m "chore: ${COMMIT_PARTS#, }"
  fi
fi

Session Persistence

Medium
Category
Rogue Agent
Confidence
81% confidence
Finding

This duplicate finding points to the same behavior: persistent plaintext storage of a ClawHub token in the user's home directory. In a publishing skill that automates GitHub and ClawHub operations, compromised credentials could allow unauthorized package publication or account actions.

Content

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

md
1. 打开 https://clawhub.ai/
2. 点击 **"Login with GitHub"** 登录
3. 进入 **Settings** → **API tokens** → **"Create token"**
4. 复制生成的 Token(格式:`clh_iVnxxxxxxxx...`)

Token 仅显示一次,请立即保存:

Session Persistence

Medium
Category
Rogue Agent
Confidence
81% confidence
Finding

This duplicate finding points to the same behavior: persistent plaintext storage of a ClawHub token in the user's home directory. In a publishing skill that automates GitHub and ClawHub operations, compromised credentials could allow unauthorized package publication or account actions.

Content

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

md
1. 打开 https://clawhub.ai/
2. 点击 **"Login with GitHub"** 登录
3. 进入 **Settings** → **API tokens** → **"Create token"**
4. 复制生成的 Token(格式:`clh_iVnxxxxxxxx...`)

Token 仅显示一次,请立即保存:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
mkdir -p ~/.clawhub
echo "your-clawhub-token" > ~/.clawhub/secret_token
chmod 600 ~/.clawhub/secret_token

2. GitHub CLI

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill invokes shell commands extensively (gh, git, and a publish script) but does not declare any tool scope or allowed-tools boundary. This increases the chance of overbroad execution in an agent environment, making unintended repository changes, pushes, or secret-handling actions easier to trigger without clear consent and sandbox expectations.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
84% confidence
Finding

The trigger deploy skill can overlap with a broader built-in deploy intent, increasing the risk that users invoke this skill when they intended a different deployment workflow. In this skill, that confusion is more dangerous because activation can lead to repository mutation, pushes, tag creation, and secret-related operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instructions explicitly require the agent to summarize changes in Chinese, and the rest of the skill content is also written as a mandatory Chinese workflow. This is a natural-language locale policy issue because it imposes a specific language on the user without offering a choice or documenting a justified regional constraint.

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 · scripts/publish-skill-repo.sh (reported line 11)May include surrounding context.

sh
# 运行前请确保已完成以下准备工作:
#
# 1. 获取 ClawHub Token 并保存到本地:
#    - 访问 https://clawhub.ai/ → Login with GitHub → Settings → API tokens → Create token
#    - 保存 Token:
#      mkdir -p ~/.clawhub
#      echo "your-clawhub-token" > ~/.clawhub/secret_token

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 · scripts/publish-skill-repo.sh (reported line 11)May include surrounding context.

sh
# 运行前请确保已完成以下准备工作:
#
# 1. 获取 ClawHub Token 并保存到本地:
#    - 访问 https://clawhub.ai/ → Login with GitHub → Settings → API tokens → Create token
#    - 保存 Token:
#      mkdir -p ~/.clawhub
#      echo "your-clawhub-token" > ~/.clawhub/secret_token

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/publish-skill-repo.sh (reported line 15)May include surrounding context.

sh
#    - 保存 Token:
#      mkdir -p ~/.clawhub
#      echo "your-clawhub-token" > ~/.clawhub/secret_token
#      chmod 600 ~/.clawhub/secret_token
#
# 2. 安装并登录 GitHub CLI:
#    - macOS: brew install gh

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script reads a long-lived token from a local file and automatically uploads it into the target GitHub repository as a secret with no interactive confirmation, dry-run, or destination verification. This can unintentionally propagate sensitive credentials to the wrong repository/owner if arguments are mistaken or the working project is not what the user expects, increasing the blast radius of a local secret.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README is written primarily in Chinese and presents the skill interaction in Chinese-first terms, without stating that users may choose their preferred language or locale. Under the policy rule, forcing or implying a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script's human-facing documentation, usage text, and runtime messages are written in Chinese only, with no indication that users can choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · scripts/publish-skill-repo.sh (reported line 93)May include surrounding context.

sh
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,