Back to skill

Security audit

Restaurant Business Analyst

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent restaurant business analysis skill that searches public information and creates a local HTML report, with some file and HTML safety precautions users should keep in mind.

Before installing, expect the skill to perform web searches, create an HTML report in your Downloads folder, and open it locally. Use normal restaurant brand names rather than path-like input, and for untrusted inputs ask the agent to sanitize the filename, escape dynamic HTML content, and validate links before opening or sharing the report.

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
SKILL.md:84
Finding

Unsanitized Dynamic Values Used in Report Paths and Active HTML

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:84-92, references/report_template.md:72-87, and references/report_template.md:411-425
Vulnerability Type: Path traversal and stored HTML injection caused by missing input validation and contextual output encoding
Risk Level: Medium

Vulnerable Code

SKILL.md:84-92:

markdown
Output path: `~/Downloads/[brand_name]_restaurant_business_model_report_[YYYYMMDD].html`

HTML specification: background `#faf8f5`, accent color `#c0392b`, PingFang SC font, centered with a maximum width of 900px, and card-based layout.
Every core number must include a confidence rating (★★★ confirmed / ★★ inferred / ★ estimated), following Section 10 of `references/analytics_methodology.md`.
Include `@media print` styles and a "📄 Export PDF" button.

Disclaimer: This report is based on publicly available information, is provided for reference only, and does not constitute investment advice.

---

## Phase 5: Output and Display

1. Save and open the HTML using `open`

The original file contains the equivalent instructions in Chinese. The security-relevant behavior is the direct interpolation of [brand_name] into the output path followed by automatic opening of the generated file.

references/report_template.md:72-87:

html
<div class="report-container">
  <!-- Cover card: brand name, category, store scale, report date -->
  <div class="cover-card">...</div>

  <!-- Five main sections, each in an independent card -->
  <div class="section-card" id="part1">Strategy</div>
  <div class="section-card" id="part2">Tactics</div>
  <div class="section-card" id="part3">Metrics</div>
  <div class="section-card" id="part4">Restaurant Operations</div>
  <div class="section-card" id="part5">Extended Analysis</div>

  <!-- Overall assessment -->
  <div class="summa
...[truncated 4427 chars]
Remediation
View remediation

Remediation Suggestions

  1. Normalize the filename

    • Permit only a conservative allowlist such as letters, numbers, spaces, underscores, and hyphens.
    • Replace all other characters with _.
    • Remove /, \, .., leading dots, control characters, shell metacharacters, and platform-specific reserved names.
    • Enforce a reasonable maximum filename length.
  2. Verify path containment

    • Resolve the Downloads directory and proposed output path to canonical absolute paths.
    • Confirm that the final path is a child of the resolved Downloads directory.
    • Reject generation if containment validation fails.
  3. Use safe file creation

    • Generate a unique filename rather than silently overwriting existing reports.
    • Use exclusive or atomic file creation where supported.
    • Avoid following symbolic links when creating the output file.
  4. Encode every dynamic HTML value

    • HTML-escape brand names, news titles, summaries, source names, metrics, and other retrieved text.
    • Apply encoding appropriate to the destination context: text nodes, attributes, URLs, CSS, or JavaScript.
    • Do not copy raw markup from search results into the report.
  5. Validate links

    • Permit only explicitly supported schemes, preferably https:.
    • Reject javascript:, data:, file:, and other unexpected schemes.
    • Add rel="noopener noreferrer" to external links opened in a new browsing context.
  6. Reduce active-content exposure

    • Replace the inline onclick handler with a static script loaded under a restrictive Content Security Policy, or omit scripting and instruct users to use the browser print command.
    • Add a Content Security Policy that blocks remote scripts, plugins, framing, and unexpected network destinations.
    • Avoid automatically opening the report until validation and generation have completed successfully.
  7. Treat web results as untrusted

    • Ext ...[truncated 250 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (9)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The README describes the skill in Chinese-only terms without indicating that output language is selectable or based on user preference, which can override expected agent behavior and user intent. While not directly enabling code execution or data exfiltration, forced language behavior can degrade transparency, cause misrouting of tasks, and contribute to prompt-level control conflicts in multilingual environments.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger phrases are generic natural-language requests that closely resemble ordinary user prompts, so the skill may activate unexpectedly and take over requests the user did not explicitly intend to route through this workflow. In an agent environment, ambiguous activation boundaries can cause unintended web searches, report generation, or instruction precedence issues, increasing the risk of prompt-scope confusion and misuse.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

该文件是 markdown/manifest 范围内,需检查触发条件。L008-L009 中的“[业态]案例分析”“[品牌]战略分析”等短语语义较泛,且未说明仅限特定入口、上下文或给出负例,容易与一般商业分析请求重叠,导致技能被过度触发。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to write an HTML report to a local path under ~/Downloads and then automatically open it, but this side effect is not clearly disclosed up front or gated by explicit user consent. Undisclosed file creation and auto-opening can surprise users, modify the local system state, and in some environments could expose them to further risk from rendered active content or unsafe local file handling.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file contains natural-language content exclusively in Chinese from title to end, with no indication that the skill is China-specific or that users can opt into this language. Under the language/locale policy, forcing a specific language without user choice can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file title and the entire document content are presented only in Chinese, with no indication that language selection is optional or that the skill is intended exclusively for a Chinese-speaking or region-specific audience. Under the policy, forcing a specific language without user opt-in 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
98% confidence
Finding

This markdown file presents all instructional content in Chinese and does not indicate that users may choose another language or that the skill is restricted to a Chinese-speaking or China-specific audience. Under the policy, forcing a specific language without user opt-in 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
90% confidence
Finding

The document title and the entire template are written in Chinese, indicating the skill is designed to produce output in a fixed language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless a justified locale constraint is documented, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

文件中的描述、触发词、输出格式和交互文案均默认且仅使用中文,未看到允许用户选择其他语言的说明。根据规则,若技能强制特定语言而无用户 opt-in,属于自然语言策略风险。

Content

No source excerpt is available for this finding.