Recovering a compromised Bricks or WordPress site
This article was originally published after the February 2024 Bricks security incident. That incident has passed, but the recovery workflow below remains useful for any Bricks or WordPress site that may have been compromised.
The specific February 2024 Bricks RCE vulnerability was addressed in Bricks 1.9.6.1, released on February 13, 2024. Sites running Bricks 1.9.6.1 or later are not affected by that specific vulnerability. However, updating Bricks does not automatically clean a site that was already compromised before the update.
Before you start
Section titled “Before you start”These are general recovery steps. The right cleanup path depends on your hosting environment, backups, plugins, custom code, and the type of compromise.
Work from a recent backup or a cloned copy whenever possible. Keep notes of what you find, including suspicious users, files, redirects, cron jobs, changed credentials, and timestamps.
Immediate containment
Section titled “Immediate containment”- Take a fresh backup: Before changing anything, capture the current files and database so your host or security team can review evidence if needed.
- Restrict public traffic: If the site appears actively compromised, temporarily restrict access using your host’s tools, maintenance mode, firewall rules, or IP allowlisting.
- Update everything: Update Bricks, WordPress core, plugins, and themes to their latest versions.
- Disable suspicious access: Remove unknown administrator accounts, revoke unfamiliar API keys, and disable plugins or custom code you do not recognize.
- Contact your host: Ask your hosting provider to check server logs, malware scans, file changes, outgoing mail, and suspicious processes.
Restrict public traffic while cleaning
Section titled “Restrict public traffic while cleaning”If you must clean the live site instead of a local or staging copy, keep public access restricted until the cleaned site is deployed and checked. Prefer your host’s maintenance mode, firewall controls, password protection, or temporary IP allowlist.
On Apache hosts, one possible temporary .htaccess restriction is:
Order Deny,AllowDeny from allAllow from YOUR_IP_ADDRESSReplace YOUR_IP_ADDRESS with your public IP address. Remove the rule when the site is clean and ready to reopen. If you are unsure which method fits your host, ask the hosting provider before editing server rules.
Check for signs of compromise
Section titled “Check for signs of compromise”Review the site carefully before deciding that it is clean.
- Review user accounts
- Go to
Usersin the WordPress dashboard. - Look for accounts you do not recognize, especially users with the
Administratorrole. - Check recent profile changes and reset passwords for all trusted administrators.
- Inspect themes and plugins
- Go to
Appearance > ThemesandPlugins. - Remove anything you did not install or no longer need.
- Reinstall trusted themes and plugins from clean sources instead of keeping possibly modified files.
- Examine server files
- Use your host’s file manager, SFTP, SSH, or a local copy of the site files.
- Look for unfamiliar PHP files, random file names, recently modified files, and executable files in upload directories.
- On SSH, a command such as
find . -type f -mtime -14can help list files changed in the last 14 days. Adjust the time window to match the suspected incident.
- Review redirects and server rules
- Check
.htaccess, web server redirects, CDN redirects, firewall rules, and any redirect plugins. - Look for rules that send visitors to unfamiliar domains or only affect certain user agents.
- Check cron jobs and scheduled tasks
- Review host-level cron jobs in your hosting control panel.
- Review WordPress cron events with a trusted tool such as WP Crontrol.
- Remove unknown recurring tasks.
- Review posts, pages, and templates
- Check posts, pages, custom post types, Bricks templates, reusable content, and custom code areas.
- Look for injected scripts, unfamiliar links, hidden content, or changed embeds.
- Review logs and performance anomalies
- Ask your host for access logs, error logs, and malware scan results.
- Look for unusual login attempts, unexpected CPU usage, outgoing mail spikes, 500 errors, or repeated requests to suspicious files.
Clean the site
Section titled “Clean the site”If you find evidence of compromise, clean from a trusted environment instead of editing a live, actively compromised site.
- Restore or rebuild from a clean point
- Restore a backup from before the compromise, or rebuild the site from clean WordPress, plugin, theme, and Bricks files.
- If you are not sure which backup is clean, restore locally and repeat the checks above before deploying it.
- Reinstall WordPress core
- In the dashboard, use
Dashboard > Updates > Re-install versionwhere available. - Or reinstall WordPress core files from a clean WordPress download.
- Reinstall plugins and themes
- Update or reinstall every plugin and theme from trusted sources.
- For premium plugins and themes, download clean copies from the vendor.
- Remove abandoned or unnecessary plugins.
- Update Bricks
- Update Bricks to the latest available version through
Dashboard > Updatesor your Bricks account workflow. - Do not restore an old Bricks version as part of cleanup.
- Rotate secrets and credentials
- Change WordPress administrator passwords.
- Change hosting, SFTP, SSH, database, email, SMTP, payment, and API credentials.
- Generate new WordPress authentication salts using the WordPress secret-key generator.
- Replace exposed license keys or ask vendors to rotate them when needed.
- Replace
wp-config.phpif needed
- If you suspect file tampering, create a fresh
wp-config.phpfrom a cleanwp-config-sample.php. - Re-enter database details and any required custom settings manually.
- Check permissions
- Confirm your file and folder permissions match your host’s recommendations.
- Common defaults are
755for directories and644for files, but managed hosts may use different settings.
- Deploy the clean site
- Move the cleaned local or staging site back to production.
- Keep public access restricted until the cleaned site is live, updated, and checked again.
After cleanup
Section titled “After cleanup”Continue monitoring the site after it is back online.
- Run a server-level malware scan through your host.
- Run an application-level scan with a trusted WordPress security plugin if appropriate.
- Review new user registrations and administrator accounts.
- Watch error logs, redirects, outgoing mail, and performance.
- Keep Bricks, WordPress, plugins, and themes updated.
- Schedule regular off-site backups.
- Review the WordPress Hardening Guide for broader server and WordPress hardening practices.
Historical note
Section titled “Historical note”This page was created after a February 2024 vulnerability affecting Bricks versions before 1.9.6.1. Bricks 1.9.6.1 included the security patch for that vulnerability. For current sites, the guidance is simpler: keep Bricks on the latest available version and follow the recovery checklist above if you suspect compromise.
Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.