Back to skill

Security audit

臺北市公車定點車機

Security checks for vulnerabilities and agentic risk

Overview

This Taipei bus skill is coherent and mainly uses public transit data, with a few optional examples that users should enable carefully.

Install only if you want Taipei bus lookups that contact public transit APIs. Be cautious with the optional cron examples because they can create recurring agent jobs, and avoid reusing the map HTML generator with untrusted data unless values are safely serialized and escaped.

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

T09 · Insecure Skill Coding Practices

Warning
Location
examples/example-map.js:28
Finding

JavaScript Injection in Generated Map HTML

Content
View full analysis
!routeFilter || b.RouteID === routeFilter) .map(b => `{ id: '${b.BusID}', lat: ${b.lat}, lng: ${b.lng}, route: '${b.RouteID}', status: '${b.CarOnStop === '1' ? '停站' : '行駛中'}', direction: '${b.GoBack === '1' ? '去程' : '返程'}', updated: '${b.DataTime}' }`) .join(',\n'); ``` ### Technical Analysis The function constructs JavaScript object literals by directly interpolating record fields into executable script content. Values such as `BusID`, `RouteID`, and `DataTime` are inserted inside single-quoted JavaScript strings without escaping. The latitude and longitude fields are inserted directly as JavaScript expressions without numeric validation. If a caller supplies an attacker-controlled record, a crafted string can terminate the intended literal and inject arbitrary JavaScript. For example, a malicious identifier containing a quote, object terminator, and script expression could escape the `id` value and execute when the generated HTML is opened. The vulnerability is present even though the included example does not currently invoke `generateMapHTML()` with live records. The function is provided as an implementation framework, so applications that reuse it with untrusted, compromised, or insufficiently validated data inherit the flaw. ### Attack Path 1. An application imports or copies `generateMapHTML()` and supplies transit records from an external API, cache, user input, or another untrusted source. 2. An attacker causes a string field such as `BusID`, `RouteID`, or `DataTime` to contain JavaScript syntax that escapes its quoted value. 3. `generateMapHTML()` incorporates the value into the inline script without contextual encoding. 4. The application saves or ...[truncated 824 chars]
Remediation
View remediation
` element. 3. Validate `lat` and `lng` with `Number.isFinite()` and reject records containing nonnumeric coordinates. 4. Normalize expected string fields and enforce reasonable length limits. 5. Prefer placing serialized data in a non-executable `

T09 · Insecure Skill Coding Practices

Note
Location
scripts/build-cache.py:41
Finding

Unbounded Retry Loop in Cache Downloader

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (44)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `docs/index.html` — 完整文件網站

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.en.html (reported line 16)May include surrounding context.

html
</head>
<body>

  <!-- Header -->
  <header class="site-header">
    <a href="index.en.html" class="header-brand">
      <span class="header-logo">🚌</span>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.en.html (reported line 174)May include surrounding context.

html
</div>
        </section>

        <!-- ══════════════════════════════════════
             3. Quick Start
        ══════════════════════════════════════ -->
        <section class="section" id="quickstart">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.en.html (reported line 299)May include surrounding context.

html
</div>
        </section>

        <!-- ══════════════════════════════════════
             5. Data Sources
        ══════════════════════════════════════ -->
        <section class="section" id="data-sources">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.en.html (reported line 1085)May include surrounding context.

html
</div>
        </section>

        <!-- ══════════════════════════════════════
             8. Use Cases
        ══════════════════════════════════════ -->
        <section class="section" id="use-cases">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 16)May include surrounding context.

html
</head>
<body>

  <!-- Header -->
  <header class="site-header">
    <a href="index.html" class="header-brand">
      <span class="header-logo">🚌</span>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 304)May include surrounding context.

html
</div>
        </section>

        <!-- ══════════════════════════════════════
             5. 資料來源
        ══════════════════════════════════════ -->
        <section class="section" id="data-sources">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 687)May include surrounding context.

html
</div>
            </div>

            <!-- getStopCoords -->
            <div class="function-card">
              <div class="function-card-header">
                <div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 728)May include surrounding context.

html
</div>
            </div>

            <!-- searchStops -->
            <div class="function-card">
              <div class="function-card-header">
                <div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 859)May include surrounding context.

html
</div>
            </div>

            <!-- searchRoutes -->
            <div class="function-card">
              <div class="function-card-header">
                <div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 935)May include surrounding context.

html
</div>
            </div>

            <!-- etaBySequence -->
            <div class="function-card">
              <div class="function-card-header">
                <div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 1017)May include surrounding context.

html
</div>

          <!-- ── ETA 精度三級系統 ── -->
          <h3 style="font-size:16px;font-weight:700;margin:40px 0 16px;padding-bottom:8px;border-bottom:1px solid var(--border);color:var(--text-primary);">
            ⏱️ ETA 精度三級系統
          </h3>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 1138)May include surrounding context.

html
</div>
            </div>

            <!-- 範例 3 -->
            <div class="example-card">
              <div class="example-header">
                <div class="example-number">3</div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.html (reported line 1200)May include surrounding context.

html
</div>
            </div>

            <!-- 範例 5 -->
            <div class="example-card">
              <div class="example-header">
                <div class="example-number">5</div>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.zh-CN.html (reported line 16)May include surrounding context.

html
</head>
<body>

  <!-- Header -->
  <header class="site-header">
    <a href="index.zh-CN.html" class="header-brand">
      <span class="header-logo">🚌</span>

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.zh-CN.html (reported line 296)May include surrounding context.

html
</div>
        </section>

        <!-- ══════════════════════════════════════
             5. 数据来源
        ══════════════════════════════════════ -->
        <section class="section" id="data-sources">

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · docs/index.zh-CN.html (reported line 1096)May include surrounding context.

html
</div>
        </section>

        <!-- ══════════════════════════════════════
             8. 使用场景
        ══════════════════════════════════════ -->
        <section class="section" id="use-cases">

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document is written as an agent usage guide entirely in Chinese and presents response templates and formatting norms only in Chinese, indicating the skill is expected to operate in that language by default. There is no mention of asking the user for preferred language or offering an opt-in choice, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented trigger phrases include very broad, everyday expressions such as asking where a bus is or whether it is arriving soon. In an agent environment, overly generic triggers can cause accidental invocation during normal conversation, leading to unintended tool activation, surprise network access, or disclosure of transit-related queries when the user did not explicitly intend to use the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list is broad and includes generic everyday phrases like '公車', '公車站牌', and 'bus ETA', making accidental invocation plausible during ordinary conversation. In a transit skill, unintended activation can lead to confusing context switches, unnecessary external API calls, and unintended disclosure of location- or travel-related queries to the skill layer.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The trigger list includes broad natural-language phrases like 'bus ETA', 'Taipei bus', and similar everyday travel terms without any documented gating, namespace, or exclusion logic. In an agent ecosystem, this can cause unintended skill activation, leading to overbroad tool use, privacy leakage from irrelevant conversations, or incorrect routing of user intents.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documented trigger phrases are very broad, covering common bus-related conversation such as '公車多久' and 'Taipei bus' without any stated scoping, confirmation, or exclusion conditions. In an agent environment, this can cause accidental skill activation on ordinary user messages, leading to unintended network access, misleading bus-related responses, or interference with other tools.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented trigger phrases are very broad, everyday-language terms such as asking when a bus arrives or saying a bus has not come yet. In an agent environment, overly generic triggers can cause unintended activation, unnecessary external API calls, and unexpected handling of user conversations that were not meant to invoke this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation explicitly describes recurring monitoring and announced notifications via cron without an equally clear warning about persistent background behavior, frequency, resource use, or how to stop it. In an agent setting, this can lead to stealthy long-lived automation, surprise notifications, and repeated network access beyond the user's immediate request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JavaScript file contains natural-language comments and console output exclusively in Traditional Chinese, including the title and all status messages. Because the file provides no indication that the skill is Taiwan/Chinese-specific or that users can opt into this locale, it appears to force a specific language without user choice.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.