Security

File-Upload Flaw in a Plugin: How to Check and Clean

Patching a file-upload flaw does not remove what was uploaded. Find PHP in uploads, read logs, verify checksums, block execution and clean up in order.

Varun DubeyVarun Dubey
·11 min read
Terminal showing a find command listing PHP files in the uploads folder and a 403 response after blocking PHP execution

Updating the plugin closes a file-upload hole. It does not remove a file that was uploaded through it before you updated. So there are two jobs: confirm the version is fixed, then check whether anything was planted while the site was exposed. Do the version check first, the PHP-in-uploads check second, and block PHP in uploads before you clean anything.

Everything below works for any plugin file-upload flaw. We use two real, recent cases as the worked examples: Bricksforge (CVE-2026-85097) and Gravity Forms (CVE-2026-84434). Both IDs were checked on CVE.org and Patchstack on 15 Nov 2026. The shell commands were run on a scratch directory with planted test files, and the Nginx and Apache rules were tested against a real server container that returned 403 for PHP-style files and 200 for images.

Run the commands from the WordPress root over SSH. They only read, unless a comment says the command changes the site. A few use GNU options, so on macOS or BSD use the portable forms we show.

What are the two flaws we use as examples?

Bricksforge

Gravity Forms

CVE

CVE-2026-85097

CVE-2026-84434

Severity

CVSS 10.0 in the Patchstack advisory, 9.8 in the CVE record

CVSS 9.8 in the CVE record

Type

Unauthenticated arbitrary file upload leading to PHP execution

Unauthenticated arbitrary file upload, remote code execution possible

Affected versions

3.1.8.9 and earlier

3.1.0.4 and earlier

Fixed in

3.1.8.10 (Patchstack names it as the fix)

3.1.1 (3 September 2026) is the first release after the affected range; its changelog only says “Added security enhancements”

Condition

None stated. Any site on an affected version.

A public form with a File Upload field whose Visibility is set to Hidden

Exploited in the wild

Yes. Patchstack saw first attempts on 7 October 2026 at 21:47 UTC.

Not stated in the CVE record or the vendor changelog

Published

CVE record 8 October 2026

CVE record 19 September 2026

Sources

Patchstack, CVE.org, vendor changelog

CVE.org, vendor changelog

Checked on 15 Nov 2026. Both plugins have moved on since: Bricksforge is at 4.1.0 (12 November) and Gravity Forms is at 3.2.2 (5 November). Bricksforge also shipped a second, separate upload fix in 4.0.1 on 8 October, which the vendor lists next to CVE-2026-85097 and recommends for every site with its Pro Forms element active. So “3.1.8.10 or later” is the minimum for this CVE, not the version to aim for.

How Bricksforge fails. Per Patchstack, it checks a file’s type when the file is first uploaded, but when the form is submitted later it trusts the file details the browser sends back, including the destination url inside a temporaryFileUploads parameter. An attacker uploads a file that is a valid GIF and also contains PHP, then submits a form whose destination ends in .php. The plugin writes the content to that name, and the server runs it when someone requests the file.

How Gravity Forms fails. The CVE record describes a mismatch between the validation step and the step that saves the file. Hidden File Upload fields skip the extension check, and a file that was rejected can still reach upload_file() without being checked again. It only applies to forms with a File Upload field set to Hidden, which you can test for in a couple of minutes.

Is the plugin on a fixed version?

Start here, because the rest only matters for the time the site spent on an affected version.

# checked on 15 Nov 2026
# Prints the installed version, or an error if the plugin is not installed.
wp plugin get bricksforge --field=version
wp plugin get gravityforms --field=version
# Lists every plugin with its version and whether an update is waiting.
wp plugin list --fields=name,status,version,update

Both of these are commercial plugins that update through their own licence, so an expired licence means no update arrives. If wp plugin update offers nothing on an old version, download the current zip from your vendor account and install it over the top:

# Changes the site. Take a backup first.
wp plugin install /path/to/plugin.zip --force

For a fleet of sites, the same check over WP-CLI aliases:

# checked on 15 Nov 2026. Assumes aliases are defined in ~/.wp-cli/config.yml
for site in $(wp cli alias list --format=json | jq -r 'keys[]' | grep -v '@all'); do
  for p in bricksforge gravityforms; do
    v=$(wp "$site" plugin get "$p" --field=version 2>/dev/null) && echo "$site $p $v"
  done
done

How long was the site exposed?

This decides how hard you look. Work out the gap between when exploitation or disclosure began and when this site was patched. The plugin’s main file timestamp is a rough proxy for the last update.

# GNU/Linux
stat -c '%y %n' wp-content/plugins/bricksforge/bricksforge.php 2>/dev/null
stat -c '%y %n' wp-content/plugins/gravityforms/gravityforms.php 2>/dev/null
# macOS / BSD
stat -f '%Sm %N' wp-content/plugins/gravityforms/gravityforms.php

Your situation

What it means

Bricksforge patched before 7 October 2026, 21:47 UTC

Patched before the first exploitation Patchstack recorded. Run the uploads and log checks once as a sanity check.

Bricksforge patched after that time, or still unpatched

Treat the site as possibly compromised. Do every step.

Gravity Forms on 3.1.1 or later since early September

Fixed before the CVE became public on 19 September.

Gravity Forms on 3.1.0.4 or earlier after 19 September, with a hidden upload field

Exposed to a public, documented flaw. Do every step.

Gravity Forms old, but no hidden upload field on any form

The stated condition is not met. Update anyway.

Note the Gravity Forms timeline. The release after the affected range shipped on 3 September, with the changelog line “Added security enhancements.” The CVE was published on 19 September, sixteen days later. A site that updates on release was never exposed to the documented condition. A site that waited for a named vulnerability spent those sixteen days on a version with a critical flaw. We come back to this at the end.

Do any Gravity Forms forms have a hidden File Upload field?

In the admin, open each form, click each File Upload field and look at Visibility under the Advanced tab. For more than a few forms, list them from the command line. This calls the Gravity Forms API, and we did not run it against a live Gravity Forms install, so treat it as untested and try it on staging first.

# UNTESTED against a live install. Lists File Upload fields that are not visible.
wp eval '
if ( ! class_exists( "GFAPI" ) ) { echo "Gravity Forms not active\n"; return; }
foreach ( GFAPI::get_forms() as $form ) {
  foreach ( $form["fields"] as $field ) {
    if ( $field->type === "fileupload" && $field->visibility !== "visible" ) {
      printf( "form %d (%s) field %d visibility=%s\n", $form["id"], $form["title"], $field->id, $field->visibility );
    }
  }
}'

No output means no form meets the condition in the CVE record. If one does, ask why the field is hidden. If nothing depends on it, remove it.

How do I find PHP files in the uploads folder?

The uploads directory should hold media. On most sites it holds no PHP at all, apart from the tiny index.php that some plugins drop in to stop directory listing. This is the most useful check after any upload flaw.

# checked on 15 Nov 2026. Portable: works with GNU and BSD find.
find wp-content/uploads -type f \
  \( -iname '*.php' -o -iname '*.php[0-9]' -o -iname '*.phtml' -o -iname '*.pht' \
     -o -iname '*.phtm' -o -iname '*.phps' -o -iname '*.phar' \) \
  -exec ls -l {} +

The extension list is deliberate. Patchstack saw attackers trying .php5, .php7, .php8, .phtml, .pht, .phtm and .phps, mixed case such as .PHP and .pHp, and encoded forms of the extension. That is why the search uses -iname. On GNU find you can sort by date by replacing the last line with -printf '%TY-%Tm-%Td %TH:%TM %s %p\n' | sort -r.

Then the Bricksforge-specific places and the filename pattern from the advisory:

# The plugin's temporary upload directory
ls -la wp-content/uploads/bricksforge/tmp/ 2>/dev/null

# Destination filenames Patchstack saw: login_admin_*.php, placed in dated upload folders
find wp-content/uploads -type f -iname 'login_admin_*'

For Gravity Forms, uploads usually sit under wp-content/uploads/gravity_forms/. Run the first find against that path too, and look at what it holds.

What about images that secretly contain PHP?

The Bricksforge attack starts with a file that passes as an image and holds PHP. That file is harmless while it keeps an image extension, but finding one tells you someone tried.

# Image files that contain a PHP opening tag. Expect zero results.
grep -rlaE '<\?(php|=)' wp-content/uploads \
  --include='*.gif' --include='*.png' --include='*.jpg' --include='*.jpeg' --include='*.webp' --include='*.ico'

A hit in an old photo is usually a false alarm from camera metadata. A hit in a tiny GIF created last month is not. We ran this against a test GIF carrying a PHP tag and it listed the file.

What changed in wp-content during the exposure window?

# Files under wp-content changed since the Bricksforge campaign began,
# leaving out normal media types. Works with GNU and BSD find.
find wp-content -type f -newermt '2026-10-07 21:00' \
  ! -iname '*.jpg' ! -iname '*.jpeg' ! -iname '*.png' ! -iname '*.webp' ! -iname '*.gif' \
  ! -iname '*.svg' ! -iname '*.pdf' ! -path '*/cache/*' \
  -exec ls -l {} +

Compare the list with what you know changed: plugin updates, a theme edit, a backup archive. Anything else needs opening. Change the date to match the flaw you are chasing.

What do the access logs show?

An attacker who tidies up can delete files. Logs still show the attempt. Log paths vary by host, so adjust LOG. Rotated, compressed copies sit beside the current log on many servers, and zgrep reads both.

# checked on 15 Nov 2026
LOG='/var/log/nginx/access.log*'   # or /var/log/apache2/access.log*, or your host's per-site log

# Bricksforge: the endpoints named in the Patchstack advisory
zgrep -hE 'bricksforge/v1/form_submit|bricksforge_regenerate_nonce|bricksforge_form_submit' $LOG | tail -50

# Any request for a PHP-style file under uploads, counted by status, client and path
zgrep -hiE '"(GET|POST) [^" ]*/wp-content/uploads/[^" ]*\.(php[0-9]?|phtml|pht|phtm|phps|phar)' $LOG \
  | awk '{print $9, $1, $7}' | sort | uniq -c | sort -rn | head -40

Read the second command by status code. The field positions assume the common combined log format, so check a line of your own log first.

  • 404 for a PHP file under uploads: someone asked for a file that is not there. Background noise, or an attempt that failed.
  • 403: the server refused to run it. That is the control we set up later in this guide.
  • 200: the server found and ran a PHP file in uploads. Treat it as a confirmed compromise, even if the file is gone now.

For Bricksforge, a call to bricksforge_regenerate_nonce followed within seconds by a POST to form_submit from the same address is the sequence the advisory describes. Patchstack recorded 63 source addresses, including a group of 44 sending identical payloads within seconds, so do not expect a single IP to search for. If your host gives you no raw logs, ask for the date range you need, and check any firewall or security plugin for blocked-request records on the same paths.

Should I check core and plugin files with checksums?

Yes, but know what the tool covers. WordPress.org publishes checksums for core and for plugins hosted on WordPress.org. WP-CLI compares your files with them.

# checked on 15 Nov 2026
wp core verify-checksums
# Also warns about non-WordPress files sitting in the root directory
wp core verify-checksums --include-root

# Plugins hosted on WordPress.org only
wp plugin verify-checksums --all

Commercial plugins such as Bricksforge and Gravity Forms are not on WordPress.org, so there is nothing to compare them against. A clean result for them proves nothing. Reinstall those from a fresh vendor download. The WP-CLI docs describe the command as verifying plugin files against WordPress.org checksums. There is also a documented gap in the command: a plugin folder whose main file is missing or renamed can be skipped while the run still reports success (wp-cli/checksum-command issue 121). Look at any plugin folder that is not in the list.

I found something. What is the cleanup order?

Do not start by deleting the file. A web shell is how the attacker gets back in. The order below keeps evidence, stops further damage, then removes things in a way that does not let them return.

  1. Block PHP execution in uploads first. Apply the rule from the next section so nothing under uploads can run while you work.
  2. Keep the evidence. Copy the suspicious files and the matching log lines to a place outside the web root, with timestamps intact: mkdir -p ~/incident-$(date +%F) && cp -a --parents <suspicious-file> ~/incident-$(date +%F)/
  3. Take a full backup of the current state, files and database, labelled as infected. You may need to look back at it.
  4. Verify core and WordPress.org plugins with the checksum commands above, and reinstall commercial plugins from a fresh vendor download.
  5. Look for accounts you did not create. Our guide to the hidden WordPress admin account audit covers cases where the Users screen has been filtered to hide one.
  6. Look for code that brings the attacker back: must-use plugins, drop-ins, scheduled tasks, and the files PHP loads on every request.
  7. Remove what you found, then rotate every secret the attacker could have read.
  8. Run the file and log checks again a day later and a week later. A reinfection means something was missed.

Steps 5 and 6 as commands:

# checked on 15 Nov 2026
wp user list --role=administrator --fields=ID,user_login,user_email,user_registered
wp user list --orderby=registered --order=DESC --number=20 --fields=ID,user_login,roles,user_registered

# Persistence: mu-plugins, drop-ins, cron
ls -la wp-content/mu-plugins/ 2>/dev/null
ls -la wp-content/*.php
wp cron event list --fields=hook,next_run_relative,recurrence

# Files that run on every request
ls -la wp-config.php .htaccess index.php
find . -maxdepth 2 -name '.htaccess' -newermt '2026-09-01'
find . -maxdepth 3 \( -name '.user.ini' -o -name 'php.ini' \)

Step 7, rotating secrets. The first two commands change the site: the salts log everyone out, and the application-password command deletes every application password for the user you name, so run it per administrator and tell people first.

# Changes the site. Logs every user out.
wp config shuffle-salts

# Changes the site. Revokes all application passwords for one user (login, email or ID).
wp user application-password delete <user> --all

Also change the database password, admin passwords, and any API keys stored in plugin settings. If the logs show a 200 for a PHP file in uploads and you cannot account for what it did, the safest route is to restore from a backup taken before the exposure window, update the plugin before the site comes back, then rotate credentials. If you would rather hand this over, our WordPress malware removal service covers investigation, removal and hardening.

How do I stop PHP running in the uploads folder?

Both flaws end the same way: a PHP file under wp-content/uploads is requested and the server runs it. If the server refuses to run PHP from that directory, the upload still happens but it does nothing. This control protects you from the next flaw of this type before it has a CVE number.

Nginx. Place this above the general PHP location block, then reload. Nginx tries regex locations in the order they appear, so a PHP block placed earlier would win.

# checked on 15 Nov 2026. Deny any PHP-style file under uploads, in any letter case.
location ~* ^/wp-content/uploads/.*\.(php[0-9]?|phtml|pht|phtm|phps|phar)$ {
    return 403;
}

Apache 2.4. Put this in wp-content/uploads/.htaccess. It only takes effect if the server allows overrides for that directory (AllowOverride AuthConfig or All), so test it. If you control the server config, put the same FilesMatch block inside a <Directory> section instead.

# checked on 15 Nov 2026 (Apache 2.4 syntax)
<FilesMatch "(?i)\.(php[0-9]?|phtml|pht|phtm|phps|phar)$">
    Require all denied
</FilesMatch>

Then prove it. Create a harmless test file, request it, and remove it:

echo '<?php echo "executed";' > wp-content/uploads/exec-test.php
curl -s -o /dev/null -w '%{http_code}\n' https://example.com/wp-content/uploads/exec-test.php   # expect 403
rm wp-content/uploads/exec-test.php

Three limits to know:

  • An .htaccess rule in uploads can be overwritten by an upload flaw that lets the attacker choose the filename and path. A rule in the main server configuration cannot. Use the server config where you have access to it.
  • On managed hosts where you cannot edit the Nginx config, ask support whether PHP execution in uploads is blocked, then run the test above to confirm the answer.
  • This blocks execution from uploads only. A flaw that lets an attacker write into a plugin or theme folder needs different handling.

There is more on this, including file-type checks and storing uploads outside the web root, in Hardening a Site That Accepts Member Uploads. File-upload bugs are a repeat offender: our April 2026 vulnerability roundup covers an upload flaw in another form plugin.

Common mistakes people report

These come up again and again in cleanup write-ups, WP-CLI issues and vendor advisories. Checked on 15 Nov 2026.

  • Deleting the file and calling it done. Cleanup guides keep describing the same pattern: a backdoor in a theme, plugin folder, uploads or mu-plugins restores the malware after a partial cleanup. Sucuri’s write-up on PHP re-infectors is a good read.
  • Trusting a clean checksum result for paid plugins. Checksums exist only for WordPress.org plugins, and the command can silently skip a folder whose main file is missing, as in this WP-CLI issue.
  • Searching only for files ending in .php. Patchstack’s Bricksforge advisory lists .php5, .phtml, .pht, mixed case and encoded extensions that were tried in the wild.
  • Cleaning before blocking execution. If uploads can still run PHP, a half-removed shell or a fresh upload undoes the work. Block first.
  • Forgetting persistence outside uploads. Write-ups of repeat infections describe loaders in wp-content/mu-plugins/, theme files and scheduled tasks that rebuild what you deleted. Check all of them, as the Sucuri piece above explains.
  • Updating and moving on. Patchstack’s own advice for sites that ran a vulnerable version unprotected is to review historical logs and the host for unexpected PHP files and unauthorised changes. The update only stops new uploads.

What does this change about how we update plugins?

From Bricksforge: the window is hours. Patchstack recorded the first exploitation attempt on 7 October 2026 at 21:47 UTC, and the CVE record is dated the next morning. For a critical unauthenticated flaw in a plugin you run, “we update on Fridays” is not a plan. You need a way to hear about it the same day and a way to patch outside the normal cycle.

From Gravity Forms: a vague changelog line can be the security fix. “Added security enhancements” appears in 3.1.1 on 3 September, again in 3.1.2 on 17 September and again in 3.1.3 on 1 October. From the wording alone you cannot tell which entry matters. Our working rule: any release note that mentions security, in any wording, goes out on the fast path. The full policy, including which updates go the same day and which wait, is in Update the Same Day or Wait?

A weekly check worth scheduling

The uploads check costs nothing to run on a schedule. This prints only when it finds something, so it suits cron with mail output. The -size -2 test skips index.php placeholders of 512 bytes or less.

#!/usr/bin/env bash
# checked on 15 Nov 2026. Reports PHP-style files under uploads, ignoring small index.php placeholders.
cd /path/to/wordpress || exit 1
found=$(find wp-content/uploads -type f \
  \( -iname '*.php' -o -iname '*.php[0-9]' -o -iname '*.phtml' -o -iname '*.pht' \
     -o -iname '*.phtm' -o -iname '*.phps' -o -iname '*.phar' \) \
  ! \( -name 'index.php' -size -2 \))
[ -n "$found" ] && printf 'PHP files in uploads on %s:\n%s\n' "$(hostname)" "$found"
exit 0

Questions people ask

I updated the plugin. Am I safe now?

You are safe from new uploads through that flaw. You are not protected from a file uploaded before the update. Run the uploads and log checks for the period the site was on an affected version.

How do I know if my site was hacked through Bricksforge?

Look for PHP-style files under wp-content/uploads, especially in uploads/bricksforge/tmp/ and any named login_admin_*, and search your access logs for requests to /wp-json/bricksforge/v1/form_submit. A logged request for a PHP file in uploads that returned 200 confirms code ran.

Is every Gravity Forms site affected by CVE-2026-84434?

No. The CVE record says exploitation needs a form with a File Upload field whose Visibility is Hidden, on a publicly accessible form, on version 3.1.0.4 or earlier. Check your forms for that field and update regardless.

Does a security plugin or host firewall make patching less urgent?

It can reduce the risk during the gap, if it has a rule for that specific flaw. It does not replace the patch, so test what it blocks instead of assuming. Blocking PHP execution in uploads is the more dependable safety net for this class of flaw.

Should I delete a suspicious PHP file as soon as I find it?

Copy it somewhere safe first, with the log lines that mention it. The file shows when the attacker got in and with what tool. Then block execution, investigate, and remove it.

Is it normal to have any PHP files in wp-content/uploads?

A few plugins add a small index.php to stop directory listing, and some store generated files there. Anything else, especially with a recent date and a random or admin-sounding name, should be opened and read.

Does wp plugin verify-checksums work for premium plugins?

No. It compares against checksums published by WordPress.org, so plugins hosted elsewhere have nothing to compare to. Reinstall those from the vendor.

Part of the Wbcom Designs family

The all-in-one WordPress community stack

Also ours: wbcomdesigns.comvapvarun.combrndle.com