Back to skill

Security audit

skill-compressor 精简技能*减少token

Security checks for vulnerabilities and agentic risk

Overview

This skill transparently creates compressed copies of user-selected skill files and avoids overwriting originals, with the main caution being an optional unpinned npx install command.

Install through ClawHub or a reviewed/pinned source when possible. Use this skill only on skill directories you intentionally choose, review the generated .reduced output with a diff, and manually replace originals only after confirming the behavior is preserved.

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
README.md:77
Finding
Unpinned Third-Party Package Execution During Installation## Vulnerability Details **File Location**: `README.md`, lines 77–81 **Vulnerability Type**: Unpinned package execution and software supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```bash ### Via skills.sh ```bash npx skills add David0Ming/skill-compressor ``` ``` ### Technical Analysis The documented installation method invokes the third-party `skills` package through `npx` without specifying a package version or verifying its integrity. If the package is not already available locally, `npx` can retrieve its current release from the configured package registry and execute it with the user's privileges. Because neither a fixed version nor an integrity hash is provided, the code executed by this command may change after the Skill has been audited. A compromised package publisher account, registry compromise, or malicious future release could consequently turn the installation command into an arbitrary-code execution vector. The project itself contains no confirmed malicious scripts or executable payload. The risk originates specifically from recommending execution of mutable, externally supplied dependency code. ### Attack Path 1. An attacker compromises the upstream `skills` package, its publisher account, or its distribution channel. 2. The attacker publishes a malicious version under the package name resolved by `npx`. 3. A user follows the README and runs: ```bash npx skills add David0Ming/skill-compressor ``` 4. `npx` downloads the mutable package release from the configured registry. 5. The malicious package executes locally with the privileges and environment of the user who launched the command. 6. The payload may access any files, credentials, environment variables, or network resources available to that user. ### Impact Assessment Successful exploitation permits arbitrary command execution under the installing user's account. The accessible scope may include user-owned files, source repositories, SSH or API credent ...[truncated 395 chars]
Remediation
## Remediation Suggestions 1. Pin the installer package to a specifically reviewed version: ```bash npx skills@<reviewed-version> add David0Ming/skill-compressor ``` 2. Verify the selected package version against a published integrity hash, signed release, or trusted lockfile before execution. 3. Avoid automatic acceptance of an unknown replacement package; consider using `npx --no-install` when the reviewed package has already been installed locally. 4. Prefer the manual installation method, but pin the repository to a reviewed commit or signed release rather than implicitly trusting the current branch: ```bash git clone https://github.com/David0Ming/skill-compressor.git cd skill-compressor git checkout <reviewed-commit-or-signed-tag> ``` 5. Document the expected package source, exact version, checksum, and verification procedure. 6. Re-audit dependency updates before changing the pinned version.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md` + 非空的 `examples.md`/`templates.md`/`background.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

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.

Skill Enumeration

Medium
Category
Agent Snooping
Content
Once installed, in any Claude Code session:

- `/skill-compressor`
- or: *"compress `~/.claude/skills/foo/SKILL.md`"*
- or: *"this skill is huge, token cost is exploding — slim it down"*

Claude walks the 8-step procedure and writes results to `<skill>/.reduced/`.
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The natural-language trigger "this skill is huge, token cost is exploding — slim it down" is broad enough to match ordinary conversation about skills rather than a clear opt-in command. In an agentic environment, that can cause unintended invocation of the compressor on arbitrary skill files, leading to unauthorized modification workflows, accidental file generation, or interference with other tasks.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The description/frontmatter trigger language is broad enough to activate on generic requests about optimization or token reduction, which can cause unintended skill invocation outside a clearly scoped compression context. In an agent system, over-broad routing increases the chance that the wrong skill handles user input, potentially altering files or producing misleading outputs when the user did not intend to invoke this capability.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The natural-language trigger list includes ambiguous conditions like '要求优化/压缩/瘦身' and complaints about tokens, without invocation boundaries or exclusions. That makes accidental activation more likely, and because this skill reads referenced files and writes output artifacts, misrouting could expose unrelated content to processing or cause unintended modifications in the workspace.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger condition in the front matter is broad and subjective (e.g., '拿不准' and '想理解为什么按这种方式拆'), which can cause the router to invoke this skill outside its intended scope. In a skill that rewrites or compresses other skills, over-triggering can lead to unintended modification guidance, token waste, and interference with more appropriate skills, though it does not directly create code execution or data exfiltration risk.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The front matter uses a broad natural-language trigger condition ("想看完整前后对照走查,或某段不确定该归哪类") rather than a narrowly scoped, machine-friendly condition. This can cause the skill to be invoked in unintended contexts, increasing prompt-surface exposure and potentially overriding more appropriate skills or workflows.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Vague Triggers

Medium
Confidence
88% confidence
Finding
The example frontmatter trigger '写 REDUCTION_REPORT.md,或给拆出的附属文件加 frontmatter' is operationally broad and may activate whenever the agent is writing a report or modifying frontmatter, even if the compression template is not actually needed. In a skill whose purpose is to be auto-invoked based on these triggers, this can lead to unnecessary loading of content and broader exposure to adversarial or irrelevant instructions.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The guidance for writing `when` values encourages broad, natural-language trigger conditions such as '需要...', '想...', and '不确定...', which are easy to match in many unrelated contexts. Because this skill is specifically about creating frontmatter that controls when auxiliary files are loaded, overly broad trigger rules can cause unintended file reads or activation, increasing prompt surface area and the chance of misrouting or prompt-injection exposure from unnecessary files.

Natural-Language Policy Violations

Low
Confidence
72% confidence
Finding
The file contains a Chinese-only introductory block, which introduces a language-specific presentation choice without stating whether multilingual behavior is optional or user-selected. The policy requires flagging language or locale constraints when the skill appears to force or privilege a specific language without opt-in or clear justification.

Static analysis

No suspicious patterns detected.