Summary
An unauthenticated Server-Side Request Forgery (SSRF) flaw in MagicMirror²'s /cors endpoint allows remote attackers to coerce the server into making arbitrary HTTP requests on their behalf.
When exposed, this can be used to reach internal network services, cloud metadata endpoints, and localhost APIs, and to expand environment variable placeholders in requests, potentially leaking sensitive server-side secrets.
Affected context
This vulnerability affects MagicMirror² deployments that expose the /cors endpoint to untrusted networks, such as the internet or shared local networks.
It is most relevant when the MagicMirror² server:
- Has network access to internal services, metadata endpoints, or management interfaces
- Runs with environment variables containing secrets (API keys, tokens, credentials)
- Does not restrict which target URLs the
/corsendpoint may contact
In such environments, the SSRF can be used as a bridge into otherwise non-public resources.
Exploit preconditions
- Attack surface: HTTP(S) access to the MagicMirror²
/corsendpoint from an untrusted client. - Required access: None; the vulnerability is reachable without authentication when the endpoint is exposed.
- Trigger point: Sending crafted HTTP requests to
/corsthat specify attacker-controlled target URLs and environment variable placeholders. - Why exploitation is possible: The endpoint forwards user-supplied URLs as server-side HTTP requests without sufficient validation or allowlisting, and expands environment variable patterns directly in request parameters, leaking their values.
Why this happens
The core issue is a lack of strict validation and isolation around server-initiated outbound HTTP requests.
The /cors endpoint takes user-controlled input to determine where the server will connect and what data it will send, without robust restrictions on destination hosts, IP ranges, or URL schemes.
Additionally, the endpoint expands environment variable placeholders in the user-controlled input, effectively treating configuration secrets as interpolated template data.
This aligns with CWE-918: Server-Side Request Forgery, where an application uses attacker-controlled URLs to initiate server-side requests into potentially sensitive internal or external services.
Potential impact
- Unauthorized access to internal network services that are not directly exposed to the internet
- Interaction with cloud provider metadata services, potentially retrieving credentials or instance configuration
- Access to localhost-only services such as admin panels, databases, or management agents
- Exfiltration of environment variables, including API keys, tokens, passwords, and other secrets
- Use of the MagicMirror² server as a pivot point for further reconnaissance or attacks within the internal network
General mitigation guidance
Effective mitigation generally focuses on constraining server-initiated requests and eliminating secret interpolation in user-controlled input:
- Introduce strict allowlists for outbound destinations, limiting
/corsto a curated set of safe domains or services. - Block requests to private IP ranges, localhost, and cloud metadata IPs at the application level and, where feasible, via network controls.
- Remove or tightly scope environment variable expansion in any parameter influenced by client input; avoid exposing configuration values to HTTP response bodies.
- Place MagicMirror² behind network boundaries so the
/corsendpoint is not reachable from untrusted networks. - Run the server with least-privilege configuration: minimal environment secrets and reduced access to internal network segments.
These patterns reduce the harm even if some proxy-like functionality must remain available.
How teams detect issues like this
Organizations can detect and monitor SSRF-style risks in several ways:
- Static analysis: Flag code paths where user input is concatenated into URLs or passed directly into HTTP client libraries without host validation or allowlisting.
- Code review: Look for generic proxy/CORS endpoints and features that forward arbitrary URLs or expand environment variables in request templates.
- Runtime monitoring: Track outbound HTTP traffic from MagicMirror² servers for unusual destinations (e.g., 169.254.169.254, 127.0.0.1, RFC1918/4193 ranges) and anomalous spikes in egress.
- Configuration and policy checks: Enforce deployment policies that forbid exposure of diagnostic/proxy endpoints to the internet and restrict access to metadata services at the network layer.
Automated security testing tools and SSRF-focused scanners can complement manual review to discover similar patterns early.

