Back to skill

Security audit

hkroute

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Hong Kong transit routing tool that uses Google Maps and public ETA services, with no evidence of hidden or malicious behavior.

Install only if you are comfortable sending origin and destination information to Google Maps and public Hong Kong transit data services. Use a Google Maps API key restricted to the needed Directions API with quotas, and be aware that the skill keeps a local public ETA database cache under ~/.cache/hk-route.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (36)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `scripts/hk-route.cjs` is built from readable TypeScript source at [github.com/7ito/hkroute](https://github.com/7ito/hkroute). Build command: `esbui

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `scripts/hk-route.cjs` is built from readable TypeScript source at [github.com/7ito/hkroute](https://github.com/7ito/hkroute). Build command: `esbui

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 8977)May include surrounding context.

js
if (!(key in state.jobs)) {
          return;
        }
        delete state.jobs[key];
        if (error) {
          abort(state);
        } else {

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 17895)May include surrounding context.

js
],
      scripts: {
        build: "tsc",
        docs: "rm -rf docs/ && typedoc src/index.ts",
        prepack: "npm run build",
        pretest: "npm run build",
        test: "jest --runInBand --collectCoverage ./src/* && npm run test:loading",

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares executable and privileged capabilities in metadata and behavior (environment variable access, network requests, and shell/Node execution) but does not explicitly constrain them with a tool-scope or permissions declaration. This creates a trust and governance gap: a host agent may permit broader execution than intended, making review, policy enforcement, and least-privilege controls harder.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The implicit activation rules are broad enough to trigger on ordinary travel-related conversation, causing the skill to run without an explicit user request for this specific integration. In context, that can lead to unanticipated external API calls, use of the Google Maps API key, and transmission of user-provided location data to third parties when the user may have only been asking a general question.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill creates a persistent cache file under the user's home directory (~/.cache/hk-route/etaDb.json) and writes downloaded route data to disk. This is not remote code execution or direct data exfiltration, but it is a real security/privacy concern because it persists data outside the explicitly described routing action and does so without user awareness or opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script silently writes a persistent cache file into the user's home directory. Even though the cached data appears to be transit metadata rather than user secrets, undisclosed persistent storage can violate least surprise, create privacy/compliance issues, and leave stale data on shared systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script reads GOOGLE_MAPS_API_KEY and sends it in outbound requests to Google Maps. Using an API key for its intended provider is normal, but from a security/privacy standpoint this is still sensitive outbound secret use and the file provides no disclosure, scoping, or guardrails around where the secret is sent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The Google Maps directions request forces region: "hk", which imposes a specific locale/region behavior in the skill without any visible user opt-in or explanation in this file. The policy allows locale constraints only when the user is given a choice or the constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code hard-codes language: "en" for ETA retrieval, which imposes a specific language on all users. This is a natural-language policy concern because the file provides no user opt-in, fallback, or documented reason for restricting output to English.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 18558)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 18593)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 18594)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31404)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31423)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31424)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31427)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31428)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31554)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31580)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31581)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31586)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31590)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · scripts/hk-route.cjs (reported line 31591)May include surrounding context.

js
...routeEntry,
        seq: stopIdx,
        language: "en",
        stopList: etaDb.stopList,
        holidays: etaDb.holidays,
        serviceDayMap: etaDb.serviceDayMap,
      });

Static analysis

Detected: suspicious.env_credential_access, suspicious.exposed_secret_literal

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/hk-route.cjs:10362

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
scripts/hk-route.cjs:13056