Contest Gallery <= 28.1.5 - Unauthenticated Privilege Escalation Admin Account Takeover via Registration Confirmation Email-to-ID Type Confusion
Strategic Overview
- Status
- Patched in 28.1.6
- Affected Version
<= 28.1.5- CVSS
- 8.1High
- Weakness type
- CWE-287 · Improper Authentication
- CVE
CVE-2026-4021
At a glance
CVE-2026-4021 is a high-severity Improper Authentication vulnerability in the Contest Gallery WordPress plugin, affecting versions <= 28.1.5. It carries a CVSS score of 8.1 (reachable over the network; high confidentiality, integrity, availability impact). Exploitation requires no authentication. The issue is fixed in version 28.1.6; sites on affected versions should update now. Disclosed March 2026, reported by Supakiad S. (m3ez) (m3ez).
Vulnerability Overview
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 `user_activation_key` via MySQL integer coercion, and then use the `post_cg1l_login_user_by_key` 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.
Technical Analysis
The vector marks this flaw as remotely reachable over the network, and no privileges on the target site, and no interaction from a victim user. A successful exploit has high impact on confidentiality, integrity, availability — full site compromise territory.
CWE-287: Improper Authentication
Reaching this weakness in Contest Gallery <= 28.1.5 takes no account at all. Improper authentication means the mechanism that proves who a caller is can be satisfied without the secret it was supposed to require.
An attacker authenticates as another user — administrators included — without ever knowing a password, so password policies and login rate limits never come into play. For Contest Gallery the fix is 28.1.6: builds <= 28.1.5 are affected, anything from 28.1.6 onward is not.
Remediation
Update to version 28.1.6, or a newer patched version
How does WordSec protect against this?
This one needs no account at all, which puts it outside what login hardening can reach; WordSec's login security narrows the account-level paths around it, and the firewall is what inspects the request itself. None of that substitutes for the fix: Contest Gallery 28.1.6 closes this, and updating the plugin is the step that ends it.
- Login Security
- Alerts
External References
Related records
Other vulnerabilities in Contest Gallery – Upload & Vote Photos, Media, Sell with PayPal & Stripe
- 9.9CVE-2024-30238: Photos and Files Contest Gallery SQL Injection
CVE-2024-30238 - 9.9CVE-2024-30236: Photos and Files Contest Gallery SQL Injection
CVE-2024-30236 - 9.8CVE-2024-11103: Contest Gallery Arbitrary Password Reset
CVE-2024-11103 - 9.8CVE-2024-10687: Photos, Files, YouTube, Twitter… SQL Injection
CVE-2024-10687 - 9.8CVE-2021-24915: Contest Gallery SQL Injection
CVE-2021-24915 - 8.8CVE-2026-12165: Contest Gallery <= 30.0.2 Privilege Escalation
CVE-2026-12165 - 8.8CVE-2022-4150: Contest Gallery (Pro) <= 19.1.5 SQL Injection
CVE-2022-4150 - 8.8CVE-2022-36394: Contest Gallery <= 17.0.4 SQL Injection
CVE-2022-36394
Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C