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
The vulnerability identified as CVE-2025-13035 affects the Code Snippets plugin for WordPress, specifically all versions up to and including 3.9.1. The root cause is the use of PHP's extract() function on attacker-controlled shortcode attributes within the method evaluate_shortcode_from_flat_file. This function can overwrite the $filepath variable, which is later passed to require_once, enabling arbitrary PHP code execution on the server. The attack vector requires an authenticated user with at least Contributor-level privileges to craft a malicious shortcode using PHP filter chains. However, exploitation also depends on an administrator enabling the 'Enable file-based execution' setting and having at least one active content snippet, which creates a necessary condition for the code injection to succeed. This vulnerability falls under CWE-94 (Improper Control of Generation of Code), indicating a code injection flaw. The CVSS 3.1 base score is 8.0, with attack vector network (AV:N), high attack complexity (AC:H), low privileges required (PR:L), and user interaction required (UI:R). The scope is changed (S:C), and the impact on confidentiality, integrity, and availability is high (C:H/I:H/A:H). Although no exploits are currently known in the wild, the vulnerability poses a significant risk due to the potential for remote code execution and full system compromise on affected WordPress installations.
Potential Impact
For European organizations, this vulnerability presents a critical risk to WordPress-based websites that use the Code Snippets plugin. Successful exploitation can lead to arbitrary code execution, allowing attackers to compromise web servers, steal sensitive data, deface websites, or use the compromised server as a pivot point for further attacks within the network. Given the widespread use of WordPress across European businesses, including e-commerce, government, and media sectors, the impact could be severe. Confidentiality breaches could expose personal data protected under GDPR, leading to regulatory penalties. Integrity and availability impacts could disrupt business operations and damage organizational reputation. The requirement for authenticated access and admin interaction limits the attack surface but does not eliminate risk, especially in environments with multiple contributors or where social engineering could enable enabling the vulnerable setting.
Mitigation Recommendations
European organizations should immediately audit their WordPress sites for the presence of the Code Snippets plugin and verify the version in use. The primary mitigation is to upgrade the plugin to a version that patches this vulnerability once available. Until a patch is released, administrators should disable the 'Enable file-based execution' setting to prevent exploitation. Additionally, organizations should enforce strict access controls, limiting Contributor-level privileges to trusted users only. Implement multi-factor authentication (MFA) for all WordPress accounts to reduce the risk of credential compromise. Regularly monitor logs for suspicious shortcode usage or unexpected file inclusions. Employ web application firewalls (WAFs) with rules to detect and block malicious PHP filter chains or unusual shortcode patterns. Conduct security awareness training to prevent social engineering attempts aimed at convincing administrators to enable risky settings. Finally, maintain regular backups and test restoration procedures to recover quickly in case of compromise.
Affected Countries
Germany, France, United Kingdom, Italy, Spain, Netherlands, 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
The vulnerability identified as CVE-2025-13035 affects the Code Snippets plugin for WordPress, specifically all versions up to and including 3.9.1. The root cause is the use of PHP's extract() function on attacker-controlled shortcode attributes within the method evaluate_shortcode_from_flat_file. This function can overwrite the $filepath variable, which is later passed to require_once, enabling arbitrary PHP code execution on the server. The attack vector requires an authenticated user with at least Contributor-level privileges to craft a malicious shortcode using PHP filter chains. However, exploitation also depends on an administrator enabling the 'Enable file-based execution' setting and having at least one active content snippet, which creates a necessary condition for the code injection to succeed. This vulnerability falls under CWE-94 (Improper Control of Generation of Code), indicating a code injection flaw. The CVSS 3.1 base score is 8.0, with attack vector network (AV:N), high attack complexity (AC:H), low privileges required (PR:L), and user interaction required (UI:R). The scope is changed (S:C), and the impact on confidentiality, integrity, and availability is high (C:H/I:H/A:H). Although no exploits are currently known in the wild, the vulnerability poses a significant risk due to the potential for remote code execution and full system compromise on affected WordPress installations.
Potential Impact
For European organizations, this vulnerability presents a critical risk to WordPress-based websites that use the Code Snippets plugin. Successful exploitation can lead to arbitrary code execution, allowing attackers to compromise web servers, steal sensitive data, deface websites, or use the compromised server as a pivot point for further attacks within the network. Given the widespread use of WordPress across European businesses, including e-commerce, government, and media sectors, the impact could be severe. Confidentiality breaches could expose personal data protected under GDPR, leading to regulatory penalties. Integrity and availability impacts could disrupt business operations and damage organizational reputation. The requirement for authenticated access and admin interaction limits the attack surface but does not eliminate risk, especially in environments with multiple contributors or where social engineering could enable enabling the vulnerable setting.
Mitigation Recommendations
European organizations should immediately audit their WordPress sites for the presence of the Code Snippets plugin and verify the version in use. The primary mitigation is to upgrade the plugin to a version that patches this vulnerability once available. Until a patch is released, administrators should disable the 'Enable file-based execution' setting to prevent exploitation. Additionally, organizations should enforce strict access controls, limiting Contributor-level privileges to trusted users only. Implement multi-factor authentication (MFA) for all WordPress accounts to reduce the risk of credential compromise. Regularly monitor logs for suspicious shortcode usage or unexpected file inclusions. Employ web application firewalls (WAFs) with rules to detect and block malicious PHP filter chains or unusual shortcode patterns. Conduct security awareness training to prevent social engineering attempts aimed at convincing administrators to enable risky settings. Finally, maintain regular backups and test restoration procedures to recover quickly in case of compromise.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
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/19/2025, 8:07:55 AM
Last updated: 11/19/2025, 10:00:49 AM
Views: 5
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-2025-0351
UnknownCVE-2025-58412: Execute unauthorized code or commands in Fortinet FortiADC
MediumCVE-2025-11230: CWE-407 Inefficient Algorithmic Complexity in HAProxy Technologies HAProxy Community Edition
HighCVE-2025-11446: CWE-532 Insertion of Sensitive Information into Log File in upKeeper Solutions upKeeper Manager
HighCVE-2025-13206: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in stellarwp GiveWP – Donation Plugin and Fundraising Platform
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.