Back to skill

Security audit

huawei-cloud-study-plan-generate

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently generates study plans locally, with no evidence of hidden network access, credential use, or background activity.

Requires Python 3 and produces Chinese-language labels. No cloud credentials are needed. Choose the optional output path carefully because it can replace an existing file.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write, 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.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_generate_study_plan.py (reported line 154)May include surrounding context.

python
class CliTests(unittest.TestCase):
    def test_help(self):
        proc = subprocess.run([sys.executable, str(SCRIPT), "--help"],
                              capture_output=True, text=True)
        self.assertEqual(proc.returncode, 0)
        for flag in ("--days", "--slots-per-day", "--topics",

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_generate_study_plan.py (reported line 162)May include surrounding context.

python
self.assertIn(flag, proc.stdout)

    def test_cli_markdown_default(self):
        proc = subprocess.run(
            [sys.executable, str(SCRIPT), "--seed", "20240501",
             "--start-date", "2026-10-24"],
            capture_output=True, text=True)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_generate_study_plan.py (reported line 173)May include surrounding context.

python
def test_cli_text_and_json(self):
        for fmt in ("text", "json"):
            proc = subprocess.run(
                [sys.executable, str(SCRIPT), "--seed", "42", "--days", "2",
                 "--slots-per-day", "2", "--format", fmt,
                 "--start-date", "2026-01-01"],

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_generate_study_plan.py (reported line 183)May include surrounding context.

python
json.loads(proc.stdout)

    def test_cli_invalid_days(self):
        proc = subprocess.run(
            [sys.executable, str(SCRIPT), "--seed", "1", "--days", "0",
             "--start-date", "2026-01-01"],
            capture_output=True, text=True)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/test_generate_study_plan.py (reported line 192)May include surrounding context.

python
def test_cli_output_file(self):
        out = SKILL_DIR / "tests" / "_tmp_output.md"
        try:
            proc = subprocess.run(
                [sys.executable, str(SCRIPT), "--seed", "1", "--days", "1",
                 "--output", str(out), "--start-date", "2026-01-01"],
                capture_output=True, text=True)

The plan's weekday labels are fixed to Chinese without user language or locale opt-in.

Low
Category
Output Handling
Confidence
97% confidence
Finding

The output specification requires days to be labelled with a Chinese weekday, regardless of the user's language. The skill offers no language or locale choice and provides no justification for this fixed locale.

Content

No source excerpt is available for this finding.

The acceptance criteria require Chinese-language table headers without user language choice or a documented locale justification.

Low
Category
Output Handling
Confidence
93% confidence
Finding

The required Markdown table specifies Chinese labels for every column, making Chinese-language output a condition of acceptance. No user opt-in or locale-specific justification is provided for this requirement.

Content

No source excerpt is available for this finding.

Generated plans use Chinese labels without a user-selectable language or documented locale justification.

Low
Category
Output Handling
Confidence
90% confidence
Finding

The Markdown renderer unconditionally emits Chinese headings and column labels; the text renderer, weekday names, and fallback practice templates likewise use Chinese. The CLI offers output-format selection but no language choice, and the file does not justify restricting this general-purpose study-plan generator to a particular locale.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
tests/test_generate_study_plan.py:16