Perfmatters WordPress Plugin Arbitrary File Overwrite Vulnerability (CVE-2026-4351)
The Perfmatters plugin for WordPress is vulnerable to arbitrary file overwrite via path traversal, allowing authenticated attackers with subscriber-level access to overwrite arbitrary files on the server with a fixed PHP docblock content, potentially causing denial of service.
The Perfmatters plugin for WordPress, in versions up to and including 2.5.9, is vulnerable to an arbitrary file overwrite vulnerability (CVE-2026-4351). This vulnerability stems from the PMCS::action_handler() method’s processing of bulk activate/deactivate actions without proper authorization checks or nonce verification. The unsanitized $_GET['snippets'][] values are then passed to Snippet::activate()/Snippet::deactivate(), which subsequently call Snippet::update() and file_put_contents() with a traversed path. An authenticated attacker with subscriber-level privileges can exploit this flaw to overwrite arbitrary files on the server with a fixed PHP docblock, leading to a potential denial-of-service condition by corrupting critical files such as .htaccess or index.php. This vulnerability allows low-privileged users to gain elevated privileges on the system.
Attack Chain
- Attacker authenticates to the WordPress site with subscriber-level access.
- Attacker crafts a malicious HTTP GET request targeting the WordPress installation.
- The GET request includes the
pmcs_actionparameter set tobulk_activateorbulk_deactivate. - The GET request includes the
snippets[]parameter containing a path traversal payload, such as../../../.htaccess. - The
PMCS::action_handler()function processes the request without proper authorization or nonce validation. - The
Snippet::activate()orSnippet::deactivate()functions are called, leading toSnippet::update(). Snippet::update()then callsfile_put_contents()with the attacker-controlled path.- The attacker overwrites the targeted file (e.g.,
.htaccess,index.php) with a fixed PHP docblock, leading to a denial of service or further compromise.
Impact
Successful exploitation allows an attacker to overwrite arbitrary files on the WordPress server. Overwriting critical files like .htaccess or index.php can result in a denial-of-service condition, rendering the website unavailable. In some cases, this could be leveraged for further compromise by injecting malicious code into other PHP files or modifying server configurations. The vulnerability affects all installations using the Perfmatters plugin version 2.5.9 or earlier.
Recommendation
- Immediately update the Perfmatters plugin to the latest version to patch CVE-2026-4351.
- Deploy the Sigma rule
Detect Perfmatters Arbitrary File Overwrite Attemptto monitor for exploitation attempts targeting this vulnerability via HTTP GET requests. - Monitor web server logs for suspicious GET requests containing
pmcs_action=bulk_activateorpmcs_action=bulk_deactivateand path traversal sequences within thesnippets[]parameter. - Implement strict file permission controls to limit the impact of potential file overwrite vulnerabilities.
Detection coverage 2
Detect Perfmatters Arbitrary File Overwrite Attempt
highDetects attempts to exploit the Perfmatters plugin arbitrary file overwrite vulnerability (CVE-2026-4351) via suspicious HTTP GET requests.
Detect File Overwrite via file_put_contents with Traversal
mediumDetects file overwrite attempts using file_put_contents function combined with path traversal, indicative of potential exploitation of vulnerabilities like CVE-2026-4351.
Detection queries are kept inside the platform. Get full rules →