Back to skill

Security audit

小学作文辅导(家长版)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent, but it needs Review because a local profile command can permanently delete a saved child-writing review without an enforced confirmation flag.

Before installing, review whether local growth-profile data may be important to preserve. If using the profile script, require the agent or wrapper to ask before delete-review, show the exact record being removed, and keep backups or add a confirmation flag. Only enable the advanced API after verifying the configured endpoint, API-key environment variable, privacy notice, and upload consent flow.

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/manage_profiles.py:401
Finding

Single-record deletion does not enforce user confirmation

Content
View full analysis

Vulnerability Details

File Location: scripts/manage_profiles.py, lines 401-402 and 507-516
Vulnerability Type: Missing authorization confirmation for a destructive operation
Risk Level: Medium

Vulnerable Code

python
delete_review = subparsers.add_parser("delete-review", help="删除单次批改摘要")
delete_review.add_argument("--review-id", required=True, help="要删除的批改编号")
python
if args.command == "delete-review":
    profile = read_profile(store_dir)
    if profile is None:
        fail("成长档案不存在")
    if args.review_id not in {item["review_id"] for item in profile["records"]}:
        fail("指定的 review_id 不存在")
    records = [item for item in profile["records"] if item["review_id"] != args.review_id]
    updated = rebuild_profile(profile, records, today)
    atomic_write_json(profile_path, updated)
    print_json({"growth_profile": updated})
    return

Technical Analysis

The Skill requires confirmation before deleting profile data. In particular, references/profile-schema.md states that the Skill must ask the parent for confirmation before deleting an individual review.

However, the executable CLI only requires a review identifier. Unlike profile deletion, insertion, update, and import operations, the delete-review command has no mandatory confirmation flag and performs no runtime confirmation check.

A documentation-level instruction does not enforce authorization when an Agent, automation layer, or another caller can invoke the script directly. Possession of an exact review ID verifies only which record is targeted; it does not prove that the parent authorized deletion.

Attack Path

  1. A growth profile has already been enabled and contains one or more review records.
  2. An Agent or automation component obtains or already knows a valid review ID.
  3. The caller invokes:
    bash
    python3 scripts/manage_profiles.py \
      --store-dir STORE_DIR \
      del
    

...[truncated 1158 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a mandatory confirmation option to the delete-review parser:

    python
    delete_review.add_argument(
        "--confirm-delete",
        action="store_true",
        help="Confirm deletion of the selected review",
    )
    
  2. Enforce the option in the command handler before reading or modifying the profile:

    python
    if args.command == "delete-review":
        if not args.confirm_delete:
            fail("Deleting a review requires --confirm-delete")
    
  3. Require the Agent to display the exact review ID and a summary of the record to the parent before invoking the command with the confirmation flag.

  4. Update references/profile-schema.md so its CLI example and confirmation table explicitly require:

    bash
    delete-review --review-id ID --confirm-delete
    
  5. Add negative tests confirming that deletion without the flag fails and leaves growth-profile.json unchanged.

  6. Consider retaining a user-controlled backup or implementing an explicitly authorized soft-delete mechanism if record recovery is a product requirement.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tainted flow: 'http_request' from os.environ.get (line 153, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/advanced_review_client.py (reported line 165)May include surrounding context.

python
)

    try:
        with urllib.request.urlopen(http_request, timeout=config["timeout_seconds"]) as response:
            body = response.read().decode("utf-8")
            result = require_object(json.loads(body), "API response")
            print(json.dumps({"ok": True, "response": result}, ensure_ascii=False, indent=2))

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明描述的是一个面向家长的完整作文辅导/反馈技能,核心能力应包括接收作文内容(含手写照片)、分析作文并生成多类反馈内容,同时可维护成长档案。实际代码仅覆盖其中很小一部分:对已有“批改摘要”和档案数据进行严格校验与持久化管理。它主要是档案管理工具,而不是作文分析或反馈生成工具。虽然声明末尾提到“维护单个孩子的写作成长档案”,这与代码部分吻合,但代码的主要行为明显缺少声明中的核心能力,因此属于描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

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.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

L03 使用“适用于家长上传孩子作文、询问如何指导修改、生成温和反馈或维护单个孩子的写作成长档案”等宽泛自然语言描述适用场景,但没有给出明确触发短语、边界条件或反例。对于 markdown 技能说明,这类宽泛表述容易与日常求助表达重叠,导致何时应激活该技能不够清晰。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s title and all user-facing instructional text are in Chinese, but the document does not indicate that Chinese is an optional locale or that the skill is intended only for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill file is written as Chinese-only instructional content, including the title, usage steps, prompts, and example parent phrasing, with no indication that users may choose another language. Under the policy, a skill that effectively mandates a specific language without opt-in can be a locale/language policy violation unless the constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown skill content appears to require Chinese as the operating language for users, but it does not provide any opt-in, alternative language option, or explanation that the skill is intended only for a Chinese-language audience. Under the policy, forcing a specific language without user choice is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The title and opening description define the skill's user-visible output entirely in Chinese, establishing a fixed language/locale for responses. The file does not mention offering users a language choice or obtaining opt-in, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

delete-review 会直接删除单条成长档案记录,但 unlike append、update-review 和 delete-profile,这里没有单独的确认开关或二次确认机制。对这类涉及未成年人教育记录的持久化数据,误触发、脚本调用错误或上层代理参数注入都可能造成不可逆的数据丢失,虽然不属于远程代码执行,但属于真实的完整性与可用性风险。

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 · LICENSE.txt (reported line 7)May include surrounding context.

text
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.

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, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

L50 规定“标题简短,段落适合中文 Agent 平台直接渲染”,体现出面向中文输出的固定语言/locale 约束,但文档未说明这是用户可选项,也未明确该限制是出于地区性或平台合规要求。按规则,这属于自然语言层面的语言/locale policy 风险。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file contains user-facing instructional content only in Chinese, and there is no indication that users may choose another language or that the Chinese-only presentation is a justified locale constraint. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

文件顶层文档字符串及整体用户可见说明均以中文固定表述“家长版小学作文成长档案管理脚本”,未体现用户可选择语言或这是受限于特定中文场景的明确政策说明。按规则,强制特定语言而无用户选择可能构成语言/locale 策略问题。

Content

No source excerpt is available for this finding.