Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-13035: CWE-94 Improper Control of Generation of Code ('Code Injection') in codesnippetspro Code Snippets

0
High
VulnerabilityCVE-2025-13035cvecve-2025-13035cwe-94
Published: Wed Nov 19 2025 (11/19/2025, 07:46:08 UTC)
Source: CVE Database V5
Vendor/Project: codesnippetspro
Product: Code Snippets

Description

The Code Snippets plugin for WordPress is vulnerable to PHP Code Injection in all versions up to, and including, 3.9.1. This is due to the plugin's use of extract() on attacker-controlled shortcode attributes within the `evaluate_shortcode_from_flat_file` method, which can be used to overwrite the `$filepath` variable and subsequently passed to require_once. This makes it possible for authenticated attackers, with Contributor-level access and above, to execute arbitrary PHP code on the server via the `[code_snippet]` shortcode using PHP filter chains granted they can trick an administrator into enabling the "Enable file-based execution" setting and creating at least one active Content snippet.

AI-Powered Analysis

AILast updated: 11/26/2025, 08:10:01 UTC

Technical Analysis

CVE-2025-13035 is a critical PHP code injection vulnerability identified in the Code Snippets plugin for WordPress, affecting all versions up to and including 3.9.1. The root cause is the plugin's use of the PHP extract() function on shortcode attributes controlled by attackers within the evaluate_shortcode_from_flat_file method. This allows an attacker to overwrite the $filepath variable, which is subsequently passed to require_once, enabling arbitrary PHP code execution on the server. The attack vector requires an authenticated user with at least Contributor-level access to exploit the vulnerability. However, exploitation also depends on an administrator enabling the "Enable file-based execution" setting and having at least one active content snippet. The attacker can then leverage the [code_snippet] shortcode with PHP filter chains to execute malicious code. The vulnerability affects confidentiality, integrity, and availability, as arbitrary code execution can lead to data theft, site defacement, or denial of service. The CVSS v3.1 base score is 8.0, reflecting high severity, with attack vector being network, attack complexity high, privileges required low, user interaction required, and scope changed. No public exploits are known at this time, but the vulnerability poses a significant risk to WordPress sites using this plugin, especially those with multiple contributors and administrative users.

Potential Impact

For European organizations, this vulnerability presents a significant threat to WordPress-based websites, particularly those that use the Code Snippets plugin to manage custom PHP code snippets. Successful exploitation can lead to full server compromise, allowing attackers to steal sensitive data, deface websites, deploy malware, or disrupt services. This is especially critical for organizations relying on WordPress for customer-facing portals, e-commerce, or internal communications. The requirement for Contributor-level access lowers the barrier for exploitation within organizations that allow multiple users to contribute content. If an attacker gains such access, they can leverage this vulnerability to escalate privileges and execute arbitrary code. The impact extends to data confidentiality breaches under GDPR regulations, potential service outages, and reputational damage. Additionally, the need for administrator involvement to enable file-based execution means social engineering or insider threats could facilitate exploitation. Given the widespread use of WordPress across Europe, the vulnerability could affect a broad range of sectors including government, education, media, and commerce.

Mitigation Recommendations

To mitigate this vulnerability, European organizations should immediately audit their WordPress installations for the presence of the Code Snippets plugin and verify the version in use. Administrators should disable the "Enable file-based execution" setting if it is enabled, as this setting is a prerequisite for exploitation. Review and restrict Contributor-level user permissions to the minimum necessary, and monitor for suspicious shortcode usage or snippet creation. Implement strict access controls and multi-factor authentication for administrative accounts to reduce the risk of social engineering enabling the setting change. Until an official patch is released, consider temporarily deactivating the Code Snippets plugin or replacing it with alternative, secure methods for managing PHP snippets. Regularly monitor WordPress logs for unusual require_once calls or shortcode activity. Educate administrators and contributors about the risks of enabling file-based execution and the importance of cautious plugin configuration. Once a patch is available, apply it promptly. Additionally, implement web application firewalls (WAFs) with rules to detect and block suspicious shortcode or PHP filter chain usage patterns.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
Wordfence
Date Reserved
2025-11-11T17:05:21.590Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 691d774cfcf6450804cbcaf0

Added to database: 11/19/2025, 7:52:44 AM

Last enriched: 11/26/2025, 8:10:01 AM

Last updated: 1/7/2026, 4:22:33 AM

Views: 67

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats