CVE-2025-13035: CWE-94 Improper Control of Generation of Code ('Code Injection') in codesnippetspro Code Snippets
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 Analysis
Technical Summary
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.
Affected Countries
Germany, United Kingdom, France, Netherlands, Italy, Spain, Poland, Sweden
CVE-2025-13035: CWE-94 Improper Control of Generation of Code ('Code Injection') in codesnippetspro 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
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.
Affected Countries
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-20893: Origin validation error in Fujitsu Client Computing Limited Fujitsu Security Solution AuthConductor Client Basic V2
HighCVE-2025-14891: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in ivole Customer Reviews for WooCommerce
MediumCVE-2025-14059: CWE-73 External Control of File Name or Path in roxnor EmailKit – Email Customizer for WooCommerce & WP
MediumCVE-2025-12648: CWE-552 Files or Directories Accessible to External Parties in cbutlerjr WP-Members Membership Plugin
MediumCVE-2025-14631: CWE-476 NULL Pointer Dereference in TP-Link Systems Inc. Archer BE400
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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.