Back to skill

Security audit

Report Builder

Security checks for vulnerabilities and agentic risk

Overview

The skill is a mostly coherent executive-briefing helper, but some local file-writing scripts are under-scoped and can write outside the intended report area or overwrite chosen files without enough guardrails.

Install only if you are comfortable with a Chinese-first report workflow that runs local Python scripts. Use explicit safe report names, avoid path separators or absolute paths, run dry-run modes where available, and review any script command before allowing it to create or modify report files.

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/init.py:28
Finding

Path Traversal Through an Unvalidated Report Name

Content
View full analysis

Vulnerability Details

File Location: scripts/init.py:28-37
Vulnerability Type: Path traversal and unrestricted directory creation
Risk Level: Medium

Vulnerable Code

python
p.add_argument('--dir', '-d', default='reports', help='Output root directory')
args = p.parse_args()

# Create directories
report_dir = Path(args.dir) / args.name
if report_dir.exists():
    print(f'Error: directory already exists: {report_dir}', file=sys.stderr)
    sys.exit(1)
report_dir.mkdir(parents=True)
(report_dir / 'appendix').mkdir()

The displayed English comments and help text are translations of the original strings; the executable path-handling logic is unchanged.

Technical Analysis

The report name supplied through args.name is appended directly to the output root and treated as a filesystem path. The implementation does not reject:

  • Absolute paths
  • Parent-directory components such as ..
  • Path separators
  • Other values that resolve outside the configured output root

In pathlib, joining a base path with an absolute path discards the base path. Relative names containing parent-directory components can similarly escape the intended reports/ directory after path resolution.

The script then calls mkdir(parents=True) before validating that the resulting path remains below the output root. Consequently, an attacker-controlled report name can cause directory trees, including an appendix subdirectory, to be created at unintended locations accessible to the executing account.

This behavior also conflicts with references/edge-cases.md:9, which states that report names containing special characters are converted into safe filenames. No such filtering is implemented.

Attack Path

  1. An attacker supplies or influences the report name processed by an Agent.
  2. The Agent invokes scripts/init.py using that untrusted name.
  3. The attacker uses an absolute path or traversal components such as ../../target.
  4. The expression `Path(arg ...[truncated 1008 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require the report name to be a single filename component:

    • Reject absolute paths.
    • Reject . and ...
    • Reject /, \, and platform-specific path separators.
    • Apply a conservative allowlist for permitted characters.
  2. Resolve and verify containment before creating directories:

python
output_root = Path(args.dir).expanduser().resolve()
name = args.name.strip()

if (
    not name
    or Path(name).is_absolute()
    or name in {'.', '..'}
    or Path(name).name != name
):
    p.error('Report name must be a single safe path component')

safe_name = re.sub(r'[^A-Za-z0-9._ -]', '_', name).strip()
if not safe_name or safe_name in {'.', '..'}:
    p.error('Report name is invalid after sanitization')

report_dir = (output_root / safe_name).resolve()

try:
    report_dir.relative_to(output_root)
except ValueError:
    p.error('Resolved report directory escapes the output root')

report_dir.mkdir(parents=True, exist_ok=False)
(report_dir / 'appendix').mkdir()
  1. Use the sanitized name consistently for directory names, report filenames, headings, and generated links.

  2. Create the complete scaffold in a temporary directory under the validated output root and rename it atomically after all files have been generated. This avoids leaving partial directories when later operations fail.

  3. Add regression tests covering absolute paths, ../ traversal, nested separators, empty names, platform-specific separators, and valid Unicode report names.

  4. Update references/edge-cases.md so its documented sanitization behavior exactly matches the implementation.

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the packaged behavior lacks any actual briefing-generation pipeline and instead performs document maintenance operations, the skill is effectively misrepresented. Misrepresentation around file-modifying behavior increases the chance of unintended content corruption or unauthorized edits because operators do not consent to that activity when invoking a summarization skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

If the packaged behavior lacks any actual briefing-generation pipeline and instead performs document maintenance operations, the skill is effectively misrepresented. Misrepresentation around file-modifying behavior increases the chance of unintended content corruption or unauthorized edits because operators do not consent to that activity when invoking a summarization skill.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
79% confidence
Finding

The skill advertises scripted tooling that can read and write files, but it does not declare any explicit tool scope such as allowed-tools or permissions. That makes the effective capability boundary ambiguous and can permit broader file operations than users or the platform expect. In this context, the risk is elevated because the skill promotes automation over report files and versioned content, so silent file mutation is plausible.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Overly broad triggers can cause the skill to activate on ordinary language that was not intended to request this workflow. In a skill with file-processing and transformation behavior, unintended invocation increases the risk of unplanned document changes, data handling, or chaining into downstream tools.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The workflow allows report-builder to be triggered 'automatically or manually' after another skill completes, but it does not define authorization, validation, or scope boundaries for when that handoff is allowed. In a multi-skill agent environment, vague trigger rules can cause unintended processing of unreviewed files, chaining into downstream tools, and expanding the blast radius of prompt- or data-driven abuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill document is written as a Chinese-only operational policy, and line L29 explicitly treats English as an edge case rather than offering a language choice. Under the policy rule, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document title and all instructional content are presented only in Chinese, which effectively imposes a specific language on users without any opt-in or alternative. Under the policy rule, forcing a specific language or locale without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The document is entirely framed as Chinese-language reporting guidance, including required output labels and examples, with no indication that users may opt into another language or locale. Under the policy rule for natural-language violations, a skill that effectively forces a specific language without user opt-in should be flagged.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The heading "中文写作规范" presents a prescriptive language requirement in natural language, and the document overall is framed as a general style guide rather than a clearly region-specific tool. Because no opt-in, alternative language path, or justification for a Chinese-only requirement is provided, this can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a report-building skill for compressing long proposals into executive one-pagers using briefing templates and validation workflows. This script instead performs project/repository maintenance tasks: bumping semantic versions, copying markdown files, and updating VERSION.md, README.md, and version.json, which are not necessary capabilities for producing executive summaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing natural-language text entirely in Chinese in the module docstring and later CLI messages, but it does not provide any opt-in, selection, or justification for enforcing that locale. The policy explicitly calls for flagging language or locale constraints when a specific language is forced without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring, argparse descriptions, comments, generated markdown content, and console output are all written in Chinese, which imposes a specific language on users. The file does not offer opt-in language selection or explain that the skill is intentionally region- or locale-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This is a code file, so SQP-2 applies to safety-relevant file writes. The script performs an in-place write to the user-supplied path with no confirmation prompt and no pre-write warning in comments or docstrings that the original file will be modified, while the only user-facing notice appears after the overwrite has already occurred.

Content

No source excerpt is available for this finding.

Tainted flow: 'new_text' from pathlib.Path.read_text (line 76, file read) → pathlib.Path.write_text (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/renumber.py (reported line 80)May include surrounding context.

python
if args.dry_run:
        print(new_text)
    else:
        path.write_text(new_text, encoding='utf-8')
        print(f'已更新:{args.file}')

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing documentation and CLI/help text entirely in Chinese, including the module docstring and usage examples. Under the policy, forcing a specific language without offering a user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The argparse description, error output, and success message are all hard-coded in Chinese. This imposes a locale requirement on users without any opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown template is written entirely in Chinese and presents all section headings and fixed text in that language, which imposes a specific language/locale on users. The file does not offer an opt-in, alternative language choice, or a documented region-specific justification for the locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The entire template is written in Chinese, including headings, field labels, and boilerplate text, with no indication that users may choose another language. This creates a natural-language locale constraint that appears mandatory rather than optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This markdown template is entirely written in Chinese and provides no indication that the language is optional or configurable. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown template is entirely written in Chinese, including headings, instructions, and placeholders, which implicitly constrains the skill output to a specific language. The provided rules treat forced language or locale behavior without user choice or justification as a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The markdown content is written entirely in Chinese, including the title and section headings, with no indication that the language choice is optional or justified by a region-specific purpose. This can violate language/locale policy because it imposes a specific language on users without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language content in the change log is written in Chinese throughout, and the file provides no indication that this skill is region-specific or that users can choose another language. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest frames the skill as a one-page executive briefing generator with local scripts and templates for summarization and validation. However, the declared dependencies include digital research, solution architecture, and PlantUML generation, which suggest broader capabilities than compressing input materials into executive summaries and are not reflected in the stated purpose.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
74% confidence
Finding

The trigger term '简报' is very generic and can match many unrelated user requests, making accidental invocation more likely. While not severe alone, it becomes security-relevant because the skill advertises scripts and file-oriented workflows that may perform modifications once invoked.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The metadata declares a fixed language setting of "zh,en", which imposes a locale/language constraint in the skill definition. The file does not clearly state that users can choose their preferred language at runtime or justify this as a region-specific requirement, so it may conflict with language-choice policy expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.