Back to skill

Security audit

Phy Ts Any Auditor

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent TypeScript audit skill, but it repeatedly recommends running an unpinned npm tool through npx, including in CI, which creates a real supply-chain review concern.

Review before installing or using. Prefer adding type-coverage as an exact pinned devDependency with a committed lockfile, then run the local binary or npx --no-install. Avoid copy-pasting the unpinned npx examples into CI, especially where secrets or write permissions are available; run audits in a minimally privileged 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:145
Finding
Unpinned npm Package Retrieval and Execution Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:145-161`, with additional instances at `SKILL.md:406` and `SKILL.md:455` **Vulnerability Type**: Unpinned third-party dependency retrieval and execution **Risk Level**: Medium ### Vulnerable Code ```bash # Run type-coverage (zero install — uses npx) echo "Running type-coverage analysis..." npx --yes type-coverage \ --detail \ --strict \ --ignore-files "**/*.d.ts" \ --ignore-files "**/__tests__/**" \ --ignore-files "**/*.test.ts" \ --ignore-files "**/*.spec.ts" \ 2>&1 | head -100 # For per-file breakdown npx --yes type-coverage \ --detail \ --strict \ --report-semantic-not-covered \ 2>&1 | grep -E "\.ts[x]?:" | sort -t: -k3 -rn | head -30 ``` Additional unpinned invocations include: ```yaml run: npx type-coverage --atLeast 85 --strict ``` ```bash npx type-coverage --strict ``` ### Technical Analysis The Skill directs the Agent to execute `type-coverage` through `npx` without specifying an exact, reviewed package version. If the package is not already installed locally, `npx` may contact the configured npm registry, download the currently resolved package release, and execute it with the invoking user's privileges. The `--yes` option further reduces safeguards by automatically approving package installation. Because the resolved package content can change after the Skill has been reviewed, the effective code executed by the Skill is not fully represented by the audited `SKILL.md` file. This behavior creates a software supply-chain trust boundary. A compromised npm publisher account, malicious package release, registry compromise, dependency compromise, or attacker-controlled npm registry configuration could cause arbitrary code to run during an otherwise local TypeScript audit. The network activity is related to dependency retrieval rather than a confirmed transfer of repository contents. No command in the audited file explicitly uploads source code, credentials, toke ...[truncated 1708 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add an audited, exact version of `type-coverage` to the project's development dependencies instead of resolving the latest available release at runtime: ```bash npm install --save-dev --save-exact type-coverage@<reviewed-version> ``` 2. Commit the package manifest and lockfile so the selected version and dependency integrity hashes are reviewable and reproducible. 3. Invoke only the locally installed dependency and prohibit fallback downloads: ```bash npx --no-install type-coverage --detail --strict ``` Alternatively: ```bash ./node_modules/.bin/type-coverage --detail --strict ``` 4. Remove `--yes` so unexpected installation is not silently authorized. 5. Install dependencies in a separate, controlled setup phase using a frozen lockfile: ```bash npm ci --ignore-scripts ``` If lifecycle scripts are required, review them before allowing their execution. 6. Run the audit in a sandbox with read-only repository access where practical, a minimal environment, no unnecessary secrets, restricted outbound networking, and no elevated privileges. 7. Clearly disclose that dependency installation may contact the npm registry. The current “Zero external API” language should not imply that execution is completely offline. 8. Apply the same pinned local invocation to the CI example at line 406 and migration command at line 455. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Anti-Refusal Statement

High
Category
Anti-Refusal
Content
| `noImplicitAny` | ❌ MISSING | Untyped params silently become `any` |
| `strictNullChecks` | ❌ MISSING | `null`/`undefined` bypass type checking |
| `noImplicitReturns` | ❌ MISSING | Functions may return `undefined` implicitly |
| `noUncheckedIndexedAccess` | ❌ MISSING | `arr[i]` can be `undefined` without warning |

**Quick Fix:** Add `"strict": true` to compilerOptions — this single flag enables all critical checks. Expect N new errors; treat each as a bug catch, not a build failure.
Confidence
80% confidence
Finding
Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The manifest/description advertises wrapping `npx type-coverage` without indicating a pinned version. Embedding an unpinned fetch-and-execute dependency in the skill's core behavior creates a design-level supply-chain risk, not just an isolated documentation issue.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The skill instructs users to run `npx type-coverage` without pinning an exact package version. That allows the fetched package version to change over time, creating a supply-chain risk where a compromised or newly malicious release could execute arbitrary code in the user's environment.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The metadata includes broad trigger phrases like `type coverage`, `enable strict mode`, and `tighten types`, which are common in normal discussion. Over-broad activation can cause the skill to run unexpectedly on unrelated prompts, increasing the chance of unintended command suggestions or filesystem-scanning behavior in the wrong context.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger list contains several ambiguous natural-language phrases without clear gating conditions. In a skill that recommends shell commands and codebase scanning, accidental activation is more dangerous than in a purely informational skill because it can lead to unintended operational guidance or analysis of an unintended directory.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
This command downloads and executes `type-coverage` via `npx --yes` without an exact version pin. Because `npx` resolves from the registry at runtime, users may unknowingly run a different or compromised release, making the skill an execution path for supply-chain compromise.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
This is another unpinned runtime fetch-and-execute of `type-coverage` through `npx`. Repeated examples reinforce unsafe operational behavior and increase the chance that users adopt the insecure pattern directly in automation.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding
The CI example uses `npx type-coverage` without an exact version. In CI this is especially risky because it can introduce non-reproducible builds and a direct supply-chain execution path in an automated environment with repository secrets or privileged tokens.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding
This migration command again recommends `npx type-coverage` with no version pin, propagating the same supply-chain and reproducibility risk. Because users may copy-paste baseline measurement commands into local or CI workflows, the unsafe pattern is operationally significant.

Static analysis

No suspicious patterns detected.