Back to skill

Security audit

Llava Vision

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for local image analysis, but it exposes broad local-file reading and unrestricted URL fetching without enough scoping or safeguards.

Install only if you are comfortable with the skill reading paths you or an agent provide and making outbound requests to arbitrary image URLs from your machine. Use trusted local image files, avoid sensitive paths, and run it in a network/filesystem-restricted environment if possible.

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

T09 · Insecure Skill Coding Practices

Error
Location
tool.js:15
Finding

Unrestricted Remote URL Fetching Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: tool.js:15-19
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: High

Vulnerable Code:

js
if (imagePathOrUrl.startsWith("http://") || imagePathOrUrl.startsWith("https://")) {
  const res = await fetch(imagePathOrUrl);
  if (!res.ok) throw new Error(`Failed to fetch image: ${res.statusText}`);
  const buffer = await res.arrayBuffer();
  imageBase64 = Buffer.from(buffer).toString("base64");
}

Technical Analysis

The skill performs a server-side HTTP request to a completely user-controlled URL. Although input is limited to strings beginning with http:// or https://, there is no validation of the destination hostname or resolved IP address.

The implementation does not reject loopback, private, link-local, multicast, or otherwise reserved address ranges. It also does not validate redirect destinations, allowing an initially acceptable URL to redirect to an internal address. No request timeout, response-size limit, content-type restriction, or image-signature validation is applied.

As a result, an attacker able to invoke the skill can use the host's network position to request internal services, loopback interfaces, or cloud instance metadata endpoints. The response bytes are Base64-encoded and included in a request to the local LLaVA service. Depending on how the model interprets the content, information obtained from the targeted service may appear in the model's response.

Attack Path

  1. The attacker supplies an internal or metadata-service URL through the --image argument, such as a loopback, private-network, or link-local destination.
  2. index.js passes the URL to vision_analyze without destination validation.
  3. tool.js calls fetch() using the attacker-controlled URL from the host environment.
  4. The request reaches a service that may be inaccessible directly to the attacker but accessible to the skill host.

...[truncated 1245 chars]

Remediation
View remediation

Remediation Suggestions

  • Prefer removing remote URL support unless it is essential to the skill.
  • If remote retrieval is required, enforce an explicit allowlist of trusted schemes, hostnames, and ports.
  • Resolve the hostname before connecting and reject all loopback, private, link-local, multicast, unspecified, and reserved IPv4 and IPv6 ranges.
  • Protect against DNS rebinding by ensuring that the validated address is the address used for the connection.
  • Disable automatic redirects or validate the hostname and resolved address at every redirect hop.
  • Apply an AbortController timeout and a strict maximum response size while streaming the body.
  • Require an approved image MIME type and verify the file's magic bytes rather than trusting headers or extensions.
  • Reject credentials embedded in URLs and unnecessary nonstandard ports.
  • Run the skill in a sandbox with outbound network restrictions that block metadata endpoints and internal network ranges.
  • Avoid returning raw upstream response bodies or other sensitive diagnostics to untrusted callers.

T05 · Unauthorized Access and Privilege Escalation

Error
Location
tool.js:20
Finding

Unrestricted Local Path Input Enables Arbitrary File Reading

Content
View full analysis

Vulnerability Details

File Location: tool.js:20-22
Vulnerability Type: Arbitrary Local File Read
Risk Level: High

Vulnerable Code:

js
} else {
  const buffer = await fs.promises.readFile(imagePathOrUrl);
  imageBase64 = buffer.toString("base64");
}

Technical Analysis

Any input that does not start with http:// or https:// is treated as a local filesystem path and passed directly to fs.promises.readFile. The path is not canonicalized or constrained to an approved image or workspace directory.

There is no check for absolute paths, parent-directory traversal, symbolic links, file type, image format, or file size. Consequently, the skill can read any regular file accessible to the operating-system account running the process. The --file alias accepted by index.js also exposes this behavior even though the documented purpose is image analysis.

The resulting bytes are Base64-encoded and submitted to the local LLaVA API. Although reliable disclosure depends on how the vision model processes non-image data, the skill has already crossed the intended image-access boundary by reading arbitrary files. Sensitive local data is also transferred to the separate local model service.

Attack Path

  1. The attacker invokes the skill with --image or --file and supplies an absolute path, traversal path, or symbolic-link path to a sensitive file.
  2. index.js forwards the value as imagePathOrUrl.
  3. Because the value does not begin with an HTTP(S) prefix, execution enters the local-file branch.
  4. fs.promises.readFile reads the complete target using the process's filesystem privileges.
  5. The file is Base64-encoded and embedded in the request sent to the local LLaVA server.
  6. The model may return text that exposes or characterizes the file's contents.

An attacker can also identify a very large readable file and cause the process to load it fully into memory. Base64 conversion and ...[truncated 813 chars]

Remediation
View remediation

Remediation Suggestions

  • Restrict local input to a dedicated upload or workspace directory using an explicit configured root.
  • Resolve the requested path with realpath and verify that the canonical result remains beneath the approved root.
  • Reject absolute paths and traversal components where they are not required.
  • Defend against symbolic-link escapes by validating canonical paths and using safe file-opening patterns appropriate to the platform.
  • Permit only regular files; reject devices, pipes, sockets, and directories.
  • Enforce a strict maximum file size before reading and avoid loading unbounded files entirely into memory.
  • Validate image magic bytes and decode the file with a trusted image parser. Do not rely only on filename extensions or MIME declarations.
  • Remove the undocumented --file alias if arbitrary file semantics are not intentionally supported.
  • Run the skill under a dedicated least-privileged operating-system account with access only to approved image directories.
  • Consider passing an already-authorized file handle or platform-managed attachment identifier instead of accepting raw filesystem paths.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (4)

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

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

md
---
name: llava-vision-local
version: 0.1.0
description: Call a local llama.cpp server with the LLaVA model to analyze images.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill explicitly accepts remote image URLs and states that it forwards images to a local llama.cpp/LLaVA server, but it does not clearly warn users that supplying a URL will cause the skill to fetch remote content and transmit the resulting image data to another local service for analysis. This creates an avoidable transparency and privacy risk: users may unintentionally cause network access to third-party hosts and send sensitive image contents into a model-serving process they did not realize was involved.

Content

No source excerpt is available for this finding.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding

Suspicious Unicode normalization or mixed-script content

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill sends user-supplied image content to a separate local HTTP service without any visible consent, disclosure, or restriction. Even though the endpoint is loopback-only, this still transfers potentially sensitive local file or remote-fetched image data to another process, which may log, retain, or further expose the content; the risk is elevated because the skill accepts arbitrary file paths and URLs as input.

Content

No source excerpt is available for this finding.