Back to skill

Security audit

text-stats

Security checks for vulnerabilities and agentic risk

Overview

This is a simple text statistics skill with read-only runtime behavior, though its install instructions and some copied documentation language deserve caution.

Before installing, review the files and prefer a pinned CLI version or pinned Git commit instead of the documented unpinned global install. Treat the dry-run/--apply wording as inaccurate for this skill; the included script is read-only and only analyzes files or directories you explicitly pass to it.

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:82
Finding
Unpinned Third-Party Package Execution in Installation Instructions## Vulnerability Details **File Location**: `SKILL.md:82` **Vulnerability Type**: Unpinned package execution through `npx` **Risk Level**: Medium ### Vulnerable Code ```bash npx skills add zhaoxinghua09-cell/agent-skills -g ``` ### Technical Analysis The documented installation command invokes the third-party `skills` npm package through `npx` without specifying an exact package version or integrity hash. Depending on the local npm configuration and cache state, `npx` may retrieve the currently resolved package from the configured registry and execute its CLI code. Consequently, the code executed during installation is not necessarily the same code that was reviewed when this skill was audited. Registry compromise, package-account compromise, dependency confusion caused by an untrusted registry configuration, or a malicious future package release could turn this installation command into an arbitrary-code execution channel. The `-g` option also causes the requested agent skill to be installed globally. While it does not itself grant operating-system administrative privileges, it broadens the persistence and exposure of any compromised skill content across the user's agent environment. ### Attack Path 1. An attacker compromises the publisher account, registry package, package dependency, or registry resolution path associated with the unpinned `skills` package. 2. The attacker publishes or serves a malicious version containing harmful CLI or lifecycle behavior. 3. A user follows `SKILL.md` and runs the documented `npx skills add ... -g` command. 4. `npx` resolves and retrieves the unpinned package from the configured registry. 5. The package executes with the invoking user's operating-system privileges. 6. Malicious code can access resources available to that user and may alter globally installed agent skill content. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the privileges of the user running the installa ...[truncated 471 chars]
Remediation
## Remediation Suggestions 1. Pin the installer to an exact, reviewed version rather than allowing `npx` to resolve the latest available release: ```bash npx --yes skills@<audited-exact-version> add zhaoxinghua09-cell/agent-skills ``` 2. Commit a lockfile and verify npm integrity metadata when the installer is managed as a project dependency. 3. Document the expected npm registry, package publisher, audited version, and release checksum or signature. 4. Prefer a locally installed, locked dependency invoked with `npx --no-install` so installation does not silently retrieve executable code: ```bash npx --no-install skills add zhaoxinghua09-cell/agent-skills ``` 5. Avoid global installation unless it is operationally required. Install into a user-scoped, isolated skill directory and review downloaded skill files before activation. 6. Retain the documented manual Git installation as the safer alternative, but pin it to a reviewed commit hash or signed release instead of a mutable branch. 7. Run installation without administrator privileges and in a restricted environment where practical.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Intent-Code Divergence

Medium
Confidence
91% confidence
Finding
The README describes dry-run, --apply, and return-code semantics associated with making or validating changes, which does not align with a text statistics utility that should be read-only. This mismatch can mislead users and higher-level agents into treating the skill as capable of acting on files, increasing the risk of unintended invocation patterns or unsafe orchestration decisions.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The phrase 'One command for daily file/text chores' is overly broad and suggests general file manipulation beyond counting words, lines, frequency, or reading time. In agent settings, vague capability descriptions can cause over-privileged or inappropriate use of the skill, especially when paired with contradictory execution language elsewhere in the README.

Lp3

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding
Without declared permissions the skill's intent is opaque and cannot be validated.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
This markdown file contains user-facing naming, description, and operational guidance primarily in Chinese, and the usage examples later also assume Chinese-language instructions. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless a justified locale constraint is documented, which is not present here.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
Line L53 states that write-to-disk operations default to dry-run and require --apply, even naming other tools like text-replace/dup-finder. In this skill file, however, the documented capability is a read-only text/code statistics tool, so this line contradicts the stated intent and appears to be copied from a different skill template rather than describing this skill's behavior.

Rp1

Medium
Category
MCP Rug Pull
Confidence
87% confidence
Finding
The installation instructions use `npx skills add ...` without pinning a specific package version, which can cause users to execute whatever version is current at install time. If the upstream package or dependency chain is compromised, users may unknowingly fetch and run malicious code.

Natural-Language Policy Violations

Low
Confidence
0% confidence
Finding
No natural-language policy violation is present here. The file provides both Chinese and English text and does not require a specific language without user opt-in.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The argument parser description, help strings, and error message are written only in Chinese, which imposes a specific language on users without opt-in or an alternative locale. This matches the policy category for language or locale constraints in natural-language content embedded in code.

Static analysis

No suspicious patterns detected.