CVE-2025-13035
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-11-19

Last updated on: 2025-11-19

Assigner: Wordfence

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-11-19
Last Modified
2025-11-19
Generated
2026-05-07
AI Q&A
2025-11-19
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
wordpress code_snippets *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability in the Code Snippets WordPress plugin (up to version 3.9.1) allows authenticated users with Contributor-level access or higher to perform PHP code injection. It arises because the plugin uses the PHP extract() function on attacker-controlled shortcode attributes within the evaluate_shortcode_from_flat_file method. This can overwrite the $filepath variable, which is then passed to require_once, enabling arbitrary PHP code execution on the server. Exploitation requires tricking an administrator into enabling the 'Enable file-based execution' setting and creating at least one active Content snippet. [1]


How can this vulnerability impact me? :

The vulnerability can lead to remote code execution on the server hosting the WordPress site. An attacker with Contributor-level access can inject and execute arbitrary PHP code, potentially leading to full compromise of the server, data theft, defacement, or further attacks. This elevates privileges and undermines the security of the website and its underlying infrastructure. [1]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by checking if the WordPress site is running the Code Snippets plugin version 3.9.1 or earlier, and if the 'Enable file-based execution' setting is enabled. Additionally, monitoring for usage of the [code_snippet] shortcode by authenticated users with Contributor-level access or higher could indicate exploitation attempts. Since the vulnerability involves PHP code injection via shortcode attributes, inspecting logs for unusual shortcode usage or PHP errors related to snippet execution may help. Specific commands could include: 1) Using WP-CLI to check plugin version: `wp plugin list --status=active | grep code-snippets` 2) Searching for the 'Enable file-based execution' setting in the plugin options table in the database: `wp db query "SELECT * FROM wp_options WHERE option_name LIKE '%code_snippets%'"` 3) Checking web server logs for POST or GET requests containing the `[code_snippet]` shortcode or suspicious parameters. 4) Using grep to find shortcode usage in posts: `grep -r '\[code_snippet' /path/to/wordpress/wp-content/uploads/` or in the database. However, no explicit detection commands are provided in the resources. [1]


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to update the Code Snippets plugin to version 3.9.2 or later, as this update addresses the security issues related to CVE-2025-13035 by improving input sanitization and normalization, and fixing the vulnerability. Additionally, ensure that the 'Enable file-based execution' setting is disabled unless absolutely necessary, and restrict Contributor-level users from enabling this setting or creating active content snippets. Monitoring and limiting user permissions to prevent unauthorized shortcode usage can also help mitigate risk. [2]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart