Back to skill

Security audit

Career Path Advisor

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent career-planning tool, but its CLI script unsafely embeds a user-provided target role into Python code, so a crafted profile could run unintended code on the user's machine.

Review before installing. The career-planning behavior is understandable, but do not run scripts/advisor.sh on profiles or target-role text supplied by someone you do not trust until the Python source interpolation is fixed. The publisher should change the script to treat target_role only as JSON data or an argument, not as code text.

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/advisor.sh:374
Finding

Arbitrary Python Code Execution Through Target Role Injection

Content
View full analysis

Vulnerability Details

File Location: scripts/advisor.sh, lines 374-381
Vulnerability Type: User-controlled input interpolated into dynamically generated Python source code
Risk Level: High

Vulnerable Code

bash
result=$( {
  echo "$profile"
  echo "---DATA---"
  cat "$REF_DIR/roles.json"
} | python3 -c "
import json, sys

stdin_data = sys.stdin.read()
parts = stdin_data.split('---DATA---')
profile = json.loads(parts[0])
roles_data = json.loads(parts[1])
target_role = profile.get('target', '$target_role')

Technical Analysis

The target_role shell variable originates from the user-controlled target property supplied through --profile. It is directly interpolated into the source text passed to python3 -c.

Parsing the profile as JSON does not make the value safe for insertion into Python source code. A target containing a single quote, closing parenthesis, Python statements, and a comment marker can terminate the intended string literal and append arbitrary Python code.

For example, a target value shaped like the following benign proof of concept can cause the process to run id:

text
'); __import__("os").system("id"); #

The generated Python statement becomes equivalent to:

python
target_role = profile.get('target', ''); __import__("os").system("id"); #')

Python evaluates function arguments before calling the function. Consequently, the injected default expression and subsequent statement are processed even when the profile already contains a target property. The script does not enforce schemas/input.schema.json at runtime and does not escape the value for use as Python source.

Attack Path

  1. An attacker supplies a crafted JSON profile through the --profile argument.
  2. The profile includes a nonempty target string containing Python syntax that closes the intended string literal.
  3. parse_profile verifies only that the inpu ...[truncated 1213 chars]
Remediation
View remediation

Remediation Suggestions

Never interpolate user-controlled values into executable Python source. The target is already present in the parsed profile, so it should be read exclusively as data:

python
target_role = profile.get("target", "")

Remove the '$target_role' interpolation from the python3 -c program entirely. If a separate value must be supplied, pass it as a positional argument or through a structured input channel:

bash
python3 -c '
import json
import sys

profile = json.loads(sys.stdin.readline())
target_role = profile.get("target", "")
'

Additional hardening should include:

  1. Enforce schemas/input.schema.json before processing the profile.
  2. Verify that target, current_role, location, and every skill are strings of reasonable maximum length.
  3. Keep all untrusted values in JSON, standard input, environment variables, or positional arguments rather than embedding them in code.
  4. Avoid constructing executable programs with double-quoted shell strings.
  5. Add regression tests using targets containing single quotes, double quotes, newlines, semicolons, comment markers, backslashes, and Python expressions.
  6. Run the Skill with least privilege and without unnecessary credentials in its environment.
  7. Do not suppress Python error output with 2>/dev/null during validation or security testing, because suppression can conceal injection attempts and parsing failures.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (7)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill mixes bilingual naming with overwhelmingly Chinese-only prompts, examples, locations, job boards, and constraints, which signals a de facto China/Chinese locale requirement. The file does not explicitly offer users a language or locale choice, nor clearly justify the restriction as a region-specific tool.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

ToolPurposeInstall (macOS)Install (Ubuntu/Debian)
jqJSON processing (role matching, JSON output)brew install jqsudo apt install jq
python3Dynamic role matching, gap analysis computationShips with macOSsudo apt install python3

Both are pre-installed on most development machines. Verify with:

bash

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This JSON schema repeatedly uses Chinese-only example values and locale-specific labels such as job titles, cities, industries, and company tiers, which implies the skill expects or privileges Chinese-language input. For an all-file-types policy check, this can be a natural-language locale restriction because the schema does not indicate that other languages/locales are accepted or that the China-specific context is intentional and documented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script’s header, examples, and setup guidance center on Chinese-language job titles and locations, and later logic explicitly maps Chinese role terms for operation. There is no natural-language indication that users may choose another language or locale, which can violate a language/locale policy requiring opt-in rather than forcing one locale.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
#
# Prerequisites: jq (https://stedolan.github.io/jq/) and python3
#   macOS: brew install jq (python3 ships with macOS)
#   Ubuntu/Debian: sudo apt install jq python3
#   Windows: install via chocolatey / winget / WSL
#
# MIT-0 License

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/advisor.sh (reported line 12)May include surrounding context.

sh
#
# Prerequisites: jq (https://stedolan.github.io/jq/) and python3
#   macOS: brew install jq (python3 ships with macOS)
#   Ubuntu/Debian: sudo apt install jq python3
#   Windows: install via chocolatey / winget / WSL
#
# MIT-0 License

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example usage hard-codes Chinese-language interaction (e.g., Chinese prompt text and Chinese role/location examples) without presenting a language option or clearly documenting that the skill is intended only for Chinese-speaking users. This can exclude users, cause misleading expectations about supported locales, and create unfair or inaccessible behavior in a generally applicable career-advice skill.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.