Back to skill

Security audit

gpt5.5free

Security checks for vulnerabilities and agentic risk

Overview

The skill is a simple chat helper, but it can send the user's API key and prompts to any configured API endpoint without validation or clear warning.

Review this before installing if you plan to use real prompts or account credentials. Use it only with a trusted HTTPS endpoint, avoid setting OPENROUTER_API_URL unless you control and trust the destination, and do not submit confidential prompts unless you accept the provider's data handling terms.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
src/index.js:5
Finding

Arbitrary API Endpoint Can Receive the OpenRouter Credential and User Prompts

Content
View full analysis

Vulnerability Details

File Location: src/index.js, lines 5–23
Vulnerability Type: Unrestricted transmission of sensitive information to a configurable endpoint
Risk Level: High

Vulnerable Code

js
// 使用 OpenRouter 免费模型或其他免费 API
const API_URL = process.env.OPENROUTER_API_URL || 'https://openrouter.ai/api/v1/chat/completions';
const API_KEY = process.env.OPENROUTER_API_KEY;

async function chat(prompt, model = 'meta-llama/llama-4-maverick:free') {
  if (!API_KEY) {
    console.error('Error: 请设置 OPENROUTER_API_KEY 环境变量');
    process.exit(1);
  }

  const res = await fetch(API_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${API_KEY}`,
      'HTTP-Referer': 'https://github.com/leic8959/gpt5.5free',
      'X-Title': 'gpt5.5free'
    },
    body: JSON.stringify({
      model,
      messages: [{ role: 'user', content: prompt }]
    })
  });

Technical Analysis

The application accepts OPENROUTER_API_URL as an unrestricted destination and sends the value of OPENROUTER_API_KEY in the Authorization header to that destination. The complete user prompt is also included in the request body.

Sending the credential and prompt to the default OpenRouter API is necessary for the declared chat functionality. However, the implementation does not validate the custom endpoint's scheme, hostname, port, or trust relationship. Consequently, an arbitrary server selected through the environment receives a credential specifically described as an OpenRouter API key.

The custom endpoint feature is documented as support for compatible providers, so the code does not establish intentional exfiltration. Nevertheless, automatically forwarding the OpenRouter credential to any configured URL exceeds the minimum safe privilege boundary. It also creates a limited server-side request forgery surface because internal URLs can be sel ...[truncated 1488 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict destinations to an explicit allowlist of trusted HTTPS hostnames, including exact hostname checks after parsing with new URL().
  2. Reject non-HTTPS schemes, embedded URL credentials, unexpected ports, loopback addresses, link-local addresses, and private-network destinations unless they are explicitly required and trusted.
  3. Do not automatically send OPENROUTER_API_KEY to custom providers. Use separate provider-specific credential variables or require the caller to supply authorization explicitly for a custom endpoint.
  4. Bind credentials to providers. For example, send OPENROUTER_API_KEY only when the normalized hostname is the approved OpenRouter hostname.
  5. Fail closed when endpoint validation fails, and avoid silently falling back to a destination that may receive sensitive information.
  6. Clearly warn users that prompts are transmitted to the selected external provider and may be processed or retained under that provider's policies.
  7. Add automated tests covering malicious hosts, HTTP URLs, embedded credentials, redirects, private IP ranges, and hostname-confusion cases.
  8. Consider disabling redirects or validating every redirect destination so an approved endpoint cannot redirect authorization-bearing requests to an untrusted host.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description says it uses OpenRouter and similar platforms, which implies user input is transmitted to a third-party network service. The markdown includes setup and usage instructions but does not warn users that their prompts may leave the local system or be handled by external providers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
76% confidence
Finding

The sample command uses a Chinese prompt and the example code explicitly requests a Chinese self-introduction, while the document does not state that language is configurable or limited for a region-specific reason. This can be read as imposing a specific language/locale by default without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code sends the user's prompt to a remote API and includes an authorization credential in the request headers, but there is no confirmation prompt, user-facing notice, or explanatory comment warning that user input will be transmitted externally. For a code file, remote data transmission is a safety-relevant operation that should have some visible disclosure unless clearly documented elsewhere.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The markdown tells users to export OPENROUTER_API_KEY but does not disclose that this value is a secret that should be protected and not logged, committed, or shared. For a skill handling credentials, a brief user-facing warning is expected to reduce accidental exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The entire skill overview is written in Chinese, including the title and usage instructions, with no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest description is written only in Chinese and does not indicate that users can choose another language or that the package is intentionally region-specific. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file's descriptive text and error message are written in Chinese, which imposes a specific language on users without any opt-in or explanation that the skill is intended only for a Chinese-speaking context. The stated policy flags language or locale constraints when they are enforced without user choice or clear justification.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/index.js:6