Summary
A server-side request forgery (SSRF) vulnerability in LobeHub's /webapi/proxy endpoint allows unauthenticated users to cause the backend to fetch arbitrary URLs.
When exploited, this can expose internal Vercel deployment details and enable reflected cookie injection on the lobehub.com domain, especially in environments where outbound access is not tightly constrained.
Affected context
The issue occurs in LobeHub's public-facing API where the /webapi/proxy endpoint accepts a URL in the POST body and performs a server-side fetch.
It is relevant in deployments where this endpoint is reachable without authentication and the backend has network access to external services or internal deployment metadata.
Risk increases when responses from these proxied requests are reflected to clients with minimal sanitization, allowing headers like Set-Cookie to be propagated.
Exploit preconditions
- Attack surface: Public
/webapi/proxyHTTP endpoint onapp.lobehub.com. - Required access: No authentication is required; any internet user who can send POST requests to the endpoint can attempt exploitation.
- Trigger point: Supplying a crafted URL in the POST body that the server-side proxy fetches and reflects back to the client.
- Why exploitation is possible: The proxy functionality trusts user-supplied URLs, performs outbound requests from LobeHub's infrastructure, and exposes response metadata (including headers) without adequate validation, filtering, or origin restrictions.
Why this happens
The vulnerability stems from implementing a generic server-side proxy that directly uses user-controlled URLs as the target of outbound requests.
This pattern fits CWE-918: Server-Side Request Forgery (SSRF), where a server exposes internal or privileged network capabilities by forwarding attacker-specified requests.
In this case, the proxy lacks authentication and strict allowlists, and it reflects downstream response data (including Set-Cookie headers) back to the client, combining network-layer SSRF with application-layer header injection risks.
Potential impact
- An attacker may cause LobeHub's backend to make arbitrary outbound HTTP(S) requests to external or internal endpoints.
- An attacker could leak information about Vercel deployment infrastructure and response details that are normally not exposed.
- An attacker can inject cookies on the
lobehub.comdomain through reflectedSet-Cookieheaders, potentially influencing session or application behavior. - The SSRF behavior could be chained with other weaknesses (e.g., misconfigured metadata services or internal admin endpoints) to escalate impact.
General mitigation guidance
Effective mitigation focuses on restricting how server-side proxy features consume and act on user input.
Common defensive patterns include:
- Enforcing strict allowlists or well-defined destination sets for outbound requests instead of accepting arbitrary user-supplied URLs.
- Introducing authentication and authorization checks for any endpoint that can trigger server-origin network calls.
- Normalizing and validating URLs, rejecting private, link-local, or internal address ranges, and blocking protocols other than HTTPS/HTTP where appropriate.
- Sanitizing or stripping sensitive response headers (e.g.,
Set-Cookie,Authorization,Set-Cookie2) before reflecting responses to clients. - Running backend services with least-privilege network and configuration access, and segmenting internal resources so a compromised proxy cannot easily reach sensitive services.
How teams detect issues like this
Detection typically involves a combination of design-time review and runtime monitoring:
- Static analysis or code review to identify endpoints that forward user-controlled URLs to outbound HTTP clients, especially in proxy or fetch utilities.
- Security architecture review to flag unauthenticated proxy endpoints and services that do not enforce destination allowlists or network egress policies.
- Logging and monitoring of outbound requests initiated by API endpoints, including anomaly detection for unusual destinations, protocols, or header patterns.
- Automated security testing (e.g., dynamic scanners, fuzzers) that probe for SSRF by supplying URLs to internal address ranges, cloud metadata endpoints, or sensitive service hostnames.

