WordPress Contest Gallery Plugin Unauthenticated Blind SQL Injection — CVE-2026-3180
by cardosource · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-3180
- Category
- web
- Affected product
- WordPress "Contest Gallery" plugin
- Affected versions
- <= 28.1.4
- Disclosed
- 2026-07-05
- Patch status
- unpatched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-06 |
| Author / Researcher | cardosource |
| CVE / Advisory | CVE-2026-3180 |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | wordpress, sqli, blind-sqli, plugin, admin-ajax, unauthenticated, php, boolean-based |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | WordPress “Contest Gallery” plugin |
| Versions Affected | <= 28.1.4 |
| Language / Platform | Python 3 (PoC), PHP/WordPress (target) |
| Authentication Required | No |
| Network Access Required | Yes |
Summary
The Contest Gallery WordPress plugin passes the cgl_maili parameter through WordPress’s sanitize_email() function, which preserves the single-quote character (') in the local part of an email address. Because the sanitized value is subsequently used to build a $wpdb->get_row() query without going through $wpdb->prepare(), an attacker can smuggle a single quote past sanitization and into the SQL query, enabling unauthenticated boolean-based blind SQL injection via the plugin’s AJAX endpoint (admin-ajax.php, cgl_mail action).
Vulnerability Details
Root Cause
sanitize_email() does not strip the single-quote character from the local part of an email-formatted parameter (cgl_maili), and the resulting value reaches $wpdb->get_row() without parameterization via $wpdb->prepare(), allowing SQL syntax to be injected.
Attack Vector
- Attacker obtains a valid WordPress nonce from a public page served by the Contest Gallery plugin.
- Attacker sends a crafted request to
/wp-admin/admin-ajax.phpwith thecgl_mailaction, setting thecgl_mailiparameter to an email-like string containing a single quote and boolean SQL injection payload. sanitize_email()passes the quote through unmodified, and the value reaches$wpdb->get_row()unparameterized.- The attacker uses boolean-based blind injection techniques (true/false response differences) to extract data from the WordPress database without authentication.
Impact
Unauthenticated blind SQL injection against the WordPress database backing any site running the vulnerable Contest Gallery plugin version, potentially exposing all database contents (user credentials, site configuration, etc.).
Environment / Lab Setup
Target: WordPress with Contest Gallery plugin <= 28.1.4 installed and active
Attacker: Python 3 with an HTTP client library (requests)
Proof of Concept
PoC Script
See
cve-2026-3180.pyin this folder.
| |
The script obtains/accepts a valid nonce, then sends crafted cgl_maili values containing boolean SQL injection payloads to /wp-admin/admin-ajax.php (cgl_mail action), inferring true/false conditions from response differences to demonstrate blind SQL injection.
Detection & Indicators of Compromise
Signs of compromise:
admin-ajax.phpaccess logs withcgl_mailaction requests containing',AND,OR,SLEEP(), or similar SQLi indicators- Abnormal response-time patterns on the
cgl_mailendpoint consistent with time-based blind SQLi probing - Database query logs showing malformed
WHEREclauses originating from the plugin’s mail-lookup query
Remediation
| Action | Detail |
|---|---|
| Primary fix | No vendor patch confirmed as of 2026-07-05 — monitor for advisory; upgrade Contest Gallery once a fixed version is released |
| Interim mitigation | Use a WAF rule to block SQL metacharacters in the cgl_maili parameter; disable or restrict the Contest Gallery plugin until patched |
References
Notes
Mirrored from https://github.com/cardosource/cve-2026-3180 on 2026-07-05.
| |