CVE-2026-2512: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in dartiss Code Embed
The Code Embed plugin for WordPress is vulnerable to Stored Cross-Site Scripting via custom field meta values in all versions up to, and including, 2.5.1. This is due to the plugin's sanitization function `sec_check_post_fields()` only running on the `save_post` hook, while WordPress allows custom fields to be added via the `wp_ajax_add_meta` AJAX endpoint without triggering `save_post`. The `ce_filter()` function then outputs these unsanitized meta values directly into page content without 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.
AI Analysis
Technical Summary
CVE-2026-2512 is a stored Cross-Site Scripting (XSS) vulnerability identified in the Code Embed plugin for WordPress, developed by dartiss, affecting all versions up to and including 2.5.1. The root cause lies in the plugin's sanitization mechanism: the function `sec_check_post_fields()` is designed to sanitize custom field meta values but is only triggered on the `save_post` hook. However, WordPress allows custom fields to be added asynchronously via the `wp_ajax_add_meta` AJAX endpoint, which does not invoke the `save_post` hook. Consequently, meta values added through this AJAX endpoint remain unsanitized. When the plugin's `ce_filter()` function outputs these meta values directly into page content without proper escaping, it enables stored XSS attacks. An attacker with Contributor-level or higher privileges can exploit this by injecting arbitrary JavaScript code into custom fields, which then executes in the browsers of any users who visit the affected pages. This vulnerability compromises the confidentiality and integrity of user sessions and data by enabling script injection, potentially leading to session hijacking, unauthorized actions, or defacement. The CVSS v3.1 base score is 6.4, reflecting a medium severity with network attack vector, low attack complexity, privileges required, no user interaction, and scope change. No known public exploits have been reported yet. The vulnerability affects all versions of the Code Embed plugin up to 2.5.1, and no official patches have been linked at the time of publication.
Potential Impact
The primary impact of CVE-2026-2512 is the potential for stored Cross-Site Scripting attacks within WordPress sites using the vulnerable Code Embed plugin. Attackers with Contributor-level access can inject malicious scripts that execute in the context of any user viewing the compromised pages, including administrators. This can lead to session hijacking, theft of sensitive information such as cookies or credentials, unauthorized actions performed on behalf of users, and website defacement. Although availability is not directly affected, the integrity and confidentiality of site content and user data are at risk. For organizations, this can result in reputational damage, loss of user trust, and potential compliance violations if sensitive data is exposed. Since WordPress powers a significant portion of the web and the Code Embed plugin is used to embed code snippets, the vulnerability presents a notable risk to websites relying on this plugin, especially those with multiple contributors or editors. The attack requires only low privileges, increasing the risk from insider threats or compromised contributor accounts. The lack of user interaction needed for exploitation further raises the threat level.
Mitigation Recommendations
To mitigate CVE-2026-2512, organizations should first update the Code Embed plugin to a version where this vulnerability is patched once available. Until an official patch is released, administrators can implement several practical measures: 1) Restrict Contributor-level user permissions to trusted individuals only, minimizing the risk of malicious script injection. 2) Disable or restrict the use of the `wp_ajax_add_meta` AJAX endpoint if feasible, or monitor its usage for suspicious activity. 3) Employ a Web Application Firewall (WAF) with rules designed to detect and block malicious script payloads in custom fields or AJAX requests. 4) Implement Content Security Policy (CSP) headers to limit the execution of unauthorized scripts on affected pages. 5) Regularly audit custom fields and page content for unexpected or suspicious scripts. 6) Educate content contributors about the risks of injecting untrusted code snippets. 7) Consider temporarily disabling the Code Embed plugin if the risk is unacceptable and no patch is available. These steps go beyond generic advice by focusing on controlling the attack vector and limiting the impact of exploitation.
Affected Countries
United States, Germany, United Kingdom, Canada, Australia, France, Netherlands, India, Brazil, Japan
CVE-2026-2512: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in dartiss Code Embed
Description
The Code Embed plugin for WordPress is vulnerable to Stored Cross-Site Scripting via custom field meta values in all versions up to, and including, 2.5.1. This is due to the plugin's sanitization function `sec_check_post_fields()` only running on the `save_post` hook, while WordPress allows custom fields to be added via the `wp_ajax_add_meta` AJAX endpoint without triggering `save_post`. The `ce_filter()` function then outputs these unsanitized meta values directly into page content without 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.
AI-Powered Analysis
Technical Analysis
CVE-2026-2512 is a stored Cross-Site Scripting (XSS) vulnerability identified in the Code Embed plugin for WordPress, developed by dartiss, affecting all versions up to and including 2.5.1. The root cause lies in the plugin's sanitization mechanism: the function `sec_check_post_fields()` is designed to sanitize custom field meta values but is only triggered on the `save_post` hook. However, WordPress allows custom fields to be added asynchronously via the `wp_ajax_add_meta` AJAX endpoint, which does not invoke the `save_post` hook. Consequently, meta values added through this AJAX endpoint remain unsanitized. When the plugin's `ce_filter()` function outputs these meta values directly into page content without proper escaping, it enables stored XSS attacks. An attacker with Contributor-level or higher privileges can exploit this by injecting arbitrary JavaScript code into custom fields, which then executes in the browsers of any users who visit the affected pages. This vulnerability compromises the confidentiality and integrity of user sessions and data by enabling script injection, potentially leading to session hijacking, unauthorized actions, or defacement. The CVSS v3.1 base score is 6.4, reflecting a medium severity with network attack vector, low attack complexity, privileges required, no user interaction, and scope change. No known public exploits have been reported yet. The vulnerability affects all versions of the Code Embed plugin up to 2.5.1, and no official patches have been linked at the time of publication.
Potential Impact
The primary impact of CVE-2026-2512 is the potential for stored Cross-Site Scripting attacks within WordPress sites using the vulnerable Code Embed plugin. Attackers with Contributor-level access can inject malicious scripts that execute in the context of any user viewing the compromised pages, including administrators. This can lead to session hijacking, theft of sensitive information such as cookies or credentials, unauthorized actions performed on behalf of users, and website defacement. Although availability is not directly affected, the integrity and confidentiality of site content and user data are at risk. For organizations, this can result in reputational damage, loss of user trust, and potential compliance violations if sensitive data is exposed. Since WordPress powers a significant portion of the web and the Code Embed plugin is used to embed code snippets, the vulnerability presents a notable risk to websites relying on this plugin, especially those with multiple contributors or editors. The attack requires only low privileges, increasing the risk from insider threats or compromised contributor accounts. The lack of user interaction needed for exploitation further raises the threat level.
Mitigation Recommendations
To mitigate CVE-2026-2512, organizations should first update the Code Embed plugin to a version where this vulnerability is patched once available. Until an official patch is released, administrators can implement several practical measures: 1) Restrict Contributor-level user permissions to trusted individuals only, minimizing the risk of malicious script injection. 2) Disable or restrict the use of the `wp_ajax_add_meta` AJAX endpoint if feasible, or monitor its usage for suspicious activity. 3) Employ a Web Application Firewall (WAF) with rules designed to detect and block malicious script payloads in custom fields or AJAX requests. 4) Implement Content Security Policy (CSP) headers to limit the execution of unauthorized scripts on affected pages. 5) Regularly audit custom fields and page content for unexpected or suspicious scripts. 6) Educate content contributors about the risks of injecting untrusted code snippets. 7) Consider temporarily disabling the Code Embed plugin if the risk is unacceptable and no patch is available. These steps go beyond generic advice by focusing on controlling the attack vector and limiting the impact of exploitation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- Wordfence
- Date Reserved
- 2026-02-14T01:55:08.510Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 69bac82e771bdb1749ab0139
Added to database: 3/18/2026, 3:43:42 PM
Last enriched: 3/18/2026, 4:00:21 PM
Last updated: 3/19/2026, 6:54:37 AM
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.