Back to skill

Security audit

Appendix Table Writer

Security checks for vulnerabilities and agentic risk

Overview

The appendix table writer mostly does the stated table-generation job, but it is bundled with broader workflow tooling and has an output-path flaw that can write outside the selected workspace.

Review before installing in a shared or sensitive workspace. The normal appendix-table path is local and offline, but operators should restrict writes to the intended workspace outputs, avoid passing custom `--outputs` paths, and consider removing or separately reviewing the bundled pipeline/executor/ideation tooling if only the appendix-table writer is needed.

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/run.py:174
Finding

Unrestricted Output Paths Permit Writes Outside the Workspace

Content
View full analysis

Vulnerability Details

File Location: scripts/run.py, lines 174–183; write operations at lines 288 and 307
Vulnerability Type: Path traversal and arbitrary file overwrite
Risk Level: Medium

Vulnerable Code

python
outputs = parse_semicolon_list(args.outputs) or ["outline/tables_appendix.md", "output/TABLES_APPENDIX_REPORT.md"]
out_rel = next((x for x in outputs if x.endswith("tables_appendix.md")), "outline/tables_appendix.md")
report_rel = next((x for x in outputs if x.endswith("TABLES_APPENDIX_REPORT.md")), "output/TABLES_APPENDIX_REPORT.md")
out_path = workspace / out_rel
report_path = workspace / report_rel
ensure_dir(out_path.parent)
ensure_dir(report_path.parent)

The resulting paths are later used as write destinations:

python
atomic_write_text(out_path, text)
python
atomic_write_text(report_path, "\n".join(rep_lines).rstrip() + "\n")

Technical Analysis

The --outputs command-line argument is externally controlled and parsed into destination path strings. The code joins those strings to workspace without rejecting absolute paths, resolving traversal components, or verifying that the resulting destinations remain inside the workspace.

In Python, joining a Path with an absolute operand discards the preceding workspace path. Relative values containing ../ can likewise traverse outside the workspace. The suffix checks only require paths to end with tables_appendix.md or TABLES_APPENDIX_REPORT.md; they do not provide filesystem containment.

The destinations are passed to atomic_write_text, which creates the parent directory when possible and atomically replaces the target. Consequently, a caller who can control the command-line arguments can overwrite files in any location writable by the process. This exceeds the Skill's declared need to write only outline/tables_appendix.md and output/TABLES_APPENDIX_REPORT.md within the selected workspace.

Attack Path

  1. The attacker invokes the S ...[truncated 1583 chars]
Remediation
View remediation

Remediation Suggestions

Constrain every output destination to the resolved workspace before creating directories or writing files:

python
workspace = Path(args.workspace).resolve()

def resolve_workspace_output(rel: str) -> Path:
    supplied = Path(rel)
    if supplied.is_absolute():
        raise ValueError(f"Absolute output paths are not allowed: {rel}")

    candidate = (workspace / supplied).resolve()
    try:
        candidate.relative_to(workspace)
    except ValueError as exc:
        raise ValueError(f"Output path escapes the workspace: {rel}") from exc

    return candidate

out_path = resolve_workspace_output(out_rel)
report_path = resolve_workspace_output(report_rel)

Additional hardening should include:

  1. Prefer a strict allowlist containing only:
    • outline/tables_appendix.md
    • output/TABLES_APPENDIX_REPORT.md
  2. Reject empty paths, absolute paths, and any path containing traversal components before filesystem access.
  3. Perform containment validation before calling ensure_dir.
  4. Consider rejecting symlinked destination parents or verifying the resolved parent again immediately before replacement where hostile users can modify the workspace concurrently.
  5. Add tests for:
    • ../ traversal.
    • Nested traversal.
    • Absolute Unix and Windows paths.
    • Symlink-based workspace escape.
    • Valid workspace-relative output paths.
  6. Apply the same containment validation to output paths accepted by the bundled executor and quality-gate interfaces.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (37)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is narrowly about producing polished appendix survey tables from in-scope evidence and citation keys. The supplied code does not implement table curation logic for appendix survey outputs. Instead, it is a general-purpose support module for repository/workspace operations: atomic writes, backups, TSV/JSONL/YAML I/O, status logging, decisions approval workflows, query templating, pipeline configuration lookup, and keyword extraction. While some helpers could support a larger pipeline, this chunk’s actual primary behavior is generic workflow and data-management infrastructure, not reader-facing survey table generation. There is also no visible implementation of the stated skip condition, citation-key restriction, or appendix-table formatting guardrails. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is for a content-generation skill focused on creating polished appendix survey tables from in-scope evidence and citation keys. The supplied code does not generate or curate tables, process citations, enforce table layout/content guardrails, or operate specifically on appendix artifacts. Instead, it is a general-purpose pipeline executor/orchestrator that runs units, manages dependencies and approvals, invokes scripts, checks outputs, updates workflow status, and logs errors. This is a materially different primary purpose with several undeclared operational capabilities, so the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is narrowly about producing polished reader-facing appendix survey tables from existing C4 artifacts and citation keys. The supplied code does something materially different: it is an ideation/brainstorming module for generating, structuring, ranking, and reporting research directions. It defines dataclasses like IdeaSignal, DirectionCard, and ScreenedDirection; parses an idea brief and pipeline contract; maps notes to thematic clusters; synthesizes tensions, missing pieces, confounds, first probes, and kill criteria; scores candidate directions; and renders markdown for idea signal tables, direction pools, screening tables, shortlist memos, reports, and appendices. Although it does generate some markdown tables, those tables are for internal ideation artifacts, not appendix survey tables with existing citation keys. This is a clear primary-purpose mismatch, not just an implementation-detail difference.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about curating reader-facing appendix survey tables from existing research artifacts, with formatting/content guardrails and no external resources. The supplied code does not generate tables, format appendix content, work with citations, or process evidence packs. Instead, it is a configuration loader/validator for pipeline specs: it reads files, parses YAML front matter, resolves variant references, merges inherited configs, validates fields, and constructs PipelineSpec/PipelineStage objects. This is a materially different primary purpose and includes undeclared file-based configuration parsing capabilities unrelated to survey-table curation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared skill is narrowly about creating polished appendix survey tables from C4 artifacts with specific guardrails and skip conditions. The supplied code does not implement table curation or appendix-table generation behavior. Instead, it is a collection of reusable pipeline text helpers for parsing outlines, markdown, JSONL, and BibTeX keys, plus formatting citations and excerpts. These are supporting utility functions at best, but the chunk lacks the primary promised behavior: no creation of survey tables, no handling of outline/tables_appendix.md, no check for refined existing tables, no enforcement of table-layout guardrails, and no direct transformation of evidence packs into publishable appendix tables. This is therefore a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description is narrowly about generating/refining appendix survey tables with specific stylistic and evidence-use guardrails. The supplied code does not curate tables as its primary function. Instead, it is a large validation/auditing framework for many skills in a document-production pipeline. It parses configuration from queries.md, checks artifact existence and schema, enforces coverage and quality thresholds, validates citations and drafts, and writes quality-gate reports. Although there is a dispatch entry mentioning appendix-table-writer, that is only one small routed case inside a much broader quality-gate system. This is a materially different primary purpose and a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is narrowly about generating/curating reader-facing appendix survey tables from existing evidence and citation keys. The supplied code does not perform table curation or layout generation as its primary behavior. Instead, it is part of a large quality-gating/validation system that reads many files from the workspace and emits quality issues for missing files, placeholders, structural incompleteness, citation hygiene, section prose quality, report PASS statuses, and other pipeline constraints. While one small function specifically checks outline/tables_appendix.md, that is only a minor subset of the code. The dominant behavior is a broad artifact validator for the entire writing pipeline, which is materially different from the declared appendix-table curation purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description says this skill curates reader-facing appendix survey tables with no network and strict content guardrails. The supplied code does not generate or refine tables. Instead, it is a general quality-gate module that audits draft text structure, citation practices, repeated template text, required sections, polishing drift, global review completeness, protocol/tutorial spec presence, LaTeX scaffold correctness, compile warnings, PDF length/placeholders, and contract report status. These are materially different primary purposes and capabilities. While both relate loosely to survey-writing workflows, the actual code is a broad manuscript/pipeline validator, not an appendix-table curator.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `python scripts/run.py --help`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `python scripts/run.py --help`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `python scripts/run.py --help`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `python scripts/run.py --help`

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file implements orchestration features—workflow state changes, approvals, rerouting, dependency handling, and quality gates—rather than the narrow appendix-table-writing behavior described in the skill metadata. That scope mismatch increases attack surface and makes it easier for a seemingly harmless skill to influence broader pipeline execution, approvals, and artifact state in ways reviewers may not expect.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The executor provides a general capability to run skill scripts via subprocess, which materially exceeds the declared purpose of an appendix-table-writing skill. In a threat model where skill contents and workspace state are treated as adversarial, this creates a powerful execution primitive that can trigger unintended code paths, enabling arbitrary local code execution through pipeline metadata or skill selection.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This section builds speculative signals, direction cards, screening scores, shortlist rankings, and PI/PhD discussion artifacts, none of which are justified by an appendix table writer skill. That is risky because it operationalizes unsanctioned inference and prioritization logic that can steer research decisions while appearing to be part of a constrained formatting skill, increasing the chance of hallucinated synthesis, hidden value judgments, and misuse of evidence beyond the allowed appendix-table task.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file contains functionality to generate research-ideation memos, top-direction rankings, discussion questions, appendix guides, and related report artifacts, which is materially outside the declared skill scope of appendix survey table curation. In an agent setting, this kind of scope drift is dangerous because it can cause the skill to produce speculative, decision-shaping content instead of evidence-bounded appendix tables, undermining user intent and guardrails such as 'no invented facts' and 'use only in-scope evidence and existing citation keys.'

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill declares no explicit tool/permission scope even though the documentation clearly implies file reads, file writes, and shell execution via python scripts/run.py. That creates an unnecessary trust gap: operators cannot tell from the manifest what capabilities the skill may exercise, which weakens policy enforcement and increases the chance of overbroad execution in shared or automated environments.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The pipeline is marked as a default route and uses broad routing hints such as 'survey', 'review', and related multilingual terms, which can cause it to trigger for loosely related requests. That creates a security and safety risk through misrouting: users may be pushed into a large, network-capable, artifact-heavy workflow that performs more actions than intended and may touch external resources or overwrite workspace artifacts unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The routing hints include broad, everyday terms such as 'idea' and 'brainstorm', which can cause this pipeline to be selected for requests that are only loosely related. Misrouting matters here because the pipeline launches a multi-stage literature and memo-generation workflow that can create unintended artifacts, consume resources, and steer the user into an inappropriate task flow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest routing hints include "peer review" and "review report", which are generic phrases that can appear in ordinary user requests across many contexts. Because this is a manifest file, broad invocation phrases can cause unintended routing when the user is asking for general feedback rather than this specific pipeline.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest includes routing_hints: [tutorial, 教程], where both hints are generic nouns that can appear in many ordinary requests. The file does not provide narrowing context, explicit trigger constraints, or negative examples to distinguish when this pipeline should activate versus when a user is merely mentioning tutorials generally.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module includes functions that read and modify decisions logs, approval checklists, and human checkpoint state, which is unrelated to generating appendix survey tables. In this skill context, that is risky because a content-formatting component should not be able to create, alter, or infer approval state; such behavior could bypass human review expectations or silently manipulate process controls in the workspace.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This appendix-table skill advertises a narrow, offline formatting purpose, but the shared utility module also contains logic for query seeding, repository root discovery, pipeline lock resolution, and workspace pipeline-spec loading. That scope expansion is dangerous because it enables the skill to influence broader research workflow behavior and workspace state beyond table generation, increasing attack surface and making hidden side effects harder to audit.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% 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 · tooling/executor.py (reported line 105)May include surrounding context.

python
workspace: Path,
    repo_root: Path,
    strict: bool = False,
    auto_approve: set[str] | None = None,
) -> RunResult:
    units_path = workspace / "UNITS.csv"
    status_path = workspace / "STATUS.md"

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% 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 · tooling/executor.py (reported line 126)May include surrounding context.

python
workspace: Path,
    repo_root: Path,
    strict: bool = False,
    auto_approve: set[str] | None = None,
) -> RunResult:
    units_path = workspace / "UNITS.csv"
    status_path = workspace / "STATUS.md"

Static analysis

No suspicious patterns detected.