Back to skill

Security audit

Hugging Face Memory Estimator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Hugging Face memory-estimation helper, with a real but manageable supply-chain caution because its examples run an unpinned external CLI package.

Before installing, treat the hf-mem CLI as third-party code: prefer a pinned, reviewed version, run it with only the filesystem and network access it needs, and use a least-privilege Hugging Face token for gated or private repositories.

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:15
Finding

Unpinned Third-Party Package Is Downloaded and Executed Through uvx

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 15-27
Vulnerability Type: Unpinned dependency execution
Risk Level: Medium

Vulnerable Code

markdown
## What are the requirements?

- `uv` installed (for `uvx`)
- `HF_TOKEN` env var or `--hf-token` flag (for gated or private models only)

## How to run?

Run with `--model-id` pointing to the Hugging Face Hub repository which will check that it either contains Safetensors (via `model.safetensors`, `model.safetensors.index.json` if sharded, or `model_index.json` for Diffusers) or GGUF model weights within.

```bash
uvx hf-mem --model-id <model-id> --json-output
text

Equivalent unpinned `uvx hf-mem` commands also occur throughout lines 34-79.

### Technical Analysis

The Skill instructs the agent to use `uvx` to resolve, download, and execute the third-party `hf-mem` package without specifying an audited version, package hash, lockfile, or verified source. Consequently, the code executed at runtime is not fully represented by the reviewed Skill and can change independently after the audit.

This creates a software supply-chain exposure. If the package publisher account, package registry, package distribution process, or a future package release is compromised, an attacker-controlled package could execute automatically when the documented command is invoked. The risk is heightened because the documentation identifies `HF_TOKEN` as an environment variable that may be present during execution.

The reviewed `SKILL.md` itself contains no embedded executable payload, obfuscated code, persistence mechanism, or explicit credential-exfiltration instruction. Exploitation depends on compromise or malicious replacement of the externally resolved dependency.

### Attack Path

1. An attacker compromises the package publisher, registry entry, or distribution channel used to resolve `hf-mem`, or publishes a malicious version through an applicable packa
...[truncated 1292 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin hf-mem to a specific, reviewed version in every documented invocation rather than resolving the latest available release.
  2. Use a lockfile or equivalent dependency manifest that records exact transitive dependency versions.
  3. Require cryptographic hash verification or signed-artifact verification for the package and its dependencies.
  4. Document the expected package registry and verified publisher identity to reduce dependency-confusion and package-spoofing risks.
  5. Review new package versions before updating the pin, including changes to transitive dependencies.
  6. Execute the package in a sandbox or container with minimal filesystem permissions and restricted outbound network access.
  7. Provide only the minimum required Hugging Face token scope and avoid exposing unrelated secrets to the process.
  8. Prefer protected environment-based secret injection over command-line token arguments, which may be exposed through process listings, shell history, or logs.
  9. Where feasible, maintain a locally reviewed implementation or an internally mirrored and integrity-verified package artifact.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (10)

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The skill repeatedly instructs users to run uvx hf-mem without pinning a specific package version. Because uvx resolves and executes the latest available release by default, a future compromised, typosquatted, or maliciously updated package could be pulled at execution time, creating a supply-chain execution risk.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This command uses uvx hf-mem without a pinned version, so execution depends on whatever version is current at runtime. That exposes users to supply-chain compromise if the upstream package changes unexpectedly or is maliciously replaced.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

An unpinned uvx package reference means users may execute different code over time for the same documented command. In a skill that encourages direct command execution, this increases the likelihood of unnoticed execution of a compromised or breaking upstream release.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The example invokes an externally resolved package without version pinning, which is a classic dependency integrity weakness. If the package owner account, publishing pipeline, or dependency chain is compromised, users following the documentation could execute attacker-controlled code.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This command example is vulnerable to supply-chain drift because it omits a fixed package version. Users may assume the documented behavior is stable, but the actual executed code can change at any time with upstream releases.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The documentation encourages execution of uvx hf-mem at the latest available version, which creates a time-of-use trust dependency on an external publisher. That is dangerous because any later malicious release would be transparently executed by users following the skill.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

Using uvx without version pinning in a published skill introduces an avoidable remote code execution path via package substitution or malicious updates. The surrounding context makes this more relevant because the skill is specifically instructing end users to copy and run the command.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The command at this line depends on the latest upstream hf-mem package rather than a fixed release, which undermines reproducibility and trust. A compromised release could execute arbitrary code on the user's system when they run the example.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

This example has the same unpinned-package supply-chain issue as the others. The risk is somewhat elevated in practice because the skill may be used in automated or agentic workflows where commands are executed with limited human scrutiny.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description does not clearly warn that running the tool makes outbound HTTP requests to the Hugging Face Hub and may use authentication for private or gated models. In agent or enterprise contexts, missing disclosure can lead to unintended data egress, unexpected network access, or accidental exposure of sensitive model identifiers/tokens to an external service.

Content

No source excerpt is available for this finding.