efek.me/blog

Unrestricted URL Fetch in the upload_file Tool of @wiro-ai/wiro-mcp

October 17, 2026•11 min read•Cybersecurity
Unrestricted URL Fetch in the upload_file Tool of @wiro-ai/wiro-mcp

Overview

During a security review of Wiro-MCP, the official Model Context Protocol (MCP) server for Wiro AI, I identified an unrestricted URL fetch vulnerability in the upload_file tool.

The tool accepts an arbitrary URL parameter and downloads its content without validating the network scheme, protocol, or destination IP address. Because @wiro-ai/wiro-mcp runs locally on the user's host machine with the user's own credentials, the issue is classified as Low Severity.

PropertyDetails
CVE IdentifierCVE-2026-134553
Target ProjectWiro-MCP (github.com/wiroai/Wiro-MCP)
Package@wiro-ai/wiro-mcp (npm)
Affected Versions≤ 1.3.0
ResearcherEfe Kırbaş
Vulnerable Toolupload_file — "Upload a file from URL for use as model input"
Vulnerability ClassCWE-918: Server-Side Request Forgery (SSRF) / Unrestricted URL Fetch
Reported ToWiro AI Team
SeverityLow
StatusPatched in v1.3.1 / Disclosed

Deployment Model & Severity

The @wiro-ai/wiro-mcp package runs locally on the user's host machine (e.g., invoked via standard I/O in local agent environments such as Claude Desktop, Cursor, or CLI tooling) and executes under the user's existing system permissions and API key.

Because the MCP server executes locally rather than as a hosted multi-tenant service, the network reach is confined to what the user's local workstation can already access. Accordingly, the issue is categorized as Low Severity — representing a defense-in-depth weakness where an automated model prompt could instruct the tool to make unintended internal network requests.


Coordinated Disclosure & Vendor Response

I reported the vulnerability directly to the Wiro AI engineering team under responsible disclosure principles on 16 October 2026.

The Wiro team reviewed the finding promptly, verified the report, and confirmed that the package runs on the user's local machine with the user's own API key. They agreed that URL validation should be enforced to protect against automated models requesting unintended targets.

Wiro released an official patch the very same day (16 October 2026) in version 1.3.1 on npm, introducing strict destination validation and download limits via commit ac61f79 ("fix: restrict upload_file downloads to public http(s) hosts").


Affected Components

The vulnerability stems from two layers: permissive input schema validation and direct URL invocation without transport restrictions.

FileFunction / ScopeLinesVulnerable Aspect
src/tools/upload-file.tsregisterUploadFile()8–84 (esp. 16–18)Input schema uses only z.string().url()
src/client.tsWiroClient.uploadFile()316–350 (esp. 316–320)fetch(fileUrl) called directly without target IP/protocol checks

Root Cause Analysis

Layer 1: Tool Input Validation (upload-file.ts)

In src/tools/upload-file.ts, the input schema for the upload_file tool validates the incoming url parameter solely via Zod's z.string().url():

Input Schema Validation in upload-file.ts

As highlighted in the source code above:

  • No Protocol Allowlist: Any protocol (e.g., file://, ftp://, gopher://, data:) is accepted without verification.
  • No Private or Internal IP Filtering: Standard private network address spaces (RFC 1918) and loopback addresses (127.0.0.1, localhost) are not blocked.

Because z.string().url() only enforces syntactic conformance to generic URI structure (RFC 3986), any syntactically valid URL passes down to the client without security constraints.

Layer 2: HTTP Invocation & File Upload (client.ts)

Once the URL passes schema validation, it is forwarded directly to WiroClient.uploadFile():

Unrestricted fetch call in client.ts

As shown in src/client.ts:

  • The URL is passed directly into the global fetch() call without prior IP verification or protocol restrictions.
  • The retrieved response body is converted into a Blob and subsequently uploaded to the user's Wiro account via /File/Upload as model input.
  • While the resulting file lands in the user's own Wiro account, an automated agent or prompt could still trigger unwanted requests against internal network destinations that the host machine can reach.

Exploitation Scenarios

All of the following URL structures satisfy z.string().url() and are forwarded directly into fetch():

Scenario A — Internal Network Reconnaissance

{
  "tool": "upload_file",
  "arguments": {
    "url": "http://10.0.0.1:8080/admin"
  }
}
  • Impact: An agent or prompt injection payload could instruct the tool to make HTTP requests against internal non-routable addresses (RFC 1918) or router administration interfaces that the local machine can reach on its local area network (LAN).

Scenario B — Local File Scheme (file://)

{
  "tool": "upload_file",
  "arguments": {
    "url": "file:///etc/passwd"
  }
}
  • Observation: While file:// schemes passed the z.string().url() schema check, Node.js's built-in fetch() implementation does not support file:// schemes by default and throws a protocol error upon execution. As confirmed during verification by the Wiro engineering team, direct local file disclosure via file:// does not succeed under standard Node.js runtimes.

Proof of Concept (PoC) Validation

To demonstrate why generic URL format validation is insufficient on its own and requires network/IP-level validation, a standalone Python simulation script (poc_ssrf_validation.py) was evaluated:

"""
PoC - SSRF Doğrulama Simülasyonu
Paket: @wiro-ai/wiro-mcp v1.3.0
Dosya: src/tools/upload-file.ts

Bu script, z.string().url() doğrulamasının tehlikeli URL'leri
kabul ettiğini simüle eder. Zod (JS) doğrulaması yerine
Python'da aynı URL format kontrolü simülasyonu yapılır.
"""

from urllib.parse import urlparse

malicious_urls = [
    "http://127.0.0.1:8080/",
    "http://localhost:3000/admin",
    "http://10.0.0.1/internal-api",
    "http://192.168.1.1/router-admin",
    "http://172.16.0.1/secret",
    "file:///etc/passwd",
    "http://[::1]:8080/",
]

def is_valid_url(url: str) -> bool:
    """z.string().url() davranışını simüle eder - sadece format kontrolü yapar."""
    try:
        result = urlparse(url)
        return bool(result.scheme and result.netloc) or result.scheme == "file"
    except Exception:
        return False

print("=" * 60)
print("  Mevcut z.string().url() Doğrulaması (Simülasyon)")
print("  Paket: @wiro-ai/wiro-mcp - upload-file.ts")
print("=" * 60)
print()

for url in malicious_urls:
    accepted = is_valid_url(url)
    status = "KABUL (TEHLİKELİ)" if accepted else "REDDEDİLDİ"
    symbol = "[+]" if accepted else "[-]"
    print(f"  {symbol} {status}  ->  {url}")

print()
print("-" * 60)
print("  SONUÇ: Format kontrolünden tüm iç adresler geçiyor.")
print("  z.string().url() sadece sözdizimi kontrolü yapar,")
print("  protokol veya IP adresi kısıtlaması uygulamaz.")
print("-" * 60)
print()

# ---- Kavramsal filtreleme mantığı (Simülasyon) ----
BLOCKED_PATTERNS = [
    "localhost",
    "127.", "10.", "0.",
    "192.168.", "169.254.",
    "::1",
]

BLOCKED_PREFIXES_172 = range(16, 32)

def is_safe_url(url: str) -> bool:
    """Kavramsal IP kontrol mantığı simülasyonu."""
    parsed = urlparse(url)
    if parsed.scheme not in ("http", "https"):
        return False
    hostname = parsed.hostname or ""
    hostname = hostname.lower().strip("[]")
    for pattern in BLOCKED_PATTERNS:
        if hostname.startswith(pattern) or hostname == pattern:
            return False
    if hostname.startswith("172."):
        parts = hostname.split(".")
        if len(parts) >= 2:
            try:
                second = int(parts[1])
                if second in BLOCKED_PREFIXES_172:
                    return False
            except ValueError:
                pass
    return True

print("=" * 60)
print("  Kavramsal Filtreleme Simülasyonu")
print("=" * 60)
print()

for url in malicious_urls:
    accepted = is_safe_url(url)
    status = "KABUL" if accepted else "ENGELLENDİ"
    symbol = "[+]" if accepted else "[X]"
    print(f"  {symbol} {status}  ->  {url}")

print()
print("-" * 60)
print("  SONUÇ: Özel ve yerel ağ adresleri filtrelendi.")
print("-" * 60)

Execution Output:

PoC URL Validation Output

Key Observations:

  1. Format Validation Limitation: The simulation highlights that string format validators (such as z.string().url()) only verify URI structure, meaning internal IP addresses and LAN targets are treated as valid URLs.
  2. Official Remediation in v1.3.1: Rather than relying on simple URL string parsing, Wiro AI implemented robust network-level protection in src/utils/remote-file.ts that runs DNS lookups at the socket level and manually validates each redirect hop.

Remediation & Implementation in v1.3.1

In version 1.3.1, Wiro AI addressed the issue by introducing src/utils/remote-file.ts with fetchPublicFile():

  • Protocol Restriction: Only http: and https: schemes are accepted.
  • Socket-Level DNS Verification: Destination IP addresses are verified directly during the socket's DNS lookup, ensuring the connected IP is validated before data is sent (mitigating DNS rebinding).
  • Private IP Filtering: Loopback, link-local, and RFC 1918 private IPv4/IPv6 ranges are blocked.
  • Redirect Tracking: HTTP redirects are handled manually, with destination addresses re-checked at every hop (up to 5 redirects).
  • Resource Limits: Enforced maximum download size (200MB) and download timeout (120 seconds).

Disclosure Timeline

  • 16 October 2026: Vulnerability reported to Wiro AI engineering team under coordinated disclosure.
  • 16 October 2026: Wiro AI team verified the report, clarified the local user execution model, and released the official fix in version 1.3.1 on npm the same day.
  • October 2026: Coordinated disclosure completed and write-up published following vendor review.

References