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

Machine-generated threat intelligence

AILast updated: 02/27/2026, 09:27:16 UTC

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 evaluate_shortcode_from_flat_file method. This improper control allows an attacker to 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 access to the WordPress site. However, exploitation also depends on an administrator enabling the "Enable file-based execution" setting and having at least one active Content snippet configured. The attacker can leverage PHP filter chains via the [code_snippet] shortcode to inject malicious code. This vulnerability is classified under CWE-94 (Improper Control of Generation of Code), indicating a code injection flaw. The CVSS v3.1 score is 8.0 (High), with attack vector Network, attack complexity High, privileges required Low, user interaction Required, and scope Changed. Although no known exploits are reported in the wild, the potential for severe impact on server security is significant. The vulnerability affects the confidentiality, integrity, and availability of the affected systems by allowing remote code execution. The plugin is widely used in WordPress environments, making this a critical concern for many websites relying on it for code snippet management.

Potential Impact

If exploited, this vulnerability allows attackers to execute arbitrary PHP code on the web server hosting the WordPress site. This can lead to full system compromise, including data theft, website defacement, installation of backdoors, pivoting to internal networks, and disruption of services. Because the attack requires Contributor-level access, it lowers the barrier compared to requiring administrator credentials, increasing the risk from insider threats or compromised lower-privilege accounts. The requirement for an administrator to enable file-based execution and have active content snippets means social engineering or insider collusion could facilitate exploitation. The impact spans confidentiality (data exposure), integrity (code and content manipulation), and availability (service disruption). Organizations relying on this plugin for managing code snippets face significant risk, especially if they do not restrict user roles or monitor plugin settings. The vulnerability's network attack vector and changed scope mean it can affect multiple components beyond the WordPress application itself, potentially impacting the underlying server environment.

Mitigation Recommendations

1. Immediately disable the "Enable file-based execution" setting in the Code Snippets plugin to prevent exploitation. 2. Restrict Contributor-level and higher privileges to trusted users only, minimizing the risk of malicious shortcode injection. 3. Monitor and audit user roles and plugin settings regularly to detect unauthorized changes or suspicious activity. 4. Until an official patch is released, consider removing or deactivating the Code Snippets plugin if it is not essential. 5. Implement Web Application Firewall (WAF) rules to detect and block suspicious shortcode usage patterns or attempts to manipulate the $filepath variable. 6. Educate administrators about the risks of enabling file-based execution and the importance of validating plugin settings. 7. After a patch is available, promptly update the plugin to the fixed version. 8. Conduct regular security assessments and code reviews for plugins that execute dynamic code to identify similar risks. 9. Employ principle of least privilege for all WordPress roles and limit plugin management capabilities to administrators only. 10. Use intrusion detection systems to monitor for unusual PHP execution patterns indicative of exploitation attempts.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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: 2/27/2026, 9:27:16 AM

Last updated: 3/25/2026, 12:10:58 AM

Views: 104

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 for AI refresh and higher limits.

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

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses