CVE-2026-4021: Contest Gallery <= 28.1.5 - Unauthenticated Privilege Escalation Admin Account Takeover via Registration Confirmation Email-to-ID Type Confusion
The Contest Gallery plugin for WordPress is vulnerable to an authentication bypass leading to admin account takeover in all versions up to, and including, 28.1.5. This is due to the email confirmation handler in users-registry-check-after-email-or-pin-confirmation.php using the user's email string in a WHERE ID = %s clause instead of the numeric user ID, combined with an unauthenticated key-based login endpoint in ajax-functions-frontend.php. When the non-default RegMailOptional=1 setting is enabled, an attacker can register with a crafted email starting with the target user ID (e.g., 1poc@example.test), trigger the confirmation flow to overwrite the admin's useractivationkey via MySQL integer coercion, and then use the postcg1lloginuserbykey AJAX action to authenticate as the admin without any credentials. This makes it possible for unauthenticated attackers to take over any WordPress administrator account and gain full site control.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-4021?
CVE-2026-4021 is categorized as a critical vulnerability due to its potential for unauthenticated privilege escalation and admin account takeover.
How do I fix CVE-2026-4021?
To remediate CVE-2026-4021, update the Contest Gallery plugin to version 28.1.6 or later.
Who is affected by CVE-2026-4021?
CVE-2026-4021 affects all installations of the Contest Gallery plugin for WordPress up to and including version 28.1.5.
Can CVE-2026-4021 lead to data breaches?
Yes, CVE-2026-4021 can potentially lead to data breaches as it allows attackers to take control of admin accounts.
Is user action required to exploit CVE-2026-4021?
No, CVE-2026-4021 can be exploited without any user action, making it particularly dangerous.