Skip to content

Suppress checksum-verified files from the suspicious-filename check - #227

Merged
jasperf merged 1 commit into
mainfrom
fix/checksum-verified-filename-skip
Sep 10, 2026
Merged

Suppress checksum-verified files from the suspicious-filename check#227
jasperf merged 1 commit into
mainfrom
fix/checksum-verified-filename-skip

Conversation

@jasperf

@jasperf jasperf commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Checksum verification (v5.22.0) only ever skipped the content pattern-match scan. scanner-general.php has a separate suspicious-filename check that runs during file discovery, and it kept flagging unmodified core files whose names happen to match a known-malware substring — confirmed live against aseonomics.com production:

  • wp-includes/SimplePie/src/Cache/MySQL.php and wp-includes/SimplePie/library/SimplePie/Cache/MySQL.php matching mysql.php
  • wp-includes/Text/Diff/Engine/shell.php matching shell.php

Both are stock, unmodified WordPress core files that already passed checksum verification, so this was still a documented false positive the checksum feature didn't actually eliminate.

Fix

A file already confirmed checksum-clean is now skipped by the filename check too — same reasoning as the pattern-match skip: an unmodified core/plugin file can't be the payload regardless of what its filename looks like. Non-verified files (uploads, themes, custom plugins) are scanned exactly as before, so a real dropped webshell named c99.php or shell.php there is still caught.

scanner-targeted.php has no filename check and needs no change.

Testing

  • Verified against real production data: re-ran the (already-fixed) scanner directly over SSH against aseonomics.com before this change, confirming these two files were the only filename hits.
  • Local test: injected a verified-file entry for a fake SimplePie/Cache/MySQL.php alongside an actual malicious c99.php upload. Confirmed the verified file no longer appears under suspicious filenames (and is counted in a new "suppressed" stat), while c99.php is still caught as both a suspicious filename and a CRITICAL pattern match.

Follow-up to #225 / #226.

Checksum verification (5.22.0) only skipped the content pattern-match
scan. The separate suspicious-filename check in scanner-general.php,
which runs during file discovery, still flagged unmodified core files
whose names happen to match a known-malware substring -
wp-includes/SimplePie/src/Cache/MySQL.php and
wp-includes/Text/Diff/Engine/shell.php match "mysql.php"/"shell.php"
- even after those exact files passed checksum verification.

A file already confirmed checksum-clean is now skipped by the
filename check too, for the same reason the pattern-match scan skips
it: an unmodified core/plugin file can't be the payload regardless of
what its filename looks like. Non-verified files (uploads, themes,
custom plugins) are scanned exactly as before, so a real dropped
webshell named c99.php or shell.php is still caught.

scanner-targeted.php has no filename check and needs no change.

Verified against a real WordPress install (aseonomics.com production)
where these two files were previously flagged, and with a local test
injecting a verified-file entry alongside an actual malicious upload
to confirm the real threat is still caught while only the verified
file is suppressed.
@jasperf
jasperf merged commit c06e2d3 into main Sep 10, 2026
1 check passed
@jasperf
jasperf deleted the fix/checksum-verified-filename-skip branch September 10, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant