Back to skill

Security audit

jp-report

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Japanese report generator, with a real but purpose-related PDF-rendering risk users should understand.

Install this only if you want source material transformed into formal Japanese corporate HTML/PDF reports. Avoid feeding untrusted HTML or attacker-supplied markup, and consider disabling network access or hardening the PDF script before using it on sensitive systems.

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/generate_pdf.py:26
Finding

Untrusted HTML Is Rendered with Active Browser Capabilities and No Execution Timeout

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_pdf.py, lines 26–33
Vulnerability Type: Unsafe processing of potentially untrusted active HTML
Risk Level: Medium

Vulnerable Code

python
subprocess.run([
    CHROME,
    "--headless",
    "--disable-gpu",
    f"--print-to-pdf={pdf}",
    "--no-pdf-header-footer",
    url,
], check=True, capture_output=True)

Technical Analysis

The PDF generator opens the supplied HTML file in a full headless Chrome process without disabling JavaScript, blocking network access, applying a restrictive Content Security Policy, or imposing an execution timeout.

Although the command is constructed as an argument array and is therefore not directly vulnerable to shell command injection, HTML is active content. A crafted document can contain JavaScript, remote resource references, automatic navigation, or requests to services reachable from the machine running the skill.

The skill workflow in SKILL.md instructs the agent to generate HTML from user-provided source material and immediately pass that HTML to this script. If attacker-controlled markup is preserved or inserted into the generated document, the active content executes when Chrome renders the PDF.

The absence of a timeout also allows hostile HTML to consume CPU or keep the renderer occupied indefinitely through expensive scripts, pathological layouts, repeated navigation, or continuously loading resources.

Attack Path

  1. An attacker supplies a crafted HTML file directly to generate_pdf.py, or provides source material designed to cause active markup to appear in the generated report.
  2. The skill invokes generate_pdf.py as required by its standard workflow.
  3. The script converts the local path to a file:// URL and opens it in headless Chrome.
  4. Chrome executes embedded JavaScript and attempts attacker-selected network requests using the host's network connectivity.
  5. The ...[truncated 1566 chars]
Remediation
View remediation

Remediation Suggestions

  1. Sanitize generated HTML before rendering

    • Parse output with an allowlist-based HTML sanitizer.
    • Remove script, iframe, object, embed, form, and active metadata elements.
    • Remove event-handler attributes such as onclick and onerror.
    • Reject javascript: URLs and unnecessary remote resource references.
  2. Disable JavaScript

    • Render through a dedicated Chrome profile configured with JavaScript disabled.
    • Alternatively, use a renderer designed for static HTML-to-PDF conversion that does not execute scripts.
  3. Block network access during conversion

    • Run Chrome in a container or sandbox namespace with no outbound network connectivity.
    • Deny loopback, link-local, private, and metadata-service address ranges.
    • Ensure the report is fully self-contained before rendering.
  4. Apply a restrictive Content Security Policy

    • Inject a policy equivalent to default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data: where document requirements permit.
    • Do not rely on CSP as the only control; combine it with sanitization and network isolation.
  5. Add resource and time limits

    • Pass a finite timeout to subprocess.run.
    • Catch subprocess.TimeoutExpired, terminate the Chrome process tree, remove incomplete output, and return a controlled error.
    • Enforce memory and CPU limits through an operating-system sandbox or container.
  6. Validate inputs

    • Require a regular file with an approved extension.
    • Restrict input and output paths to explicitly authorized directories when the script is invoked by the skill.
    • Reject symbolic links where they are not required.
  7. Use an isolated temporary browser profile

    • Start Chrome with a newly created, permission-restricted profile directory.
    • Delete that profile after conversion.
    • Do not reuse the operator's normal browser p ...[truncated 40 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README states that the skill generates formal Japanese corporate documents from source material in any language, which imposes a specific output language by default. Under the policy, forcing a language or locale without user opt-in is a natural-language policy violation unless explicitly justified or optional.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrase set is broad enough to activate on common requests like creating a report, compliance document, or security overview, which can cause unintended skill selection. In context, this is not direct code execution, but it can override user expectations and route ordinary tasks into a workflow that forces a specific document style, reads local source paths, and attempts file/PDF generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill mandates Japanese formal output by default without requiring user confirmation, which can cause unauthorized transformation of content into a different language and format than requested. In this skill's context, that risk is amplified by automatic downstream document generation, because a loosely matched request could lead to unintended translation, formatting changes, and artifact creation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file repeatedly instructs authors to write content in Japanese keigo, and this line explicitly requires an introductory sentence in keigo. That is a natural-language locale/style constraint presented as mandatory, with no indication of user choice or documented justification for restricting output language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This instruction requires explanation text in keigo, enforcing a specific language/register policy in the template. Because the file does not offer a language or locale choice or explain why Japanese-only output is required, it conflicts with the policy guidance on forced language constraints.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

These example rows instruct descriptions to be written in keigo, again imposing a specific language/register requirement. The file provides no user opt-in or documented justification for this language restriction, so it should be treated as a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The notice template specifies explanation text in keigo, which forces a particular language/register rather than allowing user preference. No opt-in or clear regional justification is provided in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This line mandates that bullet items be written in keigo, which is a specific language/register constraint. Because the template does not offer alternatives or explain a justified locale restriction, it constitutes a natural-language policy issue.

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 · scripts/generate_pdf.py (reported line 26)May include surrounding context.

python
pdf = html.with_suffix(".pdf")
    url = "file://" + quote(str(html))

    subprocess.run([
        CHROME,
        "--headless",
        "--disable-gpu",

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The typography section explicitly prescribes Japanese-specific fonts and labels them as the required style for the document. Because the file is a general design-rules document rather than a clearly justified region-specific compliance artifact, this reads as a locale-specific requirement without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The HTML root explicitly sets lang="ja", and the entire report content is presented only in Japanese. Under the policy rule, forcing a specific language without user opt-in can be a locale-policy violation, and this file does not offer any language choice or explain a justified region-specific restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.