Summary
SiYuan's /api/network/forwardProxy endpoint allows authenticated users to trigger arbitrary HTTP requests from the server to attacker-controlled URLs.
Because the URL parameter is not validated or restricted, this behavior can be abused to reach internal services, localhost, or cloud metadata endpoints that are otherwise not directly accessible to the user.
Affected context
The issue occurs in SiYuan deployments that expose the /api/network/forwardProxy endpoint to authenticated users.
When this endpoint accepts a fully user-controlled URL and forwards the request from the server environment without any network or scheme restrictions, the server effectively acts as an open HTTP proxy.
In environments where SiYuan runs inside a network with internal services, management interfaces, or cloud metadata endpoints, this proxy behavior can bridge otherwise isolated network boundaries.
Exploit preconditions
- Attack surface: HTTP API endpoint
/api/network/forwardProxyreachable to authenticated users. - Required access: Valid authenticated user session within the SiYuan instance (no special roles implied).
- Trigger point: Submission of a request to
/api/network/forwardProxywith a crafted URL parameter targeting internal, loopback, or metadata endpoints. - Why exploitation is possible: The server trusts and forwards arbitrary user-supplied URLs, performing HTTP requests from its own network context, without URL, host, or scheme validation, and returns full response bodies and headers to the caller.
Why this happens
This vulnerability is a classic case of Server-Side Request Forgery (SSRF) as described by CWE-918.
The application exposes an HTTP forwarding/proxy feature that accepts user-controlled URLs and performs outbound requests from the server without applying any constraints on target addresses, protocols, or network segments.
By failing to treat the URL as untrusted input and omitting checks for internal IP ranges (e.g., 127.0.0.1, 169.254.169.254, RFC1918 networks), administrative endpoints, or metadata services, the server becomes a pivot point to access resources not intended to be reachable from the user's network position.
Potential impact
- Access to internal web services and APIs that are not exposed to the public network.
- Retrieval of sensitive configuration or instance metadata, including potential cloud credentials from metadata services.
- Interaction with admin panels, monitoring dashboards, or management interfaces bound only to localhost or internal IPs.
- Use of the server as a proxy to obfuscate the origin of malicious traffic against internal or external targets (limited by HTTP capabilities).
- Enumeration of internal network structure via observable differences in response codes, headers, and timing.
General mitigation guidance
Effective mitigation typically focuses on constraining where server-initiated HTTP requests are allowed to go and reducing trust in user-supplied URLs:
- Apply strict allowlists for outbound targets, such as specific domains or service endpoints that the proxy is meant to reach.
- Block requests to IP address literals and private or loopback ranges (e.g., 127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, link-local and metadata ranges).
- Enforce scheme restrictions (e.g., only allow
httpsandhttp, disallowfile,gopher,ftpor other less common schemes). - Normalize and re-parse user input before validation to avoid bypasses through redirects, DNS rebinding, or encodings.
- Consider limiting or removing generic "forward proxy" functionality unless it has a clearly defined, minimal-use case.
- Run the application with least-privilege network permissions and segment sensitive services into separate networks where possible.
How teams detect issues like this
Detection efforts can focus on both code-level and operational signals:
- Static analysis and code review:
- Flag endpoints that perform server-side HTTP requests based on user-supplied URLs or hostnames.
- Look for usages of generic HTTP client libraries (
fetch,axios,requests,http.Client, etc.) where URL parameters are influenced directly by request data. - Verify that any proxy-like feature implements explicit allowlists or robust deny rules for internal IP ranges and disallowed schemes.
- Configuration and policy checks:
- Apply security policies that disallow unbounded outbound HTTP proxy features in backend services.
- Use infrastructure-level egress controls (firewalls, security groups, service meshes) to restrict backend access to metadata and internal management interfaces.
- Runtime monitoring:
- Log and analyze outbound HTTP requests, especially those targeting private IP ranges, loopback addresses, or known metadata IPs.
- Set alerts for unusual patterns such as bursts of requests to internal ranges originating from web application processes.
Automated code scanning tools and SAST/IAST solutions can be configured with SSRF-specific rules to highlight risky proxy-like behaviors during development and CI.

