Notification for Telegram <= 3.5 - Unauthenticated Stored Cross-Site Scripting
Description
The Notification for Telegram plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 3.5 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers 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:N/UI:N/S:C/C:L/I:L/A:NTechnical Details
<=3.5What Changed in the Fix
Changes introduced in v3.5.1
Source Code
WordPress.org SVN# Research Plan: CVE-2026-40732 - Notification for Telegram Unauthenticated Stored XSS ## 1. Vulnerability Summary The **Notification for Telegram** plugin (up to version 3.5) is vulnerable to unauthenticated stored cross-site scripting (XSS). The vulnerability stems from the plugin's failure to pr…
Show full research plan
Research Plan: CVE-2026-40732 - Notification for Telegram Unauthenticated Stored XSS
1. Vulnerability Summary
The Notification for Telegram plugin (up to version 3.5) is vulnerable to unauthenticated stored cross-site scripting (XSS). The vulnerability stems from the plugin's failure to properly sanitize and escape user-supplied data collected during the WooCommerce checkout process and subsequently displayed in the WordPress administrative interface. Specifically, the nftb_telegramnickname field is saved via update_post_meta without sufficient sanitization to prevent attribute injection, and then echoed directly in the admin order details page without any output escaping.
2. Attack Vector Analysis
- Endpoint: WooCommerce Checkout (
POST /?wc-ajax=checkout) - Vulnerable Parameter:
nftb_telegramnickname - Authentication: None (Unauthenticated)
- Preconditions:
- WooCommerce must be installed and active.
- The plugin must be active.
- (Optional for injection, required for visibility) The "Telegram Nickname" field is usually enabled via the
notify_woocomerce_checkoutfieldoption, but the saving logic innftb_update_order_metaruns on thewoocommerce_checkout_update_order_metahook regardless of the setting's state.
3. Code Flow
- Entry Point (Input): During a WooCommerce checkout, the `nftb_update
Summary
The Notification for Telegram plugin for WordPress is vulnerable to unauthenticated stored cross-site scripting due to insufficient input sanitization and output escaping of the 'nftb_telegramnickname' field. Attackers can inject arbitrary web scripts during the WooCommerce checkout process, which are then executed in the context of an administrator viewing the order details.
Vulnerable Code
// include/tnfunction.php line 201 function nftb_update_order_meta( $order_id ) { if ( ! empty( $_POST['nftb_telegramnickname'] ) ) { update_post_meta( $order_id, 'Telegram', sanitize_text_field( $_POST['nftb_telegramnickname'] ) ); } } --- // include/tnfunction.php line 212 function nftb__field_display_admin_order_meta($order){ $tlgruser = get_post_meta( $order->id, 'Telegram', true ); if ( ! empty( $tlgruser ) ) { echo '<p><strong>'.__('Telegram').':</strong> <a href="https://t.me/'.$tlgruser.'">' .$tlgruser . '</a></p>'; } }
Security Fix
@@ -211,6 +211,6 @@ function nftb__field_display_admin_order_meta($order){ $tlgruser = get_post_meta( $order->id, 'Telegram', true ); if ( ! empty( $tlgruser ) ) { - echo '<p><strong>'.__('Telegram').':</strong> <a href="https://t.me/'.$tlgruser.'">' .$tlgruser . '</a></p>'; + echo '<p><strong>' . esc_html__( 'Telegram', 'notification-for-telegram' ) . ':</strong> <a href="' . esc_url( 'https://t.me/' . $tlgruser ) . '">' . esc_html( $tlgruser ) . '</a></p>'; } }
Exploit Outline
1. Access a site running WooCommerce and the Notification for Telegram plugin (<= 3.5). 2. Add an item to the cart and proceed to the checkout page. 3. Locate the 'Telegram Nickname' field (parameter `nftb_telegramnickname`). 4. Submit an order, providing a malicious payload in this field, such as: `"><script>alert(document.cookie)</script>` or `" onmouseover="alert(1)`. 5. Wait for a site administrator to view the order details page in the WordPress dashboard (`/wp-admin/post.php?post=[ORDER_ID]&action=edit`). 6. The script will execute in the administrator's session because the plugin echoes the stored meta value directly into the HTML without escaping.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.