Back to skill

Security audit

AI-Shifu Course Creator

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because it found a destructive course-import risk, a possible loss of lesson access settings, and capabilities described as outside the stated course-management purpose; the review is incomplete.

Consider the reported deletion and permission-preservation risks, as well as the capabilities outside the stated purpose, before installing. The scan covered 36 of 37 components and was marked partial; some static checks were degraded, so the evidence is incomplete. The suspicious verdict signals real risks and uncertainty, not a conclusion that the author acted maliciously.

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

Warning
Location
scripts/shifu-cli.py
Finding

Existing-course import deletes all outlines without an enforced destructive-operation gate

Content
View full analysis

Impact

An unintended invocation removes the existing course structure and lesson IDs; failure during recreation leaves a partially rebuilt course. Recreated lessons also lose their previous permission configuration. The exact resulting accessibility depends on the deployment's defaults.

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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (47)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The supplied module's sole implemented purpose is agent-runtime detection, not course or platform management. No connection to a declared course-management operation is shown, so this is an undeclared capability rather than a demonstrated supporting implementation detail. The function does not directly read the native environment, inspect terminal state, launch subprocesses, or access the network; filesystem access occurs only through a caller-provided callback.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The supplied chunk implements skill-maintenance functionality rather than course creation, course analysis, or AI-Shifu platform administration. Its external release monitoring and automatic update-notification capability are not disclosed in the description and are distinct from implementation details needed to perform the declared course operations. The code only checks for updates; it does not download or install them, and no course-data exfiltration is evident.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · references/authentication.md (reported line 22)May include surrounding context.

md
ress, echo configuration output, or ask for another confirmation. If saving fails, explain the impact in plain language and keep platform operations paused; do not silently use another site. The selection persists across sessions and Skill upgrades and does not select the conversation or course language.

The hidden information is initialization machinery, not links the user needs to act on: browser authorization links, course links, and eligible official contact links still follow their normal display rules. Only show configuration details when the user explicitly requests them for inspection or troubleshooting; do not add them to normal progress, success, or error messages.

An unknown profile, incomplete temporary configuration, or mismatched credential source is a configuration error, not an invitation to try another profile. If changing a profile's URL is blocked by its authorization state, explain that the user must log out of that profile first or create a separate profile; neve

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/cli/cli-reference.md (reported line 93)May include surrounding context.

}

text

Profile IDs are generated opaque identifiers used for safe cross-platform directories, independent of user-facing names. Each `profiles/<id>/` contains its own `credentials.json` and optional `pending-device-auth.json`. Both bind authorization to the normalized issuing `base_url`; mismatches fail before sending credentials. Writes are atomic and use owner-only permissions where supported. `profile list` returns `{"profiles": [...]}` with each entry's `name`, `base_url`, `default`, and `credentials_present`, never tokens; presence does not prove that login is valid. `profile default` returns `{"default_profile": "<name>"}`, or null when unconfigured.

On first use of legacy configuration, the CLI migrates a known saved service and matching credentials into an ordinary profile named `default`. Legacy `.env` configuration is considered with its existing precedence; process-exported tokens are never persisted. A pending request migrates only when its issuing URL matches. Credentials

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 418)May include surrounding context.

python
# Their eventual URL/token cannot be proven from saved state alone.
        indirect_env = any("${" in env.get(key, "") for key in ("SHIFU_BASE_URL", "SHIFU_TOKEN"))
        migration_env = {} if indirect_env else env
        old_credentials = read_private_json(self.root / "credentials.json") or {}
        old_pending = read_private_json(self.root / "pending-device-auth.json") or {}
        configured_url = migration_env.get("SHIFU_BASE_URL") or settings.get("base_url")
        raw_url = (configured_url

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/session-controls.md (reported line 36)May include surrounding context.

md
## Version Check

Run `python3 scripts/shifu-cli.py check-update` only when the user explicitly asks to check or update this skill. Do not check automatically during startup, installation, local writing, or ordinary course operations. An unread remote version state never blocks those tasks.

- Treat the result as internal control data unless the user requests diagnostic details.
- If frontmatter marks `version_management: plugin`, the command skips the release lookup. Standalone uses the skill-level check.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 122)May include surrounding context.

python
def credentials_path(context):
    if context.directory is None:
        raise ProfileError("Temporary credentials cannot be saved; select a named profile.")
    return context.directory / "credentials.json"


def pending_auth_path(context):

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 365)May include surrounding context.

python
def _cleanup_migration(self, journal):
        """Delete only sources whose contents still match the committed migration."""
        for filename, expected in journal.get("legacy_files", {}).items():
            if filename not in {"credentials.json", "pending-device-auth.json"}:
                raise ProfileError("Invalid profile migration journal.")
            path = self.root / filename
            if path.exists() and _digest(path.read_text(encoding="utf-8")) == expected:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 447)May include surrounding context.

python
elif (isinstance(old_token, str) and old_token.strip() and credential_url
              and normalize_base_url(credential_url) == url):
            records.append((credentials_path(context), {"base_url": url, "token": old_token.strip()}))
            legacy_files["credentials.json"] = _digest((self.root / "credentials.json").read_text(encoding="utf-8"))
        if old_pending.get("base_url") and normalize_base_url(old_pending["base_url"]) == url:
            records.append((pending_auth_path(context), {**old_pending, "base_url": url}))
            legacy_files["pending-device-auth.json"] = _digest((self.root / "pending-device-auth.json").read_text(encoding="utf-8"))

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 447)May include surrounding context.

python
elif (isinstance(old_token, str) and old_token.strip() and credential_url
              and normalize_base_url(credential_url) == url):
            records.append((credentials_path(context), {"base_url": url, "token": old_token.strip()}))
            legacy_files["credentials.json"] = _digest((self.root / "credentials.json").read_text(encoding="utf-8"))
        if old_pending.get("base_url") and normalize_base_url(old_pending["base_url"]) == url:
            records.append((pending_auth_path(context), {**old_pending, "base_url": url}))
            legacy_files["pending-device-auth.json"] = _digest((self.root / "pending-device-auth.json").read_text(encoding="utf-8"))

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 376)May include surrounding context.

python
and _digest(current.get(key, "")) == expected]
        if clear_keys:
            # Work on a private copy; interruption can leave either the old or new
            # .env but never a half-written file. The journal makes cleanup retryable.
            fd, temp_name = tempfile.mkstemp(dir=str(self.env_file.parent), prefix=".tmp-profile-")
            try:
                with os.fdopen(fd, "w", encoding="utf-8") as handle:

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/profile_store.py (reported line 414)May include surrounding context.

python
raise ProfileError("Unsupported profile configuration version.")
        settings = settings or {}
        env = self._env_values()
        # Leave environment-dependent .env configurations as temporary inputs.
        # Their eventual URL/token cannot be proven from saved state alone.
        indirect_env = any("${" in env.get(key, "") for key in ("SHIFU_BASE_URL", "SHIFU_TOKEN"))
        migration_env = {} if indirect_env else env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/shifu-cli.py (reported line 114)May include surrounding context.

python
# ── Shared Infrastructure ──────────────────────────────────────────────────────
def ensure_env_file():
    """Create the runtime .env from .env.example when it does not exist."""
    if ENV_FILE.exists():
        return
    if not ENV_EXAMPLE_FILE.exists():

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/shifu-cli.py (reported line 31)May include surrounding context.

python
from skill_update_check import automatic_check_for_update, check_for_update

# ── Constants ──────────────────────────────────────────────────────────────────
ENV_FILE = Path(__file__).resolve().parent.parent / ".env"
ENV_EXAMPLE_FILE = ENV_FILE.with_name(".env.example")

SITE_URLS = profiles.SITE_URLS

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/shifu-cli.py (reported line 126)May include surrounding context.

python
def load_env():
    """Ensure and load environment variables from the skill's .env file."""
    ensure_env_file()
    load_dotenv(dotenv_path=ENV_FILE, override=False)

Pull documentation promises access/visibility preservation, but build/import discards those settings and recreates outlines with platform defaults.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Pull records lesson access and visibility settings and promises they will survive a round trip, but build ignores those settings and import deletes existing outlines before recreating them with name and parent only. If platform defaults are guest and visible, as other comments indicate, re-import can turn paid or hidden lessons into accessible content, potentially exposing them when published.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/shifu-cli.py (reported line 2451)May include surrounding context.

python
if parent is None or parent is item or parent.get("parent_bid"):
                invalid(f"outline_items[{index}].parent_bid",
                        "must reference a different top-level outline in this import")
    return prompt_key


def _import_flat(base_url, token, json_file, shifu_bid, *, import_data=None):

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/shifu-cli.py (reported line 3666)May include surrounding context.

python
try:
            if args.command != "check-update":
                _maybe_check_for_updates()
            process_env = dict(os.environ)
            if args.command != "check-update":
                load_env()
            if args.command not in {"check-update", "build"}:

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

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
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 · references/authentication.md (reported line 17)May include surrounding context.

md
including Chinese and spaces, and do not ask a region question when the URL is already known.

1. Resolve the task's execution context with `python3 scripts/shifu-cli.py site`, adding `--profile <name>` when the user explicitly selects one. Its output is configuration control data, not user-facing content. Profile names have no region meaning; never choose one by its name, recent use, a course directory, or login status.
2. If `status=configured`, silently reuse the returned address and profile without asking again. Without an explicit profile, the CLI uses complete temporary environment configuration when present, otherwise the default profile. Selection and credential precedence are defined in `cli/cli-reference.md#profiles`. Keep the resulting context fixed for this task: pass `--profile <name>` on every later platform command for a named profile, including verification, login continuation, uploads, course operations, and handoff lookups. Using another profile does not change the de

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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 · references/authentication.md (reported line 68)May include surrounding context.

md
## Never Do

- Never print, echo, or repeat the contents of the credentials file.
- Never ask the user for a phone number, verification code, or password. The CLI does not collect any of them, and no agent-driven flow needs them.

Persistent Context Injection

Medium
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill injects content designed to persist in agent memory or context across interactions. Persistent injection can alter agent behavior long after the initial interaction.

Content

Scanner excerpt · references/cli/cli-reference.md (reported line 11)May include surrounding context.

python3 {skillDir}/scripts/shifu-cli.py [--profile ]

text

`--profile <name>` selects one named profile for this invocation and may appear before or after the command. Supply it at most once. Authenticated commands also accept `--token <jwt>` as a non-persistent override for this invocation. Selection is resolved once before platform access; platform requests, uploads, and returned course links use that same context. See [Profiles](#profiles) for selection and credential precedence. Use `{skillDir}/.env.example` as the reference when creating or editing `{skillDir}/.env`:

```dotenv
SHIFU_BASE_URL=

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 · references/cli/cli-reference.md (reported line 160)May include surrounding context.

md
- `export` writes course JSON to stdout or the path passed with `-o`.
- `find-title` requires at least two non-whitespace characters, then matches the keyword case-insensitively after whitespace normalization against current draft and published titles. It does not match historical or renamed titles.

Course links are printed one per line with `Admin console`, `Preview URL`, and optional `Published URL` labels, without headings or explanations. `show` without an outline BID prints the admin and course preview URLs even when the outline tree is empty. A non-empty tree also includes the public learner URL, without checking publication state. `create`, `import`, and `pull` print the admin and course preview URLs; `publish` prints all three. Lesson preview URLs are not printed. Agent browser handoff follows `../session-controls.md#course-admin-handoff`.

## Analytics Query

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 · scripts/shifu-cli.py (reported line 3332)May include surrounding context.

python
p = sub.add_parser("profile", help="Manage independently named service profiles")
    profile_sub = p.add_subparsers(dest="profile_command", required=True)
    profile_sub.add_parser("list", help="List profiles without checking authorization")
    configure = profile_sub.add_parser("set", help="Create or update a profile")
    configure.add_argument("name")
    configure.add_argument("--base-url", required=True, help="cn, com, or a complete service URL")

Unbounded Output

Medium
Category
Output Handling
Confidence
60% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · references/cli/course-directory-spec.md (reported line 271)May include surrounding context.

md
adable or invalid JSON and invalid fields produce a field-specific error on stderr and exit `1` without any platform calls.

- The payload must be an object with a `shifu` object and an `outline_items` array. Course and outline `title` values must be non-empty strings. Optional `shifu.description` and outline `content` values must be strings when supplied; omission defaults to an empty string. All consumed text must be valid UTF-8 Unicode, including the selected Course Prompt. Text is preserved without trimming.
- An outline's `outline_item_bid` may be omitted, empty, or `null` when no child references it. Non-empty IDs must be unique strings; they need not use the builder's UUID format.
- An omitted, empty, or `null` `parent_bid` identifies a top-level outline. Each non-empty parent must be a string identifying a different top-level outline in this payload. Missing parents, self-references, cycles, and nesting beyond two levels are rejected before the old course is modified.
- Both bu