Back to skill

Security audit

Context7 Documentation Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real Context7 documentation lookup tool, but it needs review because its curl permission is broader than its fixed Context7 API purpose requires.

Install only if you are comfortable with agents sending library names and documentation questions to Context7. Avoid using it with confidential source details, customer data, internal URLs, secrets, or incident information, and prefer a version that restricts curl to the two Context7 API endpoints or only permits the bundled scripts.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:12
Finding

Overly Broad Network Tool Permission Violates Least Privilege

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:12
Vulnerability Type: Excessive tool permissions enabling unrestricted outbound network requests
Risk Level: Medium

Vulnerable code:

yaml
compatibility: Requires curl, jq, and internet access. Optional CONTEXT7_API_KEY env var for higher rate limits.
metadata:
  author: context7
  version: "1.0"
  source: https://github.com/upstash/context7
allowed-tools: Bash(curl:*) Bash(jq:*) Read

Technical Analysis

The Skill requires network access to query two fixed Context7 API endpoints. However, Bash(curl:*) authorizes arbitrary curl commands rather than restricting requests to https://context7.com/api/search and https://context7.com/api/context.

The bundled scripts use fixed HTTPS endpoints and do not themselves implement malicious exfiltration. Nevertheless, the declared permission exceeds the minimum privilege required by the Skill. If attacker-controlled prompts or untrusted remote documentation influence a tool-capable Agent, the Agent could use the broad permission to contact arbitrary destinations. The simultaneous Read permission increases the potential exposure of files accessible to the Agent.

Attack Path

  1. The Skill is loaded, granting unrestricted curl execution and file-reading capability.
  2. An attacker supplies a malicious prompt, or attacker-controlled content is returned through a documentation lookup.
  3. That content instructs or manipulates the Agent into reading session-accessible information or selecting sensitive contextual data.
  4. The Agent invokes an authorized curl command targeting an attacker-controlled host rather than Context7.
  5. The selected information is transmitted in the request body, URL, or headers.

This path requires the Agent to act on malicious instructions; the broad permission alone does not initiate network activity.

Impact Assessment

Successful exploitation could permit ...[truncated 458 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace unrestricted Bash(curl:*) access with permission to execute only the two bundled wrapper scripts, if the Skill runtime supports script-level allowlisting.
  2. Otherwise, constrain network access to:
    • https://context7.com/api/search
    • https://context7.com/api/context
  3. Prevent callers from overriding the API base URL, destination host, proxy settings, or additional curl options.
  4. Remove the Read permission unless it is demonstrably required for Skill operation; the current lookup workflow only needs its packaged scripts and reference material.
  5. Treat all API responses as untrusted documentation and explicitly prohibit following tool-use instructions contained in returned content.
  6. Retain the existing warning not to include API keys, passwords, credentials, personal data, or other sensitive information in queries.
  7. Keep the Context7 API key limited to an authorization header sent only to the fixed HTTPS Context7 origin.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description claims the skill fetches current, version-specific documentation and code examples for libraries/frameworks. However, the code shown is a single resolver script whose purpose is to search Context7 for matching libraries and output candidate library IDs plus metadata. That is a related supporting step, but on its own it does not retrieve documentation, examples, API references, setup guides, or configuration instructions. The resource accessed (Context7) is consistent with the description, but the primary behavior is materially narrower and different: library identification/search rather than documentation fetching. Therefore this is a mismatch.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest says to activate when the user mentions needing docs, examples, or asks about APIs, versions, or configuration, which overlaps with many ordinary programming conversations. It does not provide exclusion conditions or clear constraints for when this skill should not activate, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This skill instructs the agent to send user-derived queries to an external service via curl, which creates a real data egress path. Even though the file warns not to include sensitive data, broad activation combined with external transmission can expose private prompts, internal code identifiers, or proprietary library names if the agent forwards them without careful minimization.

Content

Scanner excerpt · SKILL.md (reported line 70)May include surrounding context.

md
This returns documentation text with code examples directly relevant to the query.

### Shortcut: Direct curl

You can also call the API directly without the scripts:

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The documentation query endpoint transmits the user's query and selected library ID to a third-party API, which is a concrete external data flow. In this skill's context, the danger is increased by encouraging use for many common coding questions, making inadvertent leakage of confidential implementation details more likely if prompts are copied verbatim into the request.

Content

Scanner excerpt · SKILL.md (reported line 84)May include surrounding context.

Query documentation:

bash
curl -s "https://context7.com/api/context" \
  -H "Content-Type: application/json" \
  ${CONTEXT7_API_KEY:+-H "Authorization: Bearer $CONTEXT7_API_KEY"} \
  -d '{"query": "JWT authentication middleware", "libraryId": "/vercel/next.js"}' | jq .

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/API-REFERENCE.md (reported line 41)May include surrounding context.

Example Request:

bash
curl -s "https://context7.com/api/search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ctx7sk_YOUR_KEY" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/API-REFERENCE.md (reported line 89)May include surrounding context.

Example Request:

bash
curl -s "https://context7.com/api/context" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ctx7sk_YOUR_KEY" \
  -d '{

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/query-docs.sh (reported line 77)May include surrounding context.

sh
fi

# ── Check dependencies ────────────────────────────────────────────────────────
for cmd in curl jq; do
  if ! command -v "$cmd" &>/dev/null; then
    echo "Error: '$cmd' is required but not found. Please install it." >&2
    exit 1

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/resolve-library.sh (reported line 64)May include surrounding context.

sh
fi

# ── Check dependencies ────────────────────────────────────────────────────────
for cmd in curl jq; do
  if ! command -v "$cmd" &>/dev/null; then
    echo "Error: '$cmd' is required but not found. Please install it." >&2
    exit 1

Static analysis

No suspicious patterns detected.