AI Security in WordPress – Vulnerabilities, Threats, and the Cyber Resilience Act

Published: April 15, 2026 · Author: Marcin Szewczyk-Wilgan

Artificial intelligence entered the WordPress security landscape from two directions simultaneously. On one side, AI tools are being integrated into WordPress plugins, themes, and development workflows – bringing new functionality but also new attack surfaces. On the other, AI is increasingly used by attackers to automate vulnerability discovery, generate exploit code, bypass traditional defenses, and produce polymorphic malware that evades signature-based scanners. This article examines both dimensions: the security risks in AI-powered WordPress tools and the AI-assisted threats every WordPress site now faces.

Vulnerabilities in AI-Powered WordPress Plugins

The rapid adoption of AI functionality in WordPress plugins created a new category of vulnerability. The 2025 flagship case is CVE-2025-11749.

CVE-2025-11749CVE-2025-11749 is a critical vulnerability in AI Engine, one of the most widely installed AI plugins for WordPress. The vulnerability allowed unauthenticated attackers to read arbitrary files from the server – including wp-config.php containing database credentials – through a path traversal flaw in the plugin's AI conversation history feature. The plugin had over 100,000 active installations at the time of disclosure. Patch was released within 24 hours; exploitation in the wild was confirmed before the patch was widely applied.
Why AI plugins carry higher riskAI plugins interact with external APIs, process user-supplied content through AI models, store conversation histories, handle API keys, and often require elevated WordPress permissions to function. Each of these interactions is a potential vulnerability surface. The complexity of integrating AI APIs with WordPress creates more opportunities for security mistakes than a simpler plugin would.
API key exposureWordPress AI plugins require API keys for OpenAI, Anthropic, or other AI providers. These keys are stored in the WordPress database (wp_options table). While the WordPress admin screens mask key display, the values in the database are not encrypted by default – a database dump or SQL injection exposure also exposes the API key. Keys should be stored in environment variables or server-level secrets management, not in the WordPress database.
Prompt injectionAI-powered features that process user-supplied content (chatbots, AI comment responders, AI form processors) are vulnerable to prompt injection: attackers craft inputs designed to override the AI system's instructions and extract confidential information or perform unintended actions. This is an emerging class of vulnerability with no universal mitigation – defense requires careful input sanitization and output validation.

AI-Generated Code: The Hidden Vulnerability Surface

The adoption of AI coding assistants (Claude Code, GitHub Copilot, Cursor) in WordPress development has created an invisible security problem at scale.

45% vulnerability rate

Research findings on AI code quality

A 2025 security research study found that approximately 45% of code generated by AI assistants for web applications contained at least one security vulnerability. Common issues: SQL injection from unsanitized inputs, missing nonce verification in WordPress AJAX handlers, cross-site scripting from unescaped output, and insecure file upload handling. AI models generate plausible-looking code that follows syntactic conventions but misses security constraints.

No repository review

Custom code bypasses ecosystem checks

Code submitted to the WordPress.org plugin repository goes through an automated and manual security review. Custom plugins and theme modifications created with AI assistance and deployed directly to production sites receive no such review. This creates a growing pool of production WordPress code with security vulnerabilities that has never been reviewed by anyone other than its author.

WordPress-specific patterns

AI gaps in WordPress security conventions

WordPress has specific security patterns: nonce verification for form submissions, sanitization and escaping through dedicated functions (sanitize_text_field, esc_html, wp_kses), capability checks before sensitive operations, and prepared statements for database queries. AI models know these patterns but do not apply them consistently, especially in less common scenarios or when context is complex.

Mitigation

Review AI-generated WordPress code

Treat AI-generated WordPress code as untrusted first draft that requires security review before deployment. Specifically check: all database queries use $wpdb->prepare() or WP_Query, all form submissions verify nonces, all output is escaped appropriately for context (esc_html vs esc_attr vs esc_url), and all capability-restricted operations check user capabilities before executing.

AI-Powered Attacks Against WordPress

The same AI capabilities that help developers are also being used by attackers. The threat landscape has changed qualitatively, not just quantitatively.

Automated vulnerability scanningAI-powered scanning tools can analyze WordPress plugin code, identify patterns associated with common vulnerability classes, and generate targeted exploit attempts automatically. What previously required a security researcher days to analyze can now be automated across thousands of plugins simultaneously. The time between vulnerability disclosure and exploit in the wild has contracted from days to hours partly due to AI-assisted exploit development.
Polymorphic malwareTraditional signature-based malware scanners (including many WordPress security plugins) work by matching file content against known malicious patterns. AI-generated malware can mutate its code structure on each delivery while preserving malicious functionality, evading signature matching. A polymorphic backdoor that rewrites itself after each installation is undetectable by scanners that have not already analyzed that specific variant. Behavioral detection (what the code does, not what it looks like) is the required defense.
CAPTCHA bypassreCAPTCHA and similar challenge-response systems were designed to be solvable by humans but not automated scripts. AI vision models can now solve most image-based CAPTCHAs with high accuracy. Brute-force attacks on wp-login.php, registration spam, and comment spam are increasingly resistant to CAPTCHA-based defenses. Rate limiting at the network level and two-factor authentication are more reliable defenses than CAPTCHA alone.
Contextual phishing and spamAI enables generation of contextually relevant spam comments, contact form submissions, and phishing content that bypasses simple pattern-based filters. A spam comment that is grammatically correct, references the post it is commenting on, and contains a plausibly helpful-sounding anchor text is difficult to distinguish from legitimate engagement programmatically.

The Cyber Resilience Act and AI

The EU Cyber Resilience Act (CRA), beginning enforcement in September 2026, specifically addresses AI components in software products.

AI as a regulated componentThe CRA treats AI components embedded in software products as regulated elements requiring security documentation. WordPress plugins with AI functionality – chatbots, content generators, AI image tools – that are sold commercially in the EU must document their AI dependencies, the security properties of those integrations, and how the AI component affects the product's attack surface.
API security requirementsPlugins that transmit user content to external AI APIs (OpenAI, Anthropic, Google) must document what data is transmitted, under what conditions, and what privacy protections apply. This intersects with GDPR's data minimization and purpose limitation principles. User content processed by external AI APIs is personal data subject to GDPR protections.
Vulnerability disclosure for AI featuresThe CRA's mandatory Vulnerability Disclosure Program requirement applies to AI-powered plugins just as to traditional plugins. Given the novel and evolving nature of AI security issues (prompt injection, model poisoning, API key exposure), having a defined disclosure process is particularly important for this category of plugin.

Practical Guidance for WordPress Operators

Given the dual nature of AI security challenges – vulnerabilities in AI tools and AI-assisted attacks – here is the practical response for WordPress site operators:

Vet AI plugins carefullyApply higher scrutiny to AI-powered plugins than to traditional plugins. Check: How long has the developer been active? Do they have a documented security disclosure process? Has the plugin received security audits? Is API key storage documented as secure? What data is sent to external AI services?
Store API keys securelyIf your AI plugin requires an OpenAI or Anthropic API key, store it in an environment variable on the server and reference it from wp-config.php via getenv(), rather than entering it directly in the WordPress admin panel where it ends up in the database. This protects the key from database dump exposure and limits the damage of a wp-config.php exposure.
Behavioral monitoringSince signature-based detection is less effective against AI-generated polymorphic malware, invest in behavioral monitoring: outbound connection monitoring (unexpected external requests), file system change detection (files modified outside of update events), and database anomaly detection (unexpected user creation, option changes). These behavioral signals are harder for polymorphic malware to evade than signature-based detection.