Back to skill

Security audit

Banker Slides Pptx

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent PowerPoint generator, but its renderer runs generated JavaScript and performs a mutable npm install in ways that create real local code-execution risk.

Review before installing. Use only trusted ticker/name inputs, run it in a constrained workspace, and avoid exposing credentials or unrelated files while rendering. Prefer fixing the renderer to validate ts_code, serialize JavaScript values with json.dumps, pin dependencies with a reviewed lockfile, and avoid automatic npm install during normal use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/build_outline_deck_v2.py:642
Finding
JavaScript Code Injection Through Unsanitized Ticker Input<![CDATA[ ## Vulnerability Details **File Location**: `scripts/build_outline_deck_v2.py`, lines 642-668 **Vulnerability Type**: JavaScript code injection through unsafe source-template substitution **Risk Level**: High ### Vulnerable Code ```python output_pptx = f"{ts_code.replace('.', '_').lower()}_banker_deck.pptx" template = (template .replace("const SLIDE_COUNT = 20;", f"const SLIDE_COUNT = {len(slides)};") .replace("'presentation.pptx'", f"'{output_pptx}'") .replace("'2B2D42'", f"'{THEME['primary']}'") .replace("'8D99AE'", f"'{THEME['secondary']}'") .replace("'EF233C'", f"'{THEME['accent']}'") .replace("'EDF2F4'", f"'{THEME['light']}'") .replace("'FFFFFF'", f"'{THEME['bg']}'")) (slides_dir / "compile.js").write_text(template, encoding="utf-8") ``` The generated JavaScript is subsequently executed: ```python r = subprocess.run(["node", "compile.js"], cwd=str(slides_dir), capture_output=True, text=True, timeout=300) sys.stdout.write(r.stdout) sys.stderr.write(r.stderr) if r.returncode != 0: sys.exit(f"compile failed rc={r.returncode}") ``` ### Technical Analysis The `ts_code` command-line argument is incorporated into `output_pptx` and then inserted directly into a single-quoted JavaScript string through textual replacement. The value is not restricted to valid ticker characters and is not escaped as a JavaScript string literal. Although `subprocess.run()` uses an argument array and therefore does not introduce shell injection by itself, that protection does not prevent source-code injection. A quote in `ts_code` can terminate the intended JavaScript string, after which attacker-controlled JavaScript statements can be inserted into the generated `compile.js`. The generated file is executed with Node.js under the privileges of the user running the Skill. This turns control of the ticker argument into an arbitrary local code-execution primitive. A conceptual malicious ticker can be structured as follow ...[truncated 1815 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce a strict allowlist for ticker values before using them: ```python if not re.fullmatch(r"[A-Za-z0-9._-]+", ts_code): sys.exit("invalid ts_code: only letters, digits, dots, underscores, and hyphens are allowed") ``` 2. Serialize all values inserted into JavaScript with `json.dumps()` rather than manually adding quotes: ```python output_literal = json.dumps(output_pptx, ensure_ascii=False) template = template.replace("'presentation.pptx'", output_literal) ``` 3. Avoid textual source-code substitution for runtime data. Prefer passing the output filename through a JSON configuration file, environment variable, or a fixed command-line argument read by trusted static JavaScript. 4. Validate the final output filename independently: - Reject path separators. - Reject control characters. - Resolve the destination and verify that it remains inside the intended deliverable directory. 5. Add regression tests using quotes, semicolons, newlines, backslashes, Unicode control characters, and path traversal sequences. Confirm that none can alter generated JavaScript syntax. 6. Run deck compilation in a restricted environment with minimal filesystem and network access to reduce impact if another generation flaw is introduced. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/build_outline_deck_v2.py:655
Finding
Unpinned Runtime npm Installation Creates a Supply-Chain Execution Risk<![CDATA[ ## Vulnerability Details **File Location**: `scripts/build_outline_deck_v2.py`, lines 655-664 **Vulnerability Type**: Mutable third-party dependency installation during normal execution **Risk Level**: Medium ### Vulnerable Code ```python (slides_dir / "package.json").write_text(json.dumps({ "name": f"{ts_code.lower().replace('.', '-')}-banker-deck-v2", "version": "0.0.1", "private": True, "dependencies": {"pptxgenjs": "^3.12.0"}, }, indent=2)) if not (slides_dir / "node_modules" / "pptxgenjs").exists(): r = subprocess.run(["npm", "install", "--omit=dev", "--silent"], cwd=str(slides_dir), capture_output=True, text=True, timeout=180) if r.returncode != 0: sys.exit(f"npm install failed: {r.stderr[:500]}") ``` ### Technical Analysis The renderer automatically invokes npm when `pptxgenjs` is absent. The dependency uses the caret range `^3.12.0`, which permits npm to select later compatible releases rather than the exact version that was reviewed. The generated project does not use a committed, reviewed lockfile or explicit integrity metadata. Consequently, the dependency graph can change over time and between environments. The command also does not disable package lifecycle scripts. npm dependencies and transitive dependencies may therefore execute installation scripts with the privileges of the user running the Skill. This behavior creates a mutable code-execution boundary: code retrieved during a future run may differ from the code present at audit time. The audit found no evidence that `pptxgenjs` is currently malicious; the risk arises from unsafe dependency acquisition and execution practices. ### Attack Path 1. The `slides/node_modules/pptxgenjs` directory is absent, as it would be on a clean system or newly generated deliverable. 2. The renderer writes a package manifest containing the mutable version range `^3.12.0`. 3. It invokes `npm install` against the user's con ...[truncated 1170 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `pptxgenjs` and all transitive dependencies through a reviewed `package-lock.json`. Use an exact direct dependency version rather than a caret range: ```json "dependencies": { "pptxgenjs": "3.12.0" } ``` 2. Use reproducible installation: ```text npm ci --omit=dev --ignore-scripts ``` Confirm first that the required dependency operates correctly without lifecycle scripts. 3. Do not generate a fresh dependency manifest and resolve packages during every rendering workflow. Bundle an audited dependency set or require dependencies to be installed in a separate, explicit setup phase. 4. Verify package-lock integrity metadata and retain the reviewed lockfile with the Skill. 5. Restrict npm to an approved registry and protect registry configuration from untrusted environment or project-level overrides. 6. Perform dependency vulnerability and provenance checks in CI, including review of package ownership changes, unexpected lifecycle scripts, and transitive dependency updates. 7. Run installation and compilation in a sandbox or container with: - No access to credentials or unrelated files. - A read-only filesystem except for the output directory. - Network access disabled after dependencies are obtained. - A non-privileged user account. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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 (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The code does produce an investment-banker-style PowerPoint with real tables, bar/line charts, risk heatmaps, scenario tables, callout boxes, dividers, and cover slides, so the output type broadly matches the description. However, its primary behavior is not to turn analysis.md and data-provenance.md directly into a .pptx. Instead, it requires an existing slides-outline.md and explicitly exits if that outline is missing, indicating this script renders a deck from a structured intermediate representation rather than from the declared memo/provenance inputs. That is a material description-behavior mismatch in the skill's stated purpose. The npm install and Node compile steps are implementation details that support rendering, but the input-source discrepancy is significant enough to flag.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description says the skill turns memo inputs into a banker-quality PowerPoint deck. The supplied code chunk only prepares a prompt for another agent/process by reading a template, inserting metadata, checking prerequisite files, and embedding markdown content inline. While this may support a later .pptx-generation step, the code shown does not itself perform the described slide-generation behavior. That is a material description-versus-behavior mismatch rather than a minor implementation detail.

Ae1

High
Category
analysis-evasion
Content
python3 scripts/build_outline_deck_v2.py <deliverable> <ts_code> <name_cn> <name_en>
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding
The skill documents file reads, file writes, and shell execution in its workflow, but it does not declare any explicit tool scope or permissions boundaries. In an agent environment, this increases the chance of over-broad tool access, accidental command execution, or misuse of filesystem operations beyond what the task strictly requires.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The schema and examples hard-code fields such as `Chinese-subtitle`, `Chinese-title`, and extensive Chinese-language content, indicating the skill expects Chinese output formatting. The file does not state that this is optional, user-selected, or justified as a region-specific skill, which can violate language/locale policy requiring user opt-in or documented rationale.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The instructions require all Chinese text to be written as UTF-8 literals and prescribe a Chinese/English title structure, which imposes a specific language/locale behavior. There is no user opt-in or documented justification that this skill is intentionally restricted to a Chinese-language workflow.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This script embeds natural-language requirements such as a 'big Chinese + English subtitle section divider' and a 'Rule-3 compliant cover' with fixed English and Chinese typography rules. Similar hard-coded Chinese labels and text are used throughout the renderers, which forces a specific bilingual locale behavior rather than offering a user choice or documenting why this locale constraint is required.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The script creates the slides directory, deletes existing matching files with old.unlink(), and writes new slide JavaScript files, but there is no confirmation prompt or explicit warning that existing generated content will be removed. The file-level docstring describes rendering behavior, but does not disclose this overwrite/delete behavior to the user.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The skill crosses from local file transformation into external package installation and execution of Node-based compilation, materially expanding the trust boundary. In the context of an agent skill, this is more dangerous because untrusted or semi-trusted workspace content is used to generate JavaScript that is then executed, creating an avenue for arbitrary code execution if the template or generated artifacts are influenced upstream.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
}, indent=2))

    if not (slides_dir / "node_modules" / "pptxgenjs").exists():
        r = subprocess.run(["npm", "install", "--omit=dev", "--silent"],
                           cwd=str(slides_dir), capture_output=True,
                           text=True, timeout=180)
        if r.returncode != 0:
Confidence
88% confidence
Finding
The script performs npm install at runtime inside a generated working directory, which introduces a supply-chain and code-execution boundary not inherent to simple document rendering. Even though the package name is pinned in package.json and shell injection is not present, npm lifecycle behavior and dependency resolution can execute third-party code during installation, making this dangerous in higher-trust environments.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
if r.returncode != 0:
            sys.exit(f"npm install failed: {r.stderr[:500]}")

    r = subprocess.run(["node", "compile.js"], cwd=str(slides_dir),
                       capture_output=True, text=True, timeout=300)
    sys.stdout.write(r.stdout)
    sys.stderr.write(r.stderr)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Missing User Warnings

Low
Confidence
83% confidence
Finding
This markdown file instructs the agent to write `slides-outline.md` in the deliverable directory and then render a `.pptx` and run validation scripts, which are file-producing operations. The documentation does not include any warning that existing output files in the deliverable directory may be created or overwritten, so users are not explicitly alerted to potentially data-affecting behavior.

Missing User Warnings

Low
Confidence
82% confidence
Finding
This markdown prompt instructs the skill to write a complete outline to `{deliverable_dir}/slides-outline.md` and then report only the path and counts, but it does not explicitly warn the user that a file will be created or overwritten. Because markdown files should disclose behaviors that affect user data or the filesystem, this is a missing warning.

Static analysis

No suspicious patterns detected.