Back to skill

Security audit

Rail CLI

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent UK rail lookup skill with a disclosed API token requirement and a disclosed npm CLI install, with supply-chain caution around the unpinned global package.

Before installing, consider pinning or reviewing the npm package version, and keep DARWIN_ACCESS_TOKEN scoped to rail data use rather than placing broader secrets in the same environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:16
Finding

Unpinned Third-Party Package Installed Globally

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 16-25 and line 36
Vulnerability Type: Unpinned and unaudited third-party dependency
Risk Level: Medium

Vulnerable Code

yaml
"install":
  [
    {
      "id": "npm",
      "kind": "node",
      "package": "@shan8851/rail-cli",
      "bins": ["rail"],
      "label": "Install rail-cli (npm)",
    },
  ],
markdown
- `npm install -g @shan8851/rail-cli`

Technical Analysis

The Skill instructs users to install @shan8851/rail-cli globally without specifying an exact version or integrity value. Consequently, installation resolves whichever package version the npm registry currently serves rather than an immutable, previously audited artifact.

A global npm installation can execute package lifecycle scripts during installation and place the package's rail executable in the user's global command path. The audited project does not contain the dependency's source, lockfile, integrity hash, or publisher-verification information, so the executable behavior cannot be validated from this artifact.

There is no evidence in SKILL.md that the named package is currently malicious. The vulnerability arises from trusting a mutable, externally maintained package without version or integrity controls.

Attack Path

  1. An attacker compromises the package publisher's npm account, the package itself, or one of its transitive dependencies.
  2. The attacker publishes a malicious version under the existing package name.
  3. A user follows the Skill's documented command: npm install -g @shan8851/rail-cli.
  4. npm resolves and downloads the malicious current release because no exact version is pinned.
  5. Malicious lifecycle code can execute during installation, or malicious logic can run when the globally installed rail command is invoked.
  6. The code executes with the installing user's privileges and may access that user's files, ...[truncated 874 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the package to an exact reviewed version, for example @shan8851/rail-cli@X.Y.Z, rather than resolving the latest release.
  2. Record and verify the expected package integrity hash before installation.
  3. Prefer a project-local installation backed by a committed lockfile over npm install -g.
  4. Include or link to the exact auditable source revision corresponding to the pinned package release.
  5. Verify npm publisher ownership, package provenance, release signatures, and registry metadata.
  6. Review the package and its transitive dependencies for lifecycle scripts before deployment.
  7. Where compatible with the package, install with lifecycle scripts disabled and enable only explicitly reviewed setup operations.
  8. Run the CLI with least privilege and expose DARWIN_ACCESS_TOKEN only to the specific process that requires it.
  9. Add automated dependency monitoring so that upgrades require review rather than silently changing the installed implementation.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
Setup

- `npm install -g @shan8851/rail-cli`
- Get a free Darwin access token: https://realtime.nationalrail.co.uk/OpenLDBWSRegistration/Registration
- `export DARWIN_ACCESS_TOKEN=your_token` or add to `.env`
- Station search works without a token. Departures and arrivals require one.