CVE-2025-13035
JSON

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 packageVersionsReported by
codesnippetspro Code Snippetsup to 3.9.1CVE List

Classification

CWE-94

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

SourceRecordLicence
CVE ListCVE-2025-13035 changed 2026-04-08CVE Terms of Use
NVDCVE-2025-13035 changed 2026-10-18Public domain