CVE-2025-5398
📋 TL;DR
This vulnerability allows authenticated WordPress users with contributor-level access or higher to inject malicious scripts into pages using the Ninja Forms plugin. When other users visit those compromised pages, the scripts execute in their browsers, potentially stealing credentials or performing unauthorized actions. All WordPress sites using vulnerable Ninja Forms plugin versions are affected.
💻 Affected Systems
- Ninja Forms - The Contact Form Builder That Grows With You
📦 What is this software?
Ninja Forms by Ninjaforms
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal administrator credentials, deface websites, redirect users to malicious sites, or perform actions on behalf of authenticated users, potentially leading to complete site compromise.
Likely Case
Attackers with contributor access inject malicious scripts that steal user session cookies or credentials when visitors access affected pages, leading to account takeover.
If Mitigated
With proper user access controls and content security policies, impact is limited to defacement or minor data exposure from affected pages only.
🎯 Exploit Status
Exploitation requires authenticated access but is straightforward once attacker has contributor privileges.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Versions after 3.10.2.1
Vendor Advisory: https://wordpress.org/plugins/ninja-forms/#developers
Restart Required: No
Instructions:
1. Log into WordPress admin panel. 2. Navigate to Plugins → Installed Plugins. 3. Find Ninja Forms and click 'Update Now'. 4. Verify version is 3.10.2.2 or higher.
🔧 Temporary Workarounds
Restrict User Roles
allLimit contributor-level access to trusted users only and review existing contributor accounts.
Implement Content Security Policy
allAdd CSP headers to prevent script execution from untrusted sources.
Add to .htaccess: Header set Content-Security-Policy "default-src 'self'; script-src 'self'"
Or add to wp-config.php: header("Content-Security-Policy: default-src 'self'; script-src 'self'");
🧯 If You Can't Patch
- Disable Ninja Forms plugin temporarily until patch can be applied
- Implement strict user access controls and monitor contributor activity
🔍 How to Verify
Check if Vulnerable:
Check WordPress admin panel → Plugins → Ninja Forms version. If version is 3.10.2.1 or lower, you are vulnerable.
Check Version:
wp plugin list --name=ninja-forms --field=version (if WP-CLI installed)
Verify Fix Applied:
After updating, verify Ninja Forms version is 3.10.2.2 or higher in WordPress admin panel.
📡 Detection & Monitoring
Log Indicators:
- Unusual form submissions with script tags
- Multiple page edits by contributor accounts
- JavaScript payloads in form data
Network Indicators:
- Unexpected script loads from form pages
- External resource calls from form submissions
SIEM Query:
source="wordpress" AND ("ninja-forms" OR "form submission") AND ("<script>" OR "javascript:" OR "onerror=" OR "onload=")
🔗 References
- https://plugins.trac.wordpress.org/browser/ninja-forms/tags/3.10.1/assets/js/min/front-end.js
- https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=3317181%40ninja-forms&new=3317181%40ninja-forms&sfp_email=&sfph_mail=
- https://www.wordfence.com/threat-intel/vulnerabilities/id/92d106c6-a910-4f41-94d1-59f6b7f3aeb0?source=cve