other
- Location
dist/src/mcp-client.js:377- Finding
Unrestricted attachment download URLs permit gateway-side SSRF ## Remediation Suggestions 1. Replace the direct fetch with an SSRF-protected download implementation. 2. Require HTTPS and restrict download destinations to explicitly approved origins or a narrowly scoped deployment-specific allowlist. 3. Validate resolved IPv4 and IPv6 addresses, rejecting loopback, private, link-local, multicast, unspecified, and other prohibited ranges. 4. Bind connections to validated destinations to prevent DNS-rebinding bypasses. 5. Disable redirects by default. If redirects are necessary, validate every redirect URL and its resolved addresses before following it. 6. Permit private-deployment exceptions only through explicit administrator configuration. 7. Preserve existing timeout, size, and attachment-count limits, and add regression tests covering internal destinations, redirects, and DNS-based bypasses.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/dist/src/mcp-client.js:377–383,signedMedia()
Vulnerability Type: Server-Side Request Forgery (CWE-918)
Risk Level: MediumVulnerable Code
js const url = typeof data.download_url === "string" ? data.download_url : ""; if (!/^https?:\/\//.test(url)) throw new Error("get_media_download_url returned no download_url"); const signals = [AbortSignal.timeout(opts?.timeoutMs ?? MEDIA_TIMEOUT_MS)]; if (opts?.signal) signals.push(opts.signal); return await this.fetchImpl(url, { method: "GET", signal: AbortSignal.any(signals) });Technical Analysis
The plugin retrieves an attachment URL from the remote
get_media_download_urltool and validates only its HTTP(S) scheme. It then requests that URL directly from the gateway process.There is no destination allowlist, private-address filtering, or explicit redirect validation. Consequently, a malicious or compromised API can direct attachment downloads toward loopback, private-network, or link-local destinations reachable by the gateway. The direct fetch bypasses the host media-loading abstraction used elsewhere for outbound media.
The request does not include the Filament bearer token. Download size, timeout, and attachment-count limits constrain resource consumption but do not prevent requests to sensitive destinations.
This behavior is established by static inspection. Attacker control of the API response is a prerequisite; the reviewed code does not establish that an ordinary chat participant can choose the returned URL.
Attack Path
- The attacker controls the configured Filament API or compromises its responses.
- The API supplies a work item containing an attachment with a message identifier.
- Automatic inbound-media processing requests a URL through
get_media_download_url. - The attacker returns an HTTP(S) URL targeting a gateway-accessible internal service.
signedMedia()accepts the URL and performs a GET request f ...[truncated 931 chars]
