Back to skill

Security audit

Publish Skill Publisher

Security checks for vulnerabilities and agentic risk

Overview

The skill is a publishing helper, but it asks agents to automatically read local credentials and source a user .env file before network and publishing actions.

Review carefully before installing. Use this only if you are comfortable with an agent handling publishing credentials, and avoid following the ~/.env sourcing instruction. Prefer explicit user approval for each token, selected target, proxy, git push, PR, and ClawHub publish action.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:39
Finding

Arbitrary Shell Execution Through Sourcing a User-Controlled Environment File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 39-65
Vulnerability Type: Unsafe execution of configuration as shell code
Risk Level: High

Vulnerable Code

markdown
If a variable is missing, read `~/.env` first, then ask the user.

### Network Connectivity

Before any GitHub API call, **test connectivity first**:

```bash
curl -s -m 5 https://api.github.com/repos/NousResearch/hermes-agent > /dev/null 2>&1 && echo "direct OK" || echo "direct FAIL"

If direct access fails (common in restricted networks), load proxy from ~/.env:

bash
source ~/.env
# ~/.env may contain (possibly commented-out):
# https_proxy=http://192.168.28.92:7897
# http_proxy=http://192.168.28.92:7897
# Export the proxy ONLY if direct access failed:
export https_proxy=http://192.168.28.92:7897
export http_proxy=http://192.168.28.92:7897
# Re-test with proxy:
https_proxy=$https_proxy curl -s -m 10 https://api.github.com/ > /dev/null 2>&1 && echo "proxy OK" || echo "proxy FAIL"

Fallback strategy (ordered by priority):

  1. Direct HTTPS access — works in unrestricted networks
  2. Proxy from ~/.env — read https_proxy/http_proxy values; if commented out, uncomment and export them for this session only
text

### Technical Analysis

The skill instructs the agent to execute `source ~/.env`. Shell sourcing does not treat the file as passive configuration: every command, substitution, redirection, function definition, and shell expansion in the file is executed in the current shell.

Environment files are frequently writable by the current user and may be created or modified by unrelated tools. If an attacker can influence this file, the instruction converts control over configuration data into arbitrary command execution. The automatic instruction to read credential-bearing variables also unnecessarily increases the amount of sensitive material brought into the agent's ex
...[truncated 1386 chars]
Remediation
View remediation

Remediation Suggestions

  • Never execute an environment file with source, ., eval, or equivalent shell evaluation.
  • Parse the file as data with a non-executing dotenv parser.
  • Allowlist only the required keys, such as GITHUB_TOKEN, GITHUB_USER, CLAWHUB_TOKEN, HTTPS_PROXY, and HTTP_PROXY.
  • Reject malformed entries, command substitutions, shell metacharacters, unexpected variable names, and duplicate definitions.
  • Do not automatically uncomment or modify configuration entries.
  • Ask for user approval before reading a credential-bearing file when its contents are not strictly required.
  • Never print token values or include them in generated files, logs, prompts, command lines, or error messages.
  • Prefer obtaining credentials directly from the process environment or a dedicated secret manager.
  • Validate proxy schemes and destinations before use, and retain TLS certificate verification.
  • Replace the unsafe example with a small parser that reads only exact KEY=VALUE assignments without executing them.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/validate_skill.py:80
Finding

Incomplete Secret Scanning Allows Credential-Bearing Packages to Pass Validation

Content
View full analysis

Vulnerability Details

File Location: scripts/validate_skill.py, lines 80-104
Vulnerability Type: Fail-open secret validation with incomplete scan coverage
Risk Level: Medium

Vulnerable Code

python
secret_patterns = [
    r"ghp_[A-Za-z0-9]{36}",
    r"xox[baprs]-[A-Za-z0-9-]+",
    r"sk-[A-Za-z0-9]{20,}",
    r"password\s*=\s*['\"][^'\"]{8,}['\"]",
    r"api[_-]?key\s*=\s*['\"][^'\"]{8,}['\"]",
]
for root, _, files in os.walk(scripts_dir):
    for fname in files:
        fpath = os.path.join(root, fname)
        with open(fpath, "r", encoding="utf-8", errors="ignore") as f:
            content = f.read()
        for pattern in secret_patterns:
            if re.search(pattern, content, re.IGNORECASE):
                warnings.append(
                    f"Possible secret in {os.path.relpath(fpath, skill_path)}: "
                    f"matches pattern '{pattern}'"
                )

# Summary
if errors:
    return False, errors + warnings

if warnings:
    return True, [f"Valid with {len(warnings)} warning(s):"] + warnings

Technical Analysis

The validator scans only files below scripts/. It does not inspect SKILL.md, README.md, examples, screenshots, manifests, or other files that can be copied into a publication package. The package generator copies SKILL.md, scripts/, examples, and optional screenshots, so the validator's inspection scope does not match the publication scope.

Detection is also limited to a small collection of regular expressions. Credentials using other provider formats, changed token lengths, private keys, bearer tokens, connection strings, unquoted assignments, encoded secrets, or high-entropy values can pass undetected.

Most importantly, a detected secret is recorded only as a warning and the function returns True. Automated workflows relying on the exit status will therefore treat a package containing a recognized credential as ...[truncated 1381 chars]

Remediation
View remediation

Remediation Suggestions

  • Scan every regular text file that will be included in the generated package rather than limiting inspection to scripts/.
  • Build or stage the exact publication artifact first, then scan that artifact so validation and publication scopes cannot diverge.
  • Detect additional credential classes, including private keys, authorization headers, connection strings, cloud-provider credentials, GitHub token variants, and high-entropy values.
  • Use a maintained secret-scanning engine where possible instead of relying exclusively on a small custom regular-expression list.
  • Treat confirmed or high-confidence secret matches as validation errors and return a nonzero exit status.
  • Provide an explicit, narrowly scoped suppression mechanism for reviewed false positives. Suppressions should identify the exact file and rule and include a justification.
  • Avoid including the detected secret itself in logs or diagnostics; report only the file, line, and detector identifier.
  • Scan binary metadata and supported archive contents where those artifacts can be published.
  • Add automated tests demonstrating that secrets in SKILL.md, examples, nested directories, and supported token formats cause validation to fail.
  • Document an incident response procedure requiring immediate credential revocation and repository-history cleanup if a secret is published.
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 Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a broader publishing tool whose core functions include validation, packaging, publishing to multiple targets, and bilingual README support. The supplied code chunk only implements one subset of that description: validation of SKILL.md structure/content, plus a scan for possible secrets in scripts/. There is no code for packaging artifacts, interacting with any remote service or repository, publishing anywhere, or processing bilingual README files. Because the actual code's primary behavior is narrower and materially different from the declared end-to-end publishing tool, and it also includes an undeclared secret-scanning check, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This instruction directly tells the agent to read authentication tokens from environment files without user confirmation. In context, that is more dangerous because the same skill also discusses external publication and GitHub API usage, meaning the accessed secrets may immediately be used for actions against remote services.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

Instructing the agent to source ~/.env is dangerous because .env files commonly contain API keys, tokens, and arbitrary shell assignments. Sourcing executes shell syntax and imports far more than the narrowly needed proxy settings, creating both secret exposure and command-injection risk if the file contents are malicious or unexpectedly modified.

Content

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

If direct access fails (common in restricted networks), load proxy from ~/.env:

bash
source ~/.env
# ~/.env may contain (possibly commented-out):
# https_proxy=http://192.168.28.92:7897
# http_proxy=http://192.168.28.92:7897

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

This finding is effectively the same risky pattern continued in adjacent lines: the skill treats ~/.env as an automatic configuration source for network behavior. Because .env may hold both credentials and attacker-influenced values, the skill could unintentionally disclose secrets or alter routing for subsequent authenticated operations.

Content

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

bash
source ~/.env
# ~/.env may contain (possibly commented-out):
# https_proxy=http://192.168.28.92:7897
# http_proxy=http://192.168.28.92:7897
# Export the proxy ONLY if direct access failed:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
95% confidence
Finding

The phrase 'do not ask the user' removes an important human approval checkpoint around secret access and external actions. Autonomous decision-making is especially risky here because the skill is oriented toward publishing, where actions may create remote side effects under the user's identity.

Content

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

md
### Authentication

These tokens are pre-configured in `~/.env` and shell environment. Read them automatically — do not ask the user:

| Token | Env Var | Source |
|---|---|---|

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs automatic reading of authentication tokens from ~/.env and the shell environment without prior user confirmation. That creates a credential exposure path where the agent may access sensitive secrets unnecessarily and then use them in downstream network or git operations, increasing the blast radius if the skill is misused or compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Reading authentication tokens automatically without a user-facing warning violates least surprise and can silently escalate the skill from documentation processing into secret-handling and account-acting behavior. In a publishing skill, those credentials could enable repository writes, PR creation, or marketplace publication under the user's identity.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Before any GitHub API call, test connectivity first:

bash
curl -s -m 5 https://api.github.com/repos/NousResearch/hermes-agent > /dev/null 2>&1 && echo "direct OK" || echo "direct FAIL"

If direct access fails (common in restricted networks), load proxy from ~/.env:

External Transmission

Medium
Category
Data Exfiltration
Confidence
81% confidence
Finding

Retesting GitHub connectivity through an automatically loaded proxy can route traffic through an untrusted intermediary. In the context of a skill that also reads tokens from ~/.env, this raises the chance of credential-bearing requests later traversing attacker-controlled or inappropriate proxy infrastructure.

Content

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

export https_proxy=http://192.168.28.92:7897 export http_proxy=http://192.168.28.92:7897

Re-test with proxy:

https_proxy=$https_proxy curl -s -m 10 https://api.github.com/ > /dev/null 2>&1 && echo "proxy OK" || echo "proxy FAIL"

text

**Fallback strategy** (ordered by priority):

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 · SKILL.md (reported line 68)May include surrounding context.

md
2. Proxy from `~/.env` — read `https_proxy`/`http_proxy` values; if commented out, uncomment and export them for this session only
3. SSH on port 22 — `git@github.com:...` works without proxy in most environments; use for `git clone/push`, but NOT for GitHub REST API (`curl`/`gh api`)

**When proxy is also down**: skip GitHub API PR creation. Push branch via SSH and instruct user to create PR manually via browser.

## Workflow

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The generated README always includes fixed English and Chinese sections and labels, which imposes a specific language/locale behavior rather than offering user selection. This matches the policy category for language or locale constraints without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The description emphasizes bilingual README support specifically in English and Chinese, and the overview repeats that users need a bilingual (EN/ZH) README. Under the policy, forcing or presuming a specific language set without opt-in can be a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The description states the skill provides "bilingual README support," and later specifies EN/ZH output as a use case and generated artifact. This imposes a language/locale behavior by default rather than offering the user a choice, which can conflict with language preference policy expectations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow directs the agent to source proxy configuration from ~/.env and export it automatically. Even though the immediate purpose is connectivity, sourcing a general env file can ingest unrelated secrets and attacker-controlled shell content, and automatic proxying can route subsequent authenticated traffic through untrusted infrastructure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module header says the package includes examples/, and the copy_skill docstring says Copy SKILL.md and scripts/ to the output directory. However, package contents described at L004-L008 omit scripts/ and include examples/, while this function copies SKILL.md and scripts/ only. This is an active documentation mismatch about what the function does.

Content

No source excerpt is available for this finding.