ช่องโหว่ Privilege Escalation — CVE-2026-126721 (CVSS 7.5)
📋 สรุปช่องโหว่
ช่องโหว่ Privilege Escalation ใน WordPress Plugin "Magic Login Mail or QR Code" ถูกค้นพบโดยมี CVSS Score 7.5 ระดับ "สูง"
ช่องโหว่นี้ทำให้ผู้ใช้ที่มีสิทธิ์ต่ำ (เช่น Subscriber หรือ Contributor) สามารถยกระดับสิทธิ์ตัวเองเป็น Administrator ได้โดยไม่ได้รับอนุญาต ปัญหาเกิดจากการตรวจสอบ permission ที่ไม่รัดกุมในฟังก์ชันสำคัญของระบบ
แม้ว่าการโจมตีนี้ต้องมีบัญชีในระบบ แต่ความเสียหายที่เกิดขึ้นได้นั้นเทียบเท่ากับการที่ผู้โจมตีได้รับสิทธิ์ Admin เต็มรูปแบบ
💥 ผลกระทบที่อาจเกิดขึ้น
ผลกระทบเมื่อผู้โจมตียกระดับสิทธิ์สำเร็จ:
• ควบคุมเว็บไซต์สมบูรณ์: เข้าถึงทุกส่วนของ Admin Dashboard
• แก้ไข/ลบเนื้อหาทั้งหมด: ทำลาย SEO และชื่อเสียงองค์กร
• ติดตั้ง Plugin อันตราย: เพิ่ม backdoor หรือ malware เข้าไปในระบบ
• ขโมยข้อมูลผู้ใช้: เข้าถึงข้อมูลสมาชิกทั้งหมด
• เปลี่ยน Admin Password: ล็อกเจ้าของเว็บออกจากระบบ
• สร้าง Admin Account ใหม่: สร้าง backdoor account สำหรับเข้าใช้ในอนาคต
🖥️ ซอฟต์แวร์และระบบที่ได้รับผลกระทบ
WordPress Plugin: Magic Login Mail or QR Code
ตรวจสอบเวอร์ชันที่ได้รับผลกระทบที่ https://nvd.nist.gov/vuln/detail/CVE-2026-126721
🔧 แนวทางการแก้ไขและป้องกัน
- ขั้นตอนแก้ไข:
- 1. อัพเดตทันที: อัพเดตซอฟต์แวร์เป็นเวอร์ชันที่แก้ไขช่องโหว่แล้ว
- 2. ตรวจสอบ User Accounts: ดู Users > All Users ใน WordPress หาบัญชีที่ไม่รู้จักหรือมีสิทธิ์ผิดปกติ
- 3. ตรวจสอบ Admin Accounts: ยืนยันว่า admin ทุกบัญชีเป็นบัญชีที่คุณรู้จักและสร้างขึ้นเอง
- 4. Review Activity Logs: ตรวจสอบประวัติการ login และการเปลี่ยนแปลงสิทธิ์ย้อนหลัง
- 5. เปลี่ยนรหัสผ่าน Admin: เปลี่ยนรหัสผ่านทุก admin account เป็นรหัสผ่านที่แข็งแกร่ง
- 6. Principle of Least Privilege: จำกัดการสร้างบัญชีในระบบให้เฉพาะผู้ที่จำเป็น
📄 รายละเอียดต้นฉบับ (ภาษาอังกฤษ)
The Magic Login Mail or QR Code plugin for WordPress is vulnerable to Privilege Escalation via Administrator Account Takeover in versions up to, and including, 2.07. This is due to the `curpageurl()` function falling back to the raw `$_SERVER['HTTP_HOST']` value — with no validation against the site's configured origin via `home_url()` or `site_url()` — when `get_the_permalink()` returns empty or false, allowing an attacker-controlled Host header to become the URL origin of the magic-login link generated by `generate_url()` and delivered to the target via `wp_mail()`. This makes it possible for unauthenticated attackers to intercept the one-time uid and token pair sent to a targeted Administrator's email and replay them against the real site, causing `autologin_via_url()` to call `wp_set_auth_cookie()` and establish a full Administrator session on the targeted account. Exploitation requires the `[magic_login]` shortcode to render on a path where `get_the_permalink()` returns empty or false (such as a 404 page or a block-theme header template part), the web server to forward non-canonical Host headers, the attacker to know the target administrator's email address, and the administrator to click the attacker-originated magic-login link. Successful exploitation gives the attacker control of a distinct, already-privileged Administrator account; it does not promote the attacker's original account. Successful exploitation additionally requires an action by an administrator — the attacker cannot trigger the vulnerability on their own.