Skip to main content
Vulnerability Database/CVE-2025-12715

CVE-2025-12715: WordPress Nutrition Facts Label XSS Flaw

CVE-2025-12715 is a stored cross-site scripting vulnerability in the Canadian Nutrition Facts Label WordPress plugin affecting contributors and above. This post covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-12715 Overview

CVE-2025-12715 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the Canadian Nutrition Facts Label plugin for WordPress. The flaw exists in the percentage field of the Nutrition Label custom post type across all versions up to and including 3.0. Insufficient input sanitization and output escaping allow authenticated users with Contributor-level access or above to inject arbitrary JavaScript. Injected scripts execute in the browser of any visitor who views the affected page, enabling session theft, redirection, and administrative action abuse through victim browsers. The vulnerability maps to CWE-79.

Critical Impact

Authenticated contributors can store malicious JavaScript that executes against site visitors and administrators, enabling account takeover and content tampering through a cross-site scripting payload persisted in the Nutrition Label post type.

Affected Products

  • Canadian Nutrition Facts Label plugin for WordPress (all versions ≤ 3.0)
  • WordPress sites allowing Contributor-level or higher registration
  • Any WordPress installation with the vulnerable plugin active

Discovery Timeline

  • 2025-12-06 - CVE-2025-12715 published to the National Vulnerability Database
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2025-12715

Vulnerability Analysis

The plugin exposes a percentage input field tied to the Nutrition Label custom post type. The field value is stored in the WordPress database and later rendered inside generated nutrition facts markup without proper escaping. Because the plugin does not apply WordPress escaping functions such as esc_attr() or esc_html() at output, any HTML or JavaScript supplied by the contributor is reflected directly into the page DOM. Visitors loading a page that renders the injected label trigger the attacker-controlled script in their session context. The attack is persistent, requires no victim interaction beyond page load, and originates from a trusted site domain.

Root Cause

The root cause is missing sanitization on input and missing output escaping on render. The plugin stores raw user-supplied data from the percentage field without filtering through functions like sanitize_text_field(). On the front end, the stored value is echoed into HTML attributes or text nodes without esc_attr() or esc_html(). The vulnerable rendering logic is referenced in the plugin source at canadian-nutrition-facts-label.php line 557.

Attack Vector

An attacker needs an authenticated account with the Contributor role or higher. The attacker creates or edits a Nutrition Label post and supplies a payload such as an HTML <script> tag or an event handler attribute within the percentage field. The payload is persisted. When any user, including administrators, visits a page rendering that label, the injected script executes in the user's browser under the site's origin, enabling cookie theft, forced actions, or DOM manipulation. See the Wordfence vulnerability report for additional detail.

Detection Methods for CVE-2025-12715

Indicators of Compromise

  • Nutrition Label post entries containing HTML tags, <script> elements, or JavaScript event handlers inside the percentage field
  • Unexpected outbound requests from administrator browser sessions after viewing nutrition label content
  • Newly created administrative users or modified user roles following contributor activity
  • Database rows in wp_postmeta tied to the Nutrition Label post type containing angle brackets or javascript: strings

Detection Strategies

  • Query the WordPress database for Nutrition Label post meta values matching regex patterns for HTML tags or script content
  • Review audit logs for Contributor-level accounts creating or editing Nutrition Label posts
  • Deploy a Web Application Firewall rule to flag HTML or script syntax submitted to plugin form fields
  • Monitor rendered pages for Content Security Policy (CSP) violations originating from inline scripts

Monitoring Recommendations

  • Enable WordPress activity logging for post creation, meta updates, and role changes
  • Alert on new Contributor or Author account registrations if open registration is enabled
  • Track plugin version inventory and flag installations of Canadian Nutrition Facts Label ≤ 3.0
  • Review web server access logs for suspicious POST requests to /wp-admin/post.php targeting the Nutrition Label post type

How to Mitigate CVE-2025-12715

Immediate Actions Required

  • Deactivate the Canadian Nutrition Facts Label plugin until a patched version is confirmed available
  • Audit all existing Nutrition Label posts and remove any entries containing HTML or script content in the percentage field
  • Restrict new user registration or disable the Contributor role on sites that do not require public authorship
  • Rotate administrator session cookies and credentials if suspicious label content is discovered

Patch Information

At the time of publication, the NVD entry lists the vulnerability as present in all versions up to and including 3.0. Monitor the WordPress plugin repository and the Wordfence advisory for an updated release that applies sanitization and escaping to the percentage field.

Workarounds

  • Remove Contributor, Author, and Editor roles from untrusted users to eliminate the attack surface
  • Deploy a WAF ruleset that blocks HTML tags and JavaScript event handlers in plugin form submissions
  • Enforce a strict Content Security Policy that disallows inline scripts on pages rendering nutrition labels
  • Replace the plugin with an alternative nutrition label solution until a fixed release is published
bash
# Example: locate stored XSS payloads in Nutrition Label post meta
wp db query "SELECT post_id, meta_key, meta_value FROM wp_postmeta \
  WHERE meta_value REGEXP '<script|onerror=|onload=|javascript:';"

# Deactivate the vulnerable plugin via WP-CLI
wp plugin deactivate canadian-nutrition-facts-label

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.