Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-4021: CWE-287 Improper Authentication in contest-gallery Contest Gallery – Upload & Vote Photos, Media, Sell with PayPal & Stripe

0
High
VulnerabilityCVE-2026-4021cvecve-2026-4021cwe-287
Published: Mon Mar 23 2026 (03/23/2026, 23:25:50 UTC)
Source: CVE Database V5
Vendor/Project: contest-gallery
Product: Contest Gallery – Upload & Vote Photos, Media, Sell with PayPal & Stripe

Description

CVE-2026-4021 is a high-severity authentication bypass vulnerability in the Contest Gallery WordPress plugin, affecting all versions up to 28. 1. 5. The flaw arises from improper handling of user identification in the email confirmation process, where the plugin uses the email string in a database query expecting a numeric user ID. When the RegMailOptional=1 setting is enabled, an attacker can craft an email starting with a target user ID to overwrite the admin's activation key via MySQL integer coercion. This allows unauthenticated attackers to log in as any administrator through an AJAX endpoint without credentials, leading to full site takeover. No known exploits are currently in the wild. Organizations using this plugin with the vulnerable setting enabled are at significant risk of complete compromise. Immediate patching or disabling the plugin is recommended to prevent exploitation.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 03/24/2026, 00:04:34 UTC

Technical Analysis

The Contest Gallery plugin for WordPress, widely used for managing photo contests and media sales, contains a critical authentication bypass vulnerability (CVE-2026-4021) due to improper authentication (CWE-287). The vulnerability stems from the email confirmation handler in the file users-registry-check-after-email-or-pin-confirmation.php, which incorrectly uses the user's email string in a SQL WHERE clause expecting a numeric user ID. Specifically, the query uses WHERE ID = %s with the email string, causing MySQL to coerce the string to an integer, which can be exploited when the RegMailOptional=1 setting is enabled. An attacker can register an account with a crafted email starting with the numeric ID of a target administrator (e.g., '1poc@example.test' where '1' is the admin user ID). During the confirmation process, this crafted email causes the admin's user_activation_key to be overwritten. Subsequently, the attacker can leverage an unauthenticated AJAX login endpoint (post_cg1l_login_user_by_key in ajax-functions-frontend.php) to authenticate as the admin without any credentials. This bypasses all authentication controls and grants full administrative access to the attacker. The vulnerability affects all versions up to and including 28.1.5. Although no public exploits are known yet, the ease of exploitation and the impact of full admin takeover make this a critical threat. The vulnerability requires the non-default RegMailOptional=1 setting to be enabled, which may limit exposure but still poses a severe risk to affected sites. The CVSS v3.1 score is 8.1, reflecting high impact on confidentiality, integrity, and availability with no privileges or user interaction required but with high attack complexity due to the specific setting requirement.

Potential Impact

Successful exploitation of CVE-2026-4021 allows unauthenticated attackers to gain full administrative control over WordPress sites running the vulnerable Contest Gallery plugin with the RegMailOptional=1 setting enabled. This leads to complete compromise of the affected website, including the ability to modify content, install malicious plugins or backdoors, steal sensitive data, and disrupt site availability. Organizations relying on this plugin for contest management or media sales risk reputational damage, data breaches, and potential financial losses. Since WordPress powers a significant portion of the web, the vulnerability could be leveraged in targeted attacks against high-profile sites or used in widespread automated attacks once exploits become available. The requirement of a specific plugin setting reduces the attack surface but does not eliminate the risk, especially for sites that have customized configurations. The impact extends beyond the website itself, potentially affecting connected systems and users through compromised administrative privileges.

Mitigation Recommendations

1. Immediately update the Contest Gallery plugin to a patched version once released by the vendor. Monitor official channels for patch announcements. 2. If patching is not immediately possible, disable the Contest Gallery plugin to eliminate the attack vector. 3. Review and disable the RegMailOptional=1 setting in the plugin configuration to prevent exploitation of the email coercion flaw. 4. Implement web application firewall (WAF) rules to block suspicious AJAX requests targeting the post_cg1l_login_user_by_key endpoint, especially from unauthenticated sources. 5. Audit user accounts for unauthorized changes to user_activation_key or suspicious registrations with crafted emails. 6. Enforce strict input validation and sanitization on user registration fields to prevent injection or coercion attacks. 7. Monitor logs for unusual login activity or AJAX requests related to the plugin. 8. Educate site administrators about the risks and encourage regular plugin updates and security best practices. 9. Consider isolating or sandboxing the plugin functionality if possible to limit impact. 10. Conduct a full security review and incident response if compromise is suspected.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
Wordfence
Date Reserved
2026-03-11T20:10:49.726Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 69c1d4a7f4197a8e3ba0b3f5

Added to database: 3/24/2026, 12:02:47 AM

Last enriched: 3/24/2026, 12:04:34 AM

Last updated: 3/24/2026, 5:19:45 AM

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses