Back to skill

Security audit

hugging-face-api

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent documentation-only Hugging Face MCP playbook that discloses token use, billed inference, and cost controls without hidden execution or persistence.

Before installing, confirm you want agents to use Hugging Face MCP tools that can make network calls and billed inference requests. Use a least-privilege HF_TOKEN, keep max_tokens set, review model and dataset licenses, and be deliberate about caching embeddings or source text from private data.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

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 18)May include surrounding context.

md
## 2. Purpose

Use this skill to find open-source models and datasets on the Hugging Face Hub, confirm which models are runnable through the Inference router, and run chat completions and embeddings — while controlling cost, respecting licenses, and keeping the access token secret.

## 3. When to use Hugging Face

Unbounded Output

Medium
Category
Output Handling
Confidence
75% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · prompts/cost-control.md (reported line 43)May include surrounding context.

Bad

text
Embed each of these 500 documents one at a time and answer with no token limit.

(500 separate billed calls plus unbounded generation — expensive.)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · prompts/model-selection.md (reported line 51)May include surrounding context.

Use Llama to summarize this.

text

(No task type, no license check, no confirmation the model is runnable — risks `model_not_supported` and license violations.)

## Good