Ninja Forms XSS Hack: How to Check Your Site Is Clean

Ninja Forms XSS hack check card

In early October, attackers started using a Ninja Forms bug to take over WordPress sites. They didn’t need to log in. They filled in a public form with a booby-trapped answer and waited for an administrator to open that submission in wp-admin. When the admin did, a script ran with the admin’s own session and quietly added a fake plugin and new administrator accounts. The Ninja Forms team had already fixed the bug, but updating only closes the door. It doesn’t remove anyone who already got in.

Last updated 21 November 2026. We read the CVE records, Patchstack’s analysis of the campaign, BleepingComputer’s report and the plugin’s changelog. We downloaded Ninja Forms 3.15.3, 3.15.4, 3.15.5 and 3.16.1 from WordPress.org and compared the code. We did not reproduce the exploit, and we don’t have an infected site to show you.

The short version

  • Update Ninja Forms to 3.16.1, the current release. If you can’t do that today, 3.15.6 is the lowest version that covers every Ninja Forms CVE we found from this autumn. 3.15.4 fixes the exploited bug but not the ones found after it.
  • Don’t trust the Users screen. The malware hides one of its admin accounts from it. Check the database directly.
  • Don’t trust file dates. The malware backdates its files so they look older than WordPress itself.

What happened

Date (2026) What happened
7 September Ninja Forms 3.15.3 released.
21 September 3.15.4 released: “strengthen output escaping in admin submission edit screen”.
22 September The bug published as CVE-2026-94504 by Wordfence (CVSS 7.2). WPScan published what reads like the same bug as CVE-2026-92438.
28 September 3.15.5 released, fixing a second stored XSS in rich text Paragraph Text fields (CVE-2026-90438).
1 October The attackers’ domain, imgcdn1.com, registered (per Patchstack).
4 to 5 October Patchstack sees the same payload used against WPC Product Bundles for WooCommerce, then against Ninja Forms.
15 October to 2 November 3.15.6 and 3.15.7 released, both with more security fixes.
9 November 3.16.1, the current release.

Patchstack says “exploitation volume remains limited in our telemetry”. That’s good news, but it’s one vendor’s view, and a site that was hit gives no obvious sign. One wording note: BleepingComputer says both flaws “require an authenticated session to exploit”. We read that as the script needing a logged-in admin to open it. The attacker submitting the form doesn’t need an account, and both CVE records say so.

Which version do you actually need?

Most coverage says “3.15.4 or later”. That fixes the exploited bug, but Ninja Forms had a busy autumn. These are the entries we checked in the CVE records and Patchstack’s database:

CVE What it is Affected Fixed in
CVE-2026-94504 Stored XSS via a plain Paragraph Text field, runs on the old submission edit screen. The exploited one. up to 3.15.3 3.15.4
CVE-2026-91827 PHP object injection when an admin exports submissions to CSV. Needs suitable code from another plugin or theme to do real harm. 3.15.3 3.15.4
CVE-2026-102385 Unauthenticated XSS up to 3.15.3 3.15.5
CVE-2026-90438 Stored XSS via rich text Paragraph Text fields up to 3.15.4 3.15.5
CVE-2026-109997, CVE-2026-100151 Two more XSS bugs up to 3.15.5 3.15.6
CVE-2026-100155, CVE-2026-101326 Shortcode execution, one without login, one for subscribers up to 3.15.5 3.15.6

So 3.15.6 is the floor. 3.15.7 adds more hardening that we couldn’t match to a CVE, and 3.16.1 is what WordPress.org serves today. Just take 3.16.1.

What the fix changed

Ninja Forms saves each submission as a hidden post of type nf_sub, with each answer in a custom field named _field_ plus the field’s ID. In 3.15.3 the old submission edit screen printed a Paragraph Text answer straight into a text box. This is the function in includes/Fields/Textarea.php, before and after:

// 3.15.3
return "<textarea class='widefat' name='fields[$id]'>$value</textarea>";

// 3.15.4
return "<textarea class='widefat' name='fields[$id]'>" . esc_textarea( $value ) . "</textarea>";

In plain words: if an answer contains </textarea>, the browser thinks the box has ended, and whatever comes next is treated as part of the page. Patchstack’s captured payload did exactly that, closing the box and then adding an image tag whose error handler loads the attacker’s script. The fix runs the answer through WordPress’s esc_textarea(), so it shows up as text. The same release added the matching escaping to the Date field’s edit box, and stopped the CSV export from rebuilding PHP objects out of submitted data.

One detail matters for the clean-up below. Ninja Forms stores plain-text answers HTML-encoded and decodes them when it reads them back. So a payload sits in the database as &lt;/textarea&gt;, not </textarea>. If you only search for <script, you can miss it.

The 3.15.5 fix is in the JavaScript of the newer Submissions page. To turn a rich text answer into plain text, 3.15.4 put it inside a throwaway page element. Browsers act on HTML put there, including image error handlers. 3.15.5 uses the browser’s DOMParser instead, which reads the HTML without running anything.

Credit where it’s due: the Ninja Forms team shipped the escaping fix two weeks after 3.15.3 and a day before the CVE went public. They followed it with three more security releases in six weeks. That’s the right response.

How many sites are still behind?

WordPress.org reports 500,000+ active installs. Its version stats only split by branch: 39.65% on 3.16, 16.2% on 3.15, 10.36% on 3.14, 6.63% on 3.6, 6.13% on 3.8 and 21.03% “other”. We can’t tell how many of the 3.15 sites are on an old 3.15 release. But about 60% of sites are not on 3.16. And the 3.14, 3.8 and 3.6 branches alone, about 23% of sites, are all older than every fix in the table above.

Check your site, in this order

Take a full backup of files and database first, even if you suspect it’s dirty. If you find something, you’ll want the evidence. Everything below is read-only unless we say otherwise. Run the commands from your WordPress folder.

1. Update and confirm the version

wp plugin update ninja-forms
wp plugin get ninja-forms --field=version

2. List administrators two ways

First the normal way:

wp user list --role=administrator --fields=ID,user_login,user_email,user_registered

Don’t stop there. According to Patchstack, the hidden account is filtered out by a must-use plugin that hooks WordPress’s user query. WP-CLI loads must-use plugins too, so we’d expect it to hide the account from this list as well. Ask the database directly. Check your table prefix with wp db prefix and replace wp_ below if yours differs (in both places, including wp_capabilities):

wp db query "SELECT u.ID, u.user_login, u.user_email, u.user_registered FROM wp_users u JOIN wp_usermeta m ON m.user_id = u.ID WHERE m.meta_key = 'wp_capabilities' AND m.meta_value LIKE '%administrator%'"

Any account in the second list but not the first is hiding. Patchstack says the hidden one gets a routine-sounding name like support, updater or maintenance, and an @wordpress.org email. Look closely at any admin created since late September.

3. Look at plugins and must-use plugins

wp plugin list
wp plugin list --status=must-use
ls -la wp-content/mu-plugins/

Red flags from the campaign: a plugin called WP Smart Thumbnails (folder wp-smart-thumbnails), and must-use files named class-wp-token-validate.php or class-wp-query- followed by eight hex characters. Must-use plugins load on every request and never show on the normal Plugins screen. Deleting the fake plugin doesn’t remove them.

4. Check the options table and cron

wp db query "SELECT option_name FROM wp_options WHERE option_name IN ('fz_emer_done_v1','fz_emer_login_tokens')"
wp cron event list --fields=hook,next_run_relative,recurrence

If fz_emer_login_tokens exists, Patchstack says at least one secret login link is live. It logs the holder in as your oldest administrator. Cron isn’t part of Patchstack’s write-up, but unknown hooks are worth a look while you’re there.

5. Find changed files without trusting dates

The usual trick is find -newermt, which uses the modified date. This malware fakes that date. The “changed” time (ctime) is harder to fake, because the system sets it whenever a file changes:

find wp-content -name '*.php' -newerct '2026-10-01'
wp core verify-checksums
wp plugin verify-checksums --all

Expect noise. Every plugin you’ve updated since then will show up in the find list, and premium plugins can’t be checked against WordPress.org. You’re looking for PHP files you can’t explain, especially in mu-plugins and uploads.

6. Search the stored submissions

Use the database rather than clicking through submissions in wp-admin. This looks for both the raw and the HTML-encoded forms, plus the attackers’ domain:

wp db query "SELECT p.ID, p.post_date, m.meta_key FROM wp_posts p JOIN wp_postmeta m ON m.post_id = p.ID WHERE p.post_type = 'nf_sub' AND (m.meta_value LIKE '%<script%' OR m.meta_value LIKE '%&lt;script%' OR m.meta_value LIKE '%textarea%' OR m.meta_value LIKE '%onerror%' OR m.meta_value LIKE '%javascript:%' OR m.meta_value LIKE '%imgcdn1%')"

A hit means someone tried. It doesn’t prove the script ran. That only happened if an admin opened that submission on an unpatched version, so steps 2 to 5 are what tell you whether it worked.

7. Check your access logs

Ask your host where they are, then:

grep -E '_wplogin=|wp-smart-thumbnails|imgcdn1' access.log

Hits on wp-login.php?_wplogin= mean the secret login link was used.

If you find something

Treat the whole site as compromised, not just the bits you found. Patchstack’s write-up describes four separate ways back in: a visible admin, a hidden admin, the secret login link and a file manager that needs no password. Removing one leaves the other three. In order:

  1. Delete the fake plugin, the two must-use files and both fz_emer_ options (wp option delete fz_emer_done_v1 fz_emer_login_tokens). Delete accounts you didn’t create.
  2. Change every administrator’s password, including your oldest admin, since the secret link signed in as that account.
  3. Replace the security keys in wp-config.php with wp config shuffle-salts. That logs everyone out everywhere.
  4. Change the database password and your hosting and SFTP passwords.
  5. Reinstall WordPress core and every plugin and theme from fresh copies, not from your current files.
  6. Tell your host. They can scan the server and check logs you can’t see.

We went through the same rotate-everything list after a server breach in our shared hosting breach checklist, and a similar hidden-access problem in our post on UpdraftCentral keys. If you can’t update right away, virtual patching can block known attack requests in the meantime, but it won’t clean a site that’s already hit.

Frequently asked questions

Is updating to Ninja Forms 3.15.4 enough?

It fixes the bug used in this campaign, but not the later ones. Other XSS and shortcode bugs were fixed in 3.15.5 and 3.15.6. Update to 3.16.1, the current release, or at least 3.15.6.

My Users screen looks normal. Does that mean I’m clean?

No. The malware hides one administrator from the Users screen, the Administrator filter and the user counts. Compare it with a database query of everyone who has the administrator role, and check the mu-plugins folder.

Should I delete old Ninja Forms submissions?

Not by default. After updating, the edit screen escapes the stored text, so the old payloads can’t run there any more. Search for them first and keep them as evidence while you check the site. Delete them once you know what happened.