Anonymous Intelligence Signal

GitHub Security Review: fetchViaProxy Function Exposes SSRF Risk via Unvalidated URL Input

human The Lab unverified 2026-04-05 18:26:59 Source: GitHub Issues

A critical security review of a codebase has identified a Server-Side Request Forgery (SSRF) vulnerability within a core CORS proxy service. The `fetchViaProxy` function, located in `src/services/cors-proxy.ts`, accepts any user-supplied URL string and passes it directly to external proxy services without performing basic protocol or hostname validation. This design flaw allows attackers to potentially redirect requests to internal network services, local files, or other unintended destinations, bypassing standard network security boundaries.

The vulnerability stems from lines 126–141 in the `cors-proxy.ts` file. While the code uses `encodeURIComponent` to prevent URL injection into the proxy's own address, it fails to sanitize the *target* URL parameter before the proxy fetches it. This means a caller could pass malicious strings like `file:///etc/passwd` to probe the local filesystem, `http://127.0.0.1:8080` to attack internal services, or other non-standard protocols. The issue is classified as a MEDIUM severity SSRF/Protocol Confusion risk.

Direct callers of this vulnerable function are now under scrutiny. The review specifically flags `cheesefork.ts` at line 93, where `fetchViaProxy` is invoked with a JavaScript file URL, as an immediate point of exposure. This pattern suggests the unvalidated URL parameter could be exploited anywhere the function is used, potentially turning a routine external data fetch into a vector for internal network reconnaissance or data exfiltration. The finding underscores a systemic code-smell where trust in upstream data is misplaced, requiring a review of all integration points.