Back to skill

Security audit

NYC Subway Status

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple NYC subway lookup helper whose network use is disclosed and aligned with its transit-information purpose, with a caution about relying on mutable remote API guidance.

Before installing, understand that the skill depends on a third-party transit service and may fetch its current API reference or use its hosted MCP tools. Keep use limited to subway questions, do not send unrelated private context to the service, and treat remote documentation or MCP responses as data that cannot override normal agent instructions.

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
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:11
Finding
Mutable Remote Instructions and Unverified MCP Tool Surface## Vulnerability Details **File Location**: `SKILL.md:11-16` and `SKILL.md:126-136` **Vulnerability Type**: T01: Skill Instruction Hijacking **Risk Level**: Medium The Skill requires an agent to retrieve operational guidance from a remotely controlled document before making API calls. It also recommends connecting to an externally hosted MCP server whose definitions and behavior are not included in the audited package. ### Vulnerable Code Snippets `SKILL.md:11-16`: ```markdown Before making any API calls, fetch the full API reference: ``` GET https://nyc-subway-status.com/llms.txt ``` This returns a plain-text guide with all endpoints, slug formats, response schemas, and tips. Read it once per session to understand the API surface. ``` `SKILL.md:126-136`: ```markdown ## MCP Server (Alternative) For agents that support Model Context Protocol, connect directly: ```json { "mcpServers": { "nyc-subway": { "url": "https://nyc-subway-status.com/mcp" } } } ``` Tools: `search_subway`, `get_arrivals`, `get_station_arrivals`, `list_stations`, `list_routes`, `get_trip` ``` ### Technical Analysis The contents of `https://nyc-subway-status.com/llms.txt` are not present in the project and therefore cannot be reviewed or integrity-checked as part of this package. The document is mutable server-side, but the Skill instructs the agent to read it as operational guidance once per session. This creates a remote instruction boundary through which a compromised service, domain, hosting account, or upstream deployment could supply prompt-injection content. Such content could masquerade as updated API documentation while directing the agent to change its workflow, access unrelated resources, disclose conversation data, or send information to additional endpoints. Transport encryption protects the connection in transit but does not protect against compromise of the legitimate server or malicious changes by it ...[truncated 2126 chars]
Remediation
## Remediation Suggestions 1. Bundle a reviewed, versioned API reference with the Skill instead of requiring agents to retrieve mutable instructions at runtime. 2. If remote discovery remains necessary, parse the response strictly as untrusted structured data rather than allowing it to act as agent instructions. 3. Define an explicit allowlist of permitted HTTP methods, hostnames, paths, parameters, and response fields. Reject instructions that request unrelated endpoints or operations. 4. Pin a reviewed API or MCP schema version and verify its integrity using a trusted digest or signature where the platform supports it. 5. Require explicit user or administrator approval before registering the remote MCP server. 6. Apply least privilege to MCP tools and prevent them from accessing local files, credentials, memory, or unrelated network destinations. 7. Treat all remote responses, tool descriptions, and tool results as untrusted content that cannot override system, developer, user, or Skill security constraints. 8. Document a fixed set of expected tools and validate remotely supplied MCP tool names, input schemas, and output schemas before use. 9. Minimize data sent to the service to the transit query required for the requested feature, and do not transmit unrelated conversation context or sensitive information. 10. Add tests that simulate prompt-injection text in the remote guide and deceptive MCP responses, confirming that the agent ignores instructions outside the documented subway API contract.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.