Latest Post Shortcode <= 14.2.0 - Missing Authorization
Description
The Latest Post Shortcode plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in all versions up to, and including, 14.2.0. This makes it possible for authenticated attackers, with Subscriber-level access and above, to perform an unauthorized action.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:NTechnical Details
<=14.2.0Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2026-24995 ## 1. Vulnerability Summary The **Latest Post Shortcode** plugin (versions <= 14.2.0) contains a missing authorization vulnerability within its AJAX handler functions. While these functions are registered for authenticated users via `wp_ajax_`, they fai…
Show full research plan
Exploitation Research Plan - CVE-2026-24995
1. Vulnerability Summary
The Latest Post Shortcode plugin (versions <= 14.2.0) contains a missing authorization vulnerability within its AJAX handler functions. While these functions are registered for authenticated users via wp_ajax_, they fail to implement necessary capability checks (e.g., current_user_can( 'manage_options' )). This allows any authenticated user, including those with Subscriber-level permissions, to invoke administrative or restricted functionality.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Authentication: Subscriber-level access or higher is required.
- Vulnerable Action: To be confirmed via discovery, but likely related to settings updates or metadata manipulation. Common candidates in this plugin type are
lps_save_settings,lps_update_options, orlatest_post_shortcode_preview. - Payload: Parameters passed via
POSTto the identified AJAX action. - Preconditions: The attacker must have a valid session cookie for a Subscriber user.
3. Code Flow (Inferred)
- Entry Point: An AJAX hook is registered:
add_action( 'wp_ajax_ACTION_NAME', 'FUNCTION_NAME' );. - Missing Check: The callback
FUNCTION_NAMEis invoked. It likely checks a nonce usingcheck_ajax_referer(providing CSRF protection) but fails to callcurrent_user_can(). - Execution: The function performs a privileged action, such as
update_option()or modifying post data, based on the$_POSTinput.
4. Nonce Acquisition Strategy
The plugin likely uses wp_localize_script to provide an AJAX nonce to the frontend.
- Shortcode Identification: Search the plugin code for
add_shortcode. The primary shortcode is likely[latest-post-shortcode]. - Page Creation: Create a post containing the shortcode to ensure scripts are enqueued:
wp post create --post_type=page --post_status=publish --post_title="Nonce Page" --post_content='[latest-post-shortcode]' - Localization Search: Use
grepto find the localization key:grep -rn "wp_localize_script" /var/www/html/wp-content/plugins/latest-post-shortcode/ - Extraction:
- Use
browser_navigateto the "Nonce Page". - Use
browser_evalto extract the nonce:// Example based on common naming patterns window.lps_vars?.nonce || window.lps_ajax?.nonce
- Use
5. Exploitation Strategy
Phase 1: Discovery
Search the plugin directory to find AJAX actions lacking capability checks:
grep -rn "add_action.*wp_ajax_" /var/www/html/wp-content/plugins/latest-post-shortcode/
Once actions are found (e.g., lps_save_settings), examine the callback function for current_user_can.
Phase 2: Payload Delivery
Assuming an action named lps_save_settings (inferred) exists:
- Target:
/wp-admin/admin-ajax.php - Method:
POST - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
action=lps_save_settings&security=[NONCE]&settings[some_option]=attacker_value
6. Test Data Setup
- Target Plugin: Ensure
latest-post-shortcodev14.2.0 is installed and active. - Attacker User:
wp user create attacker attacker@example.com --role=subscriber --user_pass=password - Victim Content: (Optional) Create some posts for the shortcode to display.
wp post create --post_type=post --post_title="Secret Post" --post_status=publish
7. Expected Results
- Success: The server returns a
200 OKor a JSON success response (e.g.,{"success":true}). - Impact: Settings are modified, or data is manipulated despite the user only having Subscriber permissions.
8. Verification Steps
- Check Options: Use WP-CLI to verify if the plugin settings were altered:
wp option get lps_settings - Check Behavior: If the exploit changed a display setting (e.g., custom CSS or HTML), verify the change on the frontend.
9. Alternative Approaches
If the vulnerability is not in settings:
- Metadata Manipulation: Look for AJAX actions that call
update_post_meta. - Information Disclosure: Check if any AJAX actions leak post content or system information that should be restricted to admins.
- Shortcode Injection: If the AJAX action allows updating the shortcode attributes globally, try injecting malicious attributes that might lead to XSS.
Note on Identifiers: Since source was not provided, the agent MUST prioritize grep -rn "wp_ajax_" to find the exact action names (lps_... or latest_post_...) and the corresponding nonce keys in the source before attempting exploitation.
Summary
The Latest Post Shortcode plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on an AJAX handler function in versions up to, and including, 14.2.0. This allows authenticated attackers with Subscriber-level permissions to perform administrative actions, such as modifying plugin settings, by bypassing the intended authorization logic.
Exploit Outline
To exploit this vulnerability, an attacker with Subscriber-level credentials first retrieves a valid AJAX security nonce, which is typically exposed in the frontend HTML via localized scripts (e.g., variables associated with the [latest-post-shortcode] shortcode). The attacker then sends a POST request to `/wp-admin/admin-ajax.php` using the vulnerable AJAX action. Because the server-side callback function only validates the nonce and fails to perform a capability check (such as current_user_can('manage_options')), the attacker can successfully execute privileged tasks, such as updating plugin configurations or manipulating metadata, by providing the appropriate parameters in the request body.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.