wp_critical_file_modified
Severity: Critical
Signal: wp.integrity — wp-config.php or .htaccess hash changed
What this signal means
The hash of a critical WordPress file changed since the last check. The plugin performs integrity checks on wp-config.php and .htaccess hourly. A hash change means the file content was modified.
What surprise this prevents
Malicious code injected into wp-config.php or .htaccess — redirecting traffic, exposing credentials, or enabling backdoors — without any visible indication to a casual observer.
Why it matters
These two files control your entire WordPress installation:
wp-config.php— database credentials, security keys, site URL, debug settings. Modification could expose credentials or introduce malicious configuration..htaccess— URL routing, PHP settings, access controls. Modification could redirect traffic, expose files, or disable security headers.
Unauthorized modification of either file is a serious security incident.
Investigate
View entity alerts in Logystera →
Check:
payload.file— which file changed?- When did the hash change? Correlate with any recent admin actions, plugin updates, or deployments.
Immediately compare the current file against your known-good backup or your last git commit.
Recommended actions
Immediate:
- Download and review the changed file. Connect via FTP, SFTP, or SSH and open the file. Look for:
- Unknown database hosts or credentials.
- Added
eval(),base64_decode(), or obfuscated code blocks. - Added redirect rules in
.htaccess(e.g.RewriteRulepointing to external domains). -
Added
FilesMatchdirectives allowing PHP execution in upload directories. -
Restore from backup if you find unauthorized changes:
bash # Replace with a known-good version cp wp-config.php.backup wp-config.php cp .htaccess.backup .htaccess -
Rotate all credentials in
wp-config.php— database password, security keys and salts: - Generate new salts at: https://api.wordpress.org/secret-key/1.1/salt/
-
Update database password in both
wp-config.phpand your MySQL user. -
Scan for malware using Wordfence or Sucuri Scanner.
-
Check server access logs for the time of the modification — look for unusual IP addresses accessing admin pages or file manager tools.
If the change was legitimate (you made a configuration change or a deployment updated the file), the alert is expected. The hash baseline updates automatically on the next check.
When to safely ignore
If you made a deliberate configuration change — updated a database credential, added a custom rewrite rule, deployed a code change — the alert is expected. The hash baseline updates automatically on the next integrity check.
Correlate the timing with your deployment logs to confirm the change was intentional.
Signal reference
{
"event_type": "wp.integrity",
"payload": {
"type": "file_changed",
"file": "wp-config.php",
"previous_hash": "a1b2c3d4...",
"current_hash": "e5f6a7b8..."
}
}