8.0high
Code Snippets <= 3.9.1 - Authenticated (Contributor+) PHP Code Injection via extract() and PHP Filter Chains
- Severity
- 8.0high CVSS:3.1 by Wordfence
- Exploit likelihood
- 0.71% (higher than 49% of CVEs)
- Published
- Last changed
- Assigned by
- 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| codesnippetspro Code Snippets | up to 3.9.1 | CVE List |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
El plugin Code Snippets para WordPress es vulnerable a la inyección de código PHP en todas las versiones hasta la 3.9.1, inclusive. Esto se debe al uso de 'extract()' por parte del plugin en atributos de shortcode controlados por el atacante dentro del método 'evaluate_shortcode_from_flat_file', que puede usarse para sobrescribir la variable '$filepath' y posteriormente pasarla a 'require_once'. Esto hace posible que atacantes autenticados, con acceso de nivel Colaborador y superior, ejecuten código PHP arbitrario en el servidor a través del shortcode '[code_snippet]' utilizando cadenas de filtro PHP, siempre que puedan engañar a un administrador para que habilite la configuración 'Enable file-based execution' y cree al menos un fragmento de contenido activo.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-13035 changed 2026-04-08 | CVE Terms of Use |
| NVD | CVE-2025-13035 changed 2026-10-18 | Public domain |