CVE-2026-8832
Description
The WPCode - Insert Headers and Footers + Custom Code Snippets - WordPress Code Manager plugin for WordPress is vulnerable to Remote Code Execution in versions up to, and including, 2.3.5 This is due to the 'wpcode' custom post type being registered without a custom capability_type or capability restrictions in the wpcode_register_post_type() function, allowing WordPress core to fall back to standard post capabilities for all creation paths including XML-RPC. This makes it possible for authenticated attackers, with author-level access and above, to create and publish executable PHP snippet posts via XML-RPC wp.newPost, which are then executed server-side via eval() in the run_eval() function when the snippet is rendered through the [wpcode] shortcode.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The WPCode plugin <=2.3.5 allows authenticated authors+ to create executable PHP snippets via XML-RPC due to missing custom capabilities, leading to remote code execution.
Vulnerability
The WPCode plugin for WordPress, versions up to and including 2.3.5, is vulnerable to Remote Code Execution. The wpcode custom post type is registered without a custom capability_type or capability restrictions in the wpcode_register_post_type() function [4]. This causes WordPress to fall back to standard post capabilities, allowing users with author-level access and above to create and publish PHP snippet posts via XML-RPC using wp.newPost [1][2]. The snippet content is later executed server-side via eval() in the run_eval() function when the [wpcode] shortcode is rendered [1][2].
Exploitation
An attacker must have an authenticated WordPress account with author-level privileges or higher. The attacker sends an XML-RPC request using the wp.newPost method to create a new wpcode post with a PHP code snippet, setting the post status to 'publish' and the code type to 'php'. Once published, the snippet is executed when the [wpcode] shortcode is processed on any page, calling eval() on the snippet code [1][2]. No additional user interaction is required beyond the initial authentication.
Impact
Successful exploitation allows an authenticated attacker to execute arbitrary PHP code on the server, leading to full compromise of the WordPress site. The attacker can read, modify, or delete any data, install malicious plugins, or perform further attacks against the server [1][2][4].
Mitigation
The vulnerability is fixed in WPCode version 2.3.6, which introduces custom capabilities (wpcode_edit_snippets, wpcode_activate_snippets) and blocks XML-RPC write access to the wpcode post type [3]. Users should update to version 2.3.6 or later immediately. No workaround is available for earlier versions.
- https://plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/class-wpcode-snippet-execute.php#L415
- https://plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/class-wpcode-snippet-execute.php#L374
- https://plugins.trac.wordpress.org/changeset/3549060/insert-headers-and-footers/trunk/includes/post-type.php
- https://plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/post-type.php#L24
AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2- Range: <=2.3.5
Patches
1r3549060Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
8- plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/class-wpcode-snippet-execute.phpnvd
- plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/class-wpcode-snippet-execute.phpnvd
- plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/execute/class-wpcode-snippet-execute-php.phpnvd
- plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/post-type.phpnvd
- plugins.trac.wordpress.org/browser/insert-headers-and-footers/tags/2.3.5/includes/shortcode.phpnvd
- plugins.trac.wordpress.org/changeset/3549060/insert-headers-and-footers/trunk/includes/post-type.phpnvd
- plugins.trac.wordpress.org/changesetnvd
- www.wordfence.com/threat-intel/vulnerabilities/id/75a2e8b1-d5e0-4f7b-a70a-f0aadf58c778nvd
News mentions
0No linked articles in our index yet.