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.
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.
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.
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.
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.
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.
The Cyber Resilience Act and AI
The EU Cyber Resilience Act (CRA), beginning enforcement in September 2026, specifically addresses AI components in software products.
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: