❌

Vue normale

Reçu — 19 juillet 2026 ⏭ Search Results for “Advanced Editor Tools” | WPScan

26-Step WordPress Security Guide for Enterprise-Level Protection

Enterprise‑level organizations should enforce top‑of‑the‑line website security. Following the right WordPress security practices will help keep your customer data secure and protect your WordPress website from attacks. Failing to follow best practices, on the other hand, can have a long‑lasting impact on your business’ reputation.

Proper WordPress site security involves a lot of different tasks. These range from enforcing the use of strong credentials to monitoring user activity and conducting regular audits. At the enterprise level, it’s vital to leave no stone unturned.

In this article, we’ll discuss the risks associated with poor security practices. Then, we’ll go over WordPress security basics, as well as some advanced measures you can take. 

What are the risks associated with poor security practices?

Every WordPress site is vulnerable to breaches if its operators have poor security practices. The larger your business, the more dangerous those risks become. In this section, we’ll introduce some of the most common issues and explain how they can impact your organization.

Data breaches

There are news stories about data breaches almost every day. While every online business can fall prey to these breaches, if you run an enterprise‑level organization, this type of event will likely generate attention.

This can translate to a significant loss of trust from your customers, as well as steep financial losses in terms of future business, falling stock prices, and even fines. Depending on which jurisdictions you operate in, your business can be liable for failing to protect against (or not disclosing) data breaches.

Damage to your reputation

The damage that a data breach or loss of intellectual property can have on your reputation is significant. Simply put, customers tend to distrust organizations that have been known to lose privileged information. Even non‑tech‑savvy customers are likely to hear or read about data breaches, and that can impact the way they see your business (especially if their data is involved).

On top of hurting your reputation among customers, poor security practices can also affect how other businesses and investors see you. Any hit to your business’ reputation tends to have an impact on stock prices and future investment opportunities.

Fixing security issues can be costly, but repairing a business’ reputation is often the biggest expense. Once customers get the impression that your organization doesn’t follow proper security practices, it can be hard to repair that damage.

Business disruption and financial loss

Any type of security breach at your organization can have a significant financial impact, both directly and indirectly. Indirect financial losses come from customers who decide to move their business elsewhere, and the reputational hit your organization suffers as a result.

Depending on the type of data breach, you might also be on the hook for fines from regulators. There are various regulations, like the CCPA and GDPR, that govern how organizations should handle and protect customer data. Failing to comply with these regulations by not implementing proper data security can translate to significant fines.

To put this into perspective, Instagram was issued a €405 million fine in 2022 for improper handling of children’s privacy online. In the same year, Facebook was fined €265 million for a data breach that resulted in private customer information being disseminated online in hacking forums.

On top of these costs, you also need to consider that businesses tend to experience severe disruptions to everyday operations during and after security breaches. Depending on the severity of the issue, it can take days or weeks until your organization can resume business as usual.

Regulatory non-compliance

Failing to protect your website and any user data it contains may lead to regulatory compliance issues. This depends on which jurisdiction you operate in. To give an example, if you operate in or have customers who access your website from the European Union, you’re subject to the GDPR.

The GDPR is among the most well‑known security and data protection regulations worldwide. This regulation can impose fines of up to 2% of an organization’s annual revenue.

Depending on the size of your organization, it might be smart to hire attorneys with experience in data protection regulations. They’ll be equipped to help you understand what regulations can affect your business and how you can adapt to their requirements to avoid non‑compliance issues.

Intellectual property theft

It’s not uncommon for organizations to store secure or proprietary information on their websites or servers. Typically, only members of your organization have access to these files. But if your site experiences a security breach, attackers can gain access to this intellectual property.

The value of this property can vary, but the effects of its loss can be devastating. Attackers can choose to make intellectual property public, which can paint your organization in a bad light. One example of such a situation was the infamous Sony emails leak of 2015, which revealed thousands of private documents and internal plans for the company.

Attackers might also sell your company’s intellectual property to competitors. This can give those competitors an edge over your business, which is precisely why organizations protect private property so zealously.

Legal liability

Aside from data protection regulations, failing to secure customer information can also make your organization a target for lawsuits. 

Customers can, in some situations, sue companies directly for mishandling of their private data or negligence in their handling of it. If customers can prove damages from a security breach involving their data, your organization may be liable.

Malware infections

On top of data breaches, poor enterprise security practices can also lead to malware infections. Depending on the type of infection, this can have far‑ranging effects on your organization and your customers.

Some types of malware will infect website visitors directly. Others might try to intercept their personal data or re‑route them to third‑party websites that look like yours. In some cases, search engines might even “quarantine” your website and warn visitors away from it. This can erase your organization’s organic traffic almost overnight.

WordPress security basics

Now that you have a better sense of the risks at play, it’s time to talk about how to prevent the issues we’ve been discussing. There’s no one thing you can do to make sure your website is 100% safe. Instead, you’ll want to implement a range of security tips, tasks, and tools, so it’s protected from all angles.

First, we’ll cover the security “basics” in no particular order. These tasks are relatively simple to implement, but can have a significant impact on WordPress security, so they should form the foundation of your enterprise‑level protection plan.

1. Keep WordPress core, themes, and plugins up to date

The most basic WordPress security task is to keep the content management system (CMS) up to date, as well as all the plugins and themes you have installed.

This means regularly monitoring the Updates page in your WordPress site dashboard, and looking for available updates for your website. Some plugins will also show you notifications if you’re running an outdated version of their software.

notice that the version of Jetpack currently in use is outdated

Updating your WordPress site should only take a few minutes. When implementing updates, like new versions of WordPress or plugins, it’s best to do so on a staging site first. This enables you to test the new software and make sure it doesn’t introduce any errors to the WordPress site or the user experience.

2. Opt for a secure hosting provider designed for large websites

Not every web host can provide the same level of service. Moreover, the resources and security features you have access to will vary depending on which type of hosting plan you select.

An enterprise‑level website deserves hosting designed for projects that require top‑of‑the‑line hardware, and that can handle massive amounts of traffic. There are a few web hosts that provide enterprise‑level WordPress hosting, like WordPress VIP.

WordPress VIP homepage

If you’re currently using a web host that doesn’t provide many WordPress security features, it’s time to consider moving to another provider. Migrating a website can be a time‑consuming process, but once you find a secure web host that offers excellent performance, you’ll never want to go back.

When looking for a provider, consider those that offer managed WordPress hosting options. You’ll also want to talk directly with their sales team to discuss your needs, and find out how they can help make the migration process as seamless as possible.

3. Implement role‑based access control

Role‑based access controls means that every member of your team has a specific set of permissions based on the role they fulfill on the website.

The administrator for your WordPress website should be the only member of the team with full permissions. That means they’re the only individual capable of making changes to key aspects of the site’s functionality or its source code.

dropdown of available WordPress roles

WordPress comes with a role‑based permissions system out of the box. Your organization can leverage this system and make sure that every member is assigned a role that gives them the minimum level of access they require.

This system of minimum permissions will limit the number of people who have access to your site’s critical systems. This approach protects your WordPress website against human error, and makes sure that if credentials are compromised, attackers won’t have enough access to wreak havoc.

4. Enforce strong usernames and passwords

For an enterprise‑level organization, it’s not enough to only suggest that employees use strong usernames and passwords. Educating employees about strong credentials is a great first step. Still, it’s a fact that most people reuse passwords or don’t think much about credentials at all.

One way to circumvent this issue is to generate new user accounts for members of your organization manually. WordPress suggests strong passwords when creating new user accounts, and it warns you if you try to use a weak option.

"weak password" notice in WordPress

If you enable visitors to sign up on your website, you’ll need to find ways to incentivize them to use strong passwords as well. You can also offer or enforce additional login security methods, like two‑factor authentication (2FA).

It’s important to note that password security doesn’t just extend to your website. Your organization also needs to follow smart security practices for its hosting account, FTP, and SSH access. 

Any set of credentials that provides access to any part of your website needs to be strong. If an attacker gets control of your hosting credentials, they can access your site and its data.

5. Use 2FA

2FA offers an additional layer of security for login pages. If you enable 2FA, your site’s WordPress login page will ask users and visitors to enter a one‑time code that can be delivered via an app, SMS, email, or another method.

By implementing 2FA, you protect your website even if attackers gain access to credentials with critical permissions. Unless they also have direct access to the email account or device where the 2FA code is sent, they won’t be able to get inside.

On top of protecting your organization against attacks from leaked credentials, 2FA can also stop bots from trying to brute force their way into your website. Moreover, if you use WordPress websites, 2FA is remarkably simple to implement thanks to plugins like Jetpack Security.

6. Limit login attempts

There are few scenarios when a legitimate user would attempt to log in time after time in quick succession. If you forget your credentials, you might try to guess them a handful of times before resetting them (which WordPress enables you to do). On the other hand, attackers or bots often attempt to brute force their way through the WordPress login page, typically using popular usernames and passwords.

There are several ways to mitigate the risk of this type of brute force attack. Using 2FA is a fantastic start. Limiting login attempts is the logical second step. This way, you can make it nearly impossible for attackers to get into accounts that don’t have 2FA enabled. 

Time limitations on login attempts to keep WordPress secure

Typically, websites limit login attempts for a specific period of time. If a user fails to log in after multiple attempts, they won’t be able to get into the site until a timer resets. If this happens to an employee, though, an administrator should be able to grant them access immediately. Fortunately, this is easy to set up using a plugin.

7. Use SFTP for file transfers

SFTP is to FTP as HTTPS is to HTTP. With SFTP, the information your employees send and receive from your website’s server is encrypted. This means it can’t be read even if the connection is intercepted.

Whether you get access to FTP or SFTP typically depends on which web hosting provider you use. Enterprise‑level hosts will default to SFTP to help businesses protect their information and prevent data breaches. If your web host doesn’t support SFTP, your business might benefit from a migration to a different provider.

In practice, SFTP works just the same as FTP. Most popular FTP clients support both protocols. This means your team will be able to use the software they’re most familiar with and avoid having to transition to a new SFTP client.

8. Use SSL to encrypt information

It’s essential to set up a Secure Sockets Layer (SSL) certificate for any website your organization runs. You can obtain a certificate for free, and most web hosts will even set them up for you automatically.

SSL certificates enable your website to encrypt the data that it sends and receives through the HTTPS protocol. This ensures a safer connection to your website, and it’s encouraged by search engines and regulatory agencies.

The different kinds of SSL certificates to help secure your WordPress site

It’s important to understand there are different levels of SSL certificates. Enterprise‑level organizations have more stringent website security requirements, so you’ll need a higher level of SSL certificate.

An “Organization Validation” SSL certificate involves manual vetting by the certificate authority. This type of certificate provides a higher level of security, and is required by certain regulators and industry standards.

9. Install a robust WordPress security plugin

Security plugins are tools that protect your WordPress website by adding defensive measures, which vary based on the WordPress security plugin you use. There are dozens of options, ranging from those geared toward hobbyist websites to those designed for enterprises.

Generally speaking, a comprehensive WordPress security plugin will include features like automatic malware scans, a web application firewall (WAF), built‑in backup functionality, and more. The goal of these plugins is to provide a one‑stop solution, so you don’t have to implement each of those features separately.

Jetpack Security homepage

Jetpack Security is an example of this type of solution. It includes all the WordPress security features mentioned above, as well as activity logs, spam protection, and one‑click malware removal. The service also integrates with WPScan to power its automatic malware detection tool.

10. Make off‑site backups

A comprehensive backup strategy involves creating regular copies of your WordPress website and its database. This way, you can restore your WordPress site in case of a security breach to avoid prolonged downtime.

One aspect of a strong backup strategy that a lot of organizations ignore is redundancy. Storing backups in multiple, off‑site locations protects them in case your web servers are compromised or go down in any capacity.

Organizations that take security seriously should store multiple copies of each backup in different locations. This ensures a level of redundancy that means you’ll always have access to at least one recent backup, even during catastrophic website security breaches.

11. Remove unused files, themes, and plugins

Plugins and themes are at the core of what makes WordPress such a unique CMS, one that’s versatile enough to power even enterprise‑level projects. One downside of this high level of customizability is that it’s common for websites to end up with a lot of plugin and theme “bloat”.

That means having collections of add‑ons that don’t fulfill a specific purpose or that you only use very periodically. This is a problem because every active plugin or theme represents a potential security vulnerability.

At any time, your website should only have the plugins installed that it actively uses. This is a straightforward practice that ensures your site isn’t vulnerable due to plugins and themes that someone on your team installed years ago and then forgot about (which is all too common).

Someone should periodically sweep your website and review what plugins, themes, and other tools you’re using. Any add‑ons like unused WordPress plugins that don’t fulfill a specific purpose need to be deactivated and uninstalled.

12. Keep your PHP version up to date

PHP is one of the key components necessary for WordPress websites to run on a server. Running old versions is not recommended because they may include security vulnerabilities and are not as well optimized as newer releases.

If you have full control over your website’s hosting environment, you can update to newer PHP versions as they become available. Enterprise‑level WordPress web hosts also update PHP periodically, to ensure that visitors get to enjoy the benefits of the latest versions.

Aside from security advantages, newer versions of PHP also boast measurable increases in performance. In some cases, merely updating PHP has been shown to drastically improve website loading times.

13. Protect against comment and contact form spam

Comment and contact form spam are common security issues for any modern website. If your site includes comment sections, bad actors may try to use them to disseminate links to malware, malicious websites, or your competitors.

example of a spam comment

This is a problem that’s easily mitigated with proper moderation. As your site grows, human moderation might not be enough, though. That’s why a lot of enterprise websites choose to implement anti‑spam protection, using a plugin like Akismet.

This type of system automatically filters the majority of spam messages by looking at visitor IPs and the contents of their comments or content form submissions. Human moderators can then deal with the rest of the messages without being slowed down by spam.

Advanced measures for enterprise‑level security

The following advanced WordPress security measures require more work to implement than the options we’ve explored so far. Yet, each of these measures can make your organization demonstrably more secure. Any business that values security will benefit from tasking the right WordPress security team to address these key steps. Again, these are in no particular order.

1. Leverage vulnerability scanning

Scanning your website for vulnerabilities can help you identify and patch threats before they can be exploited by others. Despite their usefulness, though, vulnerability scanners are only as effective as the databases they use. If a database is outdated or doesn’t have experts constantly working on finding new vulnerabilities, any scanner that uses it will fall short of the mark.

WPScan offers the largest database of WordPress site vulnerabilities on the market. It’s an open‑source project that brings in all kinds of WordPress experts to put together a comprehensive list of vulnerabilities in a single database.

Average websites can access that database by using Jetpack Protect or Jetpack Security. 

Jetpack Protect homage

Enterprise deployments can access the WPScan database using the WPScan CLI scanner or the service’s API.

2. Disable file editing

File editing for themes and plugins is disabled automatically in newer versions of WordPress. Instead of getting access to a file editor, you can use the Block Editor to customize themes visually. This is a much safer way to make changes, and prevents bad actors from getting access to sensitive files.

If you’re using an outdated version of WordPress, we recommend updating it to avoid security issues. This will also disable file editing on your site. 

Remember, all major changes should be tested on a staging environment before pushing them to your live site.

3. Disable directory listing/browsing

Depending on your web server configuration, visitors might be able to see the full contents of your site’s directories. This happens if the ‑indexes setting is enabled in your site’s .htaccess file, if your site is using an Apache server. In that case, if a user tries to visit a URL like yourwebsite.com/wp‑content/, they’ll see all the files in that directory and be able to access or execute them.

This is a critical security vulnerability for any organization, and it requires immediate patching. You’ll need to connect to your website’s root directory and look for the .htaccess file. Open the file with a text editor and add this code at the end:

Options -Indexes

Save your changes to .htaccess and close the file. This will disable directory listing and browsing for your website.

4. Hide /wp‑admin and /wp‑login

By default, the WordPress login and admin pages have predictable URLs. This makes them easy to access, even if you don’t have the necessary credentials to log in. Attackers can exploit this by trying to brute force their way into your website.

An easy way to protect your business is to change those default URLs. This way, only employees will know what the login URLs are. This change is relatively easy to implement with a plugin like WPS Hide Login. Alternatively, you can change the login URL manually by modifying the wp‑login.php file.

5. Prevent WordPress version exposure

By default, WordPress sites display the version of the CMS you’re using if you analyze your site’s source code. This is not apparent to most visitors, but attackers can find this information easily and leverage it to find vulnerabilities in that version of WordPress.

The smart way to sidestep this website security issue is by always using the latest version of WordPress. This means your organization doesn’t need to worry about security exploits in outdated versions of the software.

Popular WordPress security plugins typically include features that will prevent the CMS from disclosing its version in the code. This is the preferred approach, and it also lets you implement further security measures simultaneously.

6. Secure the WordPress REST API

The WordPress REST API enables the CMS to connect with other applications and websites. Developers can use the REST API to add engaging and useful functionality for your site. But if you don’t limit access to the API, attackers can leverage it to pull data from your website.

Access to the REST API should be limited to authenticated users, and they should use strong credentials. An enterprise‑level website needs to treat these credentials with the same level of caution as administrative ones, as they provide a great deal of access to WordPress.

Additional security measures you can take to secure the WordPress REST API include using rate limiting. With proper rate limits, attackers who gain access to the API might not be able to exploit it to its full extent. Combine that with API activity logs, and you’ll be able to stop malicious use of the API in its tracks.

7. Use a web application firewall (WAF)

A web application firewall (WAF) is software that can monitor, filter, and block incoming connections to your website. When you see a WordPress security plugin that claims to be able to block malicious traffic, they’re usually relying on a WAF to do it.

enabling a firewall in WordPress

Depending on which type of WAF you use, it may be able to stop blocklisted IPs from accessing your website, as well as prevent attacks like cross‑site scripting (XSS) and SQL injections.

WAFs can be incredibly effective if they leverage up‑to‑date databases of known malicious IPs. This is possible because web security companies monitor malicious activity around the web, and use that information to block future suspicious activity.

8. Use a security information and event management (SIEM) system

A SIEM system is software capable of aggregating relevant data from multiple sources and identifying events that deviate from regular operations. In WordPress, this would be a system capable of collecting information from sources like:

  • Security plugins
  • Activity logs
  • Malware scans
  • WAFs

In theory, the SIEM system can act as a data aggregation hub for all of this data, and correlate it to find vulnerabilities that might not be obvious at first analysis. All of this happens through a dashboard, which makes it easy to interact with the system.

Developing and implementing a SIEM system is the natural progression of the security hardening process for enterprise‑level WordPress websites. Once you have all other security measures in place, the SIEM can act as the monitoring center for all security‑related events on your website.

9. Set up a security operations center (SOC)

A security operations center (SOC) is a centralized unit that deals with security issues on an organizational level. A SOC team’s responsibilities can include managing, assessing and defending the IT infrastructure, and responding to security incidents.

This is the type of unit that typically only exists at an enterprise level. Due to the massive amounts of user data and secure information that you handle, it’s necessary to have a team wholly dedicated to security assessments, upkeep, and response.

The structure of your organization’s SOC will depend on the type of website you’re running. The team will be responsible for defining security processes, ensuring compliance with security regulations, conducting regular security audits, and developing an incident response plan in case of breaches.

10. Conduct regular security audits

A security audit is a process that involves checking every aspect of your website’s protective measures to ensure that they’re properly configured and working. At an enterprise level, this means checking your organization’s websites to make sure they’re following all the WordPress security practices we’ve outlined so far.

The goal of an audit is to help you identify problems with your security’s configuration and fix them before attackers can exploit them. Depending on your website’s scope, a security audit can be a time‑intensive process that involves multiple teams. Exhaustive audits can and should be conducted every few months to ensure that there are no issues with your security setup.

11. Monitor user access and activity

A comprehensive security strategy for a website involves leveraging logs to help uncover unauthorized and malicious activity. There are several tools that enable you to monitor and log user activity in WordPress, including the Jetpack VaultPress Backup plugin.

activity log from Jetpack

For security purposes, you’ll want to use an activity log that can track events including logins, changes to WordPress, plugin installs and configuration changes, and more. Your organization’s SOC will be in charge of monitoring the log to identify suspicious activity and the users behind it.

This information can help you identify the source of vulnerabilities, determine which roles have too many permissions, and keep an eye on your site’s overall health and security.

12. Train your staff on security best practices

The weakest point in any organization’s online security is the human error factor. Your staff is only as effective as the training that you provide them. This applies even to employees with a technical background, as poor security practices are rife at every level of competency.

If you want your business to be ahead in terms of security, you need to develop training and processes for every aspect of your WordPress security strategy. For WordPress websites, that involves training on proper credential use, how to share information, how to handle sensitive data, and more.

The more thorough you are in terms of training, the less likely you are to run into security issues. Your SOC team should develop these processes and share them so the rest of the team knows what is expected in terms of security.

13. Create a disaster recovery plan

All the planning in the world goes out of the window the minute your organization has to deal with a high‑level security incident. This can be a massive data breach, loss of intellectual property, a malware infection, or a dozen other types of incidents.

Being proactive about your site’s security is only half of the equation. If you want your business to survive the reputational hit and financial repercussions of a major security breach, you need to have a game plan ahead of time.

A disaster recovery plan outlines the steps your organization should take in different security incident scenarios. It’s important to understand that planning for this type of event can be difficult until after you experience it. Still, you can learn from what other organizations have done when faced with incidents like data breaches.

How WPScan can help achieve enterprise‑level security

Regular vulnerability scanning is a key component in any comprehensive security strategy for an online business. This involves scanning your entire website for anything that can pose a security vulnerability.

WPScan maintains the largest database of WordPress vulnerabilities. It works with developers and WordPress experts to identify emerging threats and categorize them. This database is accessible to everyone via an API or CLI scanner.

Frequently asked questions about enterprise‑level security

If you still have any questions left about WordPress security, this section will aim to answer them. Let’s start by talking about which WordPress security measures you should prioritize.

What are some common security vulnerabilities in WordPress sites?

Some of the most common security vulnerabilities for a WordPress site include weak login credentials and outdated components. If you fail to update WordPress or the themes and plugins you use, you leave your WordPress site vulnerable. This is because the older the software is, the more likely it becomes that attackers have found vulnerabilities in its source code.

How often should I update WordPress to ensure security?

Your organization should always use the latest version of WordPress, as well as any themes and plugins installed on your website. For major WordPress releases, we recommend testing them using a staging website. Major releases may sometimes cause compatibility issues, so testing them is a smart security measure.

What are some recommended security plugins for WordPress?

There are several excellent WordPress security plugins. Your choice will depend on your organization’s needs and budget. A lot of security plugins offer free versions, with the option to upgrade to a premium license for access to improved functionality.

For instance, Jetpack Protect enables you to run automatic malware scans on your website for free. The Jetpack Security suite includes Protect as well as other tools, including backup options and spam prevention.

How can I monitor my WordPress site for security threats?

Automatic malware scanning tools can help you monitor your WordPress sites for security threats. Depending on which tool you use, it will monitor for malicious code, plugins and themes with vulnerabilities, and WordPress core files.

Although you can designate workers to run scans manually, automating them is the smart choice for an enterprise business. This automation means you only have to act when the scanner detects a threat.

How can I protect my WordPress site from malware?

Protecting your WordPress website requires your organization to be proactive. That means taking security measures before you run into any vulnerabilities that can lead to data breaches and losses.

Throughout this article, we’ve focused on basic and advanced WordPress security measures. To keep your website secure, it’s important that you implement as many of them as you can. This process can take a while, but it will save your business untold time, and prevent you from having to recover your website and reputation if you encounter security issues.

WPScan: WordPress security solutions for enterprise sites

WordPress website security is essential, no matter how small or large your organization is. Vulnerabilities can lead to hacks and data breaches, which in turn translate to loss of trust from visitors and financial loss. Some businesses have a hard time recovering from breaches, so it’s important to be proactive when it comes to WordPress security.

The smart way to protect your WordPress website is by using security plugins and tools like WPScan. This plugin benefits from the largest database of WordPress website vulnerabilities in the world, and is updated daily thanks to collaboration from experts and developers. Using the WPScan database, you can check your website for vulnerabilities and patch them before they become full‑blown security issues.

The Ultimate WordPress Security Checklist

Every website is open to potential attacks, but some sites are more at risk than others. If you run an enterprise‑level project, you have a giant target painted on your back. This is because most hackers are drawn in by the volume of sensitive customer data you may have on hand.

Fortunately, there are several things you can do to keep your WordPress website safe. Plus, most of these security measures are very straightforward and only take a few minutes to implement. 

In this article, we’ll provide you with a comprehensive WordPress security checklist you can use to keep your website safe. And while this advice is geared toward enterprise‑level organizations, anyone can benefit from the ideas we’ll discuss. So let’s get to it!

The importance of having a WordPress security checklist

The idea of a WordPress security checklist might sound outdated for enterprise websites. After all, there are a lot of systems and tools you can use to automate critical tasks. But it can be easy to overlook some things, especially when you have a large site to look after. 

For example, if you have a blog with a small audience, failing to update WordPress for a while will probably not cause any problems. But if you’re running an online business that relies on a lot of WordPress plugins and third‑party integrations, this oversight can break your site and cost you thousands in lost time and troubleshooting.

The goal of a security checklist is to make sure that nothing slips through the cracks, no matter how small. In addition to keeping your site in top shape, a comprehensive WordPress security checklist can have several other benefits:

Protection from online threats

The popularity of WordPress makes it a target for hackers. A WordPress security checklist helps you take proactive measures to defend against cyber threats like brute force attacks, SQL injection, and cross-site scripting.

Safeguarded sensitive user data

If your website collects and stores sensitive information like email addresses and login credentials, implementing a WordPress security checklist reduces the risk of unauthorized access to this data.

Compliance with regulations

Several regulations mandate that you adhere to strict security measures to protect user data. A security checklist helps you stay compliant with these regulations and avoid potential legal penalties.

Preservation of your reputation

If your website is compromised, it can damage your brand’s reputation and erode customer trust. A security checklist helps you maintain credibility by minimizing the risk of security incidents.

A WordPress security expert will know exactly what needs to be done to keep your site safe. But even veteran cybersecurity employees can benefit from having a resource at hand to help make sure they’re not missing anything. 

A checklist is easy to reference. Plus, you won’t need to pay hundreds of dollars for a security tool that will advise you to do the exact same tasks in this list.

Who created this checklist, and why should I trust it?

WPScan is an open-source WordPress security scanner. You can access it with multiple plugins, via our own API, or through our CLI scanner. We maintain a database of over 39,000 WordPress vulnerabilities and regularly add new entries to our database that’s maintained by leading WordPress security experts.

Our goal is to provide a definitive resource of WordPress vulnerabilities that anyone can access to keep their websites safe. Our experience working with developers and security professionals means that we’ve encountered and defended against almost every kind of threat imaginable. 

With that in mind, this checklist provides a comprehensive overview of tasks (both one-offs and recurring) that you can execute to prevent vulnerabilities on your website and keep it safe. 

29‑point checklist for WordPress security leaders

Before we dive into the security measures on our list, you may want to have a quick glance at the security basics for all WordPress sites. Plus, you could also save a copy of the list below for easy reference:

  1. Keep WordPress core, themes, and plugins up to date
  2. Apply strict username and password policies
  3. Implement role‑based access and permissions control
  4. Enable 2FA for all user accounts
  5. Limit login attempts
  6. Enable user logging and monitoring
  7. Install a reputable security plugin
  8. Set up a Web Application Firewall (WAF)
  9. Install an SSL certificate
  10. Use a Content Delivery Network (CDN)
  11. Use SFTP instead of FTP
  12. Monitor and update your PHP version
  13. Regularly back up your site
  14. Keep backups on a separate server
  15. Leverage WPScan’s vulnerability database
  16. Regularly assess third‑party plugins and themes
  17. Change the default WordPress database prefix
  18. Use custom /wp‑admin and /wp‑login.php URLs
  19. Restrict wp‑admin access by IP address
  20. Use Multi‑Factor Authentication (MFA) for critical users
  21. Secure your /wp-config.php file
  22. Disable file editing
  23. Disable directory browsing/listing
  24. Disable PHP error reporting
  25. Disable WordPress version disclosure
  26. Implement a Content Security Policy (CSP)
  27. Enable security headers
  28. Implement a code review & QA process (for developers)
  29. Conduct regular employee training

In the following sections, we’ll break down each item in our security checklist. 

Part 1: The basics

In terms of WordPress security, “the basics” are the core tasks you need to undertake to keep your website safe. Implementing these essential strategies will help protect your website against most forms of attacks.

1. Keep WordPress core, themes, and plugins up to date

Updating WordPress ensures that you’re running the latest version, which includes security patches and bug fixes. This is critical because hackers often target outdated versions with known vulnerabilities. 

To update WordPress, go to Dashboard → Updates in the admin dashboard. This page will list all available updates for WordPress Core, as well as any plugins and themes you use.

updates available in the WordPress dashboard

For increased security, we recommend using a staging website to test all WordPress updates. Sometimes these updates can cause compatibility issues, so it’s safer to run them in a private environment before making your changes live. 

2. Apply strict username & password policies

Your organization might be using the most advanced WordPress security tools on the market. But your site is only as strong as its weakest link — and that tends to be passwords.

WordPress highly suggests that users create strong passwords and provides some nudges to encourage this. For additional safety, your organization could use a secure WordPress plugin to force users to renew passwords on a regular basis.

notification of a weak password in WordPress

If attackers gain access to a WordPress admin account, they can wreak a lot of havoc. To secure your website even further, you could ask employees to avoid usernames that are easy to guess (like combinations of their first and last names).

3. Implement role‑based access and permissions control

By default, WordPress uses a basic role system that enables you to segment users based on the things they’re allowed to do on your site. Administrators are the only users with full access to all dashboard functionality.

dropdown of user roles in WordPress

By limiting the access and capabilities of users, you can reduce the risk of unauthorized changes to your website and minimize the potential damage from compromised accounts. In other words, no user should have a role that gives them access to more permissions than they need.

Regularly auditing users and permissions will help keep your website safe. If you need to edit a user role in WordPress, you can do so from the Users tab.

4. Enable two‑factor authentication (2FA) for all user accounts

Two‑factor authentication (2FA) is already the norm for a significant part of the web. Adding a second layer of verification to your WordPress login page makes it harder for attackers to gain access to your website, even if they manage to get their hands on working credentials.

If you haven’t implemented 2FA in WordPress, you can do so with Jetpack’s Secure Authentication functionality. This feature enables users to log into self-hosted WordPress sites with their WordPress.com accounts, and you can configure it to require 2FA.

Jetpack secure authentication settings

A lot of public‑facing websites make 2FA optional to avoid inconveniencing users. For enterprise‑level websites, we recommend enforcing the use of 2FA to help minimize WordPress security issues.

5. Limit login attempts

Brute force login attacks are incredibly common. Hackers and bots scan sites for weak credentials. They also look for sites where they won’t get blocked after multiple login attempts.

By limiting the number of times users can attempt to log in within a specific period, you can minimize the risk of successful brute force attacks. A regular user might forget their password once in a while, but they won’t make dozens or hundreds of login attempts per minute, which is precisely what bots do.

The easiest way to limit login attempts in WordPress is to use a plugin like Jetpack. The brute force attack protection feature is free for all Jetpack users and can automatically block malicious IPs before they even make it to your site. 

6. Enable user logging and monitoring

A key part of a secure network or website security is being able to spot any irregularities. User and security logs give security professionals access to all important events that occur on the website.

You can use website security logs to review information like login attempts, changes to core files, page updates, and more. If something looks a little suspicious, you can see when it happened and which user was involved.

list of activitoes that occur on a site

A comprehensive security policy will involve someone on your team periodically reviewing logs for any irregular events. Moreover, most WordPress website activity logs will enable you to configure notifications for specific events, so you don’t need to check the logs entry by entry every day.

7. Install a reputable security plugin

There are many WordPress security plugins that you can use. Most of them combine a lot of features to help protect your website, like 2FA, firewalls, and more.

Installing a reputable security plugin can help protect your website. What tool you use will largely depend on the security features you want to implement and your budget. 

Jetpack Security homepage

Jetpack Security, for example, offers full‑site backups, brute force attack protection, an activity log, secure authentication, and spam protection, among other features.

8. Set up a Web Application Firewall (WAF)

A Web Application Firewall (WAF) is designed to scan all incoming traffic and block malicious requests like SQL injections or cross-site scripting attacks. Using a WAF helps protect your WordPress site from common threats and reduces the likelihood of successful attacks.

There are multiple ways to set up a firewall for WordPress. Some hosting services offer this feature at the server level. Another option is to use a security plugin that offers a WAF, like Jetpack Protect.

9. Install an SSL certificate

An SSL certificate enables your website to load over HTTPS. The HTTPS protocol encrypts data transmitted between your server and the visitors’ browsers.

This encryption helps protect sensitive information like login credentials and personal data from being intercepted by hackers. SSL certificates also improve your website’s credibility and can positively impact search engine rankings.

Obtaining an SSL certificate is remarkably easy. A lot of WordPress web hosts will automatically set them up for you when you create a website. Alternatively, you can look into enterprise SSL certificates for added security.

10. Use a Content Delivery Network (CDN)

A Content Delivery Network (CDN) is a network of servers that cache and distribute your website’s content to reduce loading time and server load. Some of the most popular CDNs for WordPress include Cloudflare and Jetpack Boost.

Image CDN toggle in Jetpack Boost

Additionally, CDNs can enhance your site’s security by offering features like DDoS protection, traffic filtering, and secure data transmission. This helps protect your website from various threats while improving its overall performance.

This isn’t an essential step for WordPress security, but is a nice extra step once you’ve covered the security basics.

11. Use SFTP instead of FTP

Secure File Transfer Protocol (SFTP) is an encrypted version of the File Transfer Protocol (FTP). Using SFTP when transferring files to and from your server adds an extra layer of security by encrypting the data in transit, preventing unauthorized access or data interception.

SFTP/SSH hosting details

Most modern web hosts will provide you with SFTP credentials when you set up a website. You can use these credentials with any SFTP/FTP client of your choosing. In practice, both protocols work the same, but one of them is more secure (similar to HTTP/HTTPS).

12. Monitor and update your PHP version

PHP is one of the programming languages that WordPress is built on. To run WordPress on a server, you need to install PHP, ideally, the most recent version.

You can check which version of PHP your site uses by navigating to Tools → Health → Info → Server in the dashboard.

server details, including PHP version, in WordPress

Outdated PHP can make your website vulnerable (as with any other software). Therefore, keeping it up-to-date can help maintain your website’s security and ensure compatibility with the latest WordPress features. 

Most modern web hosts will enable you to switch between PHP versions or update them for you automatically.

13. Regularly back up your site (and database)

Performing regular backups will make it easy to recover your website in the event of an attack. Plus, you’ll reduce the risk of losing critical information.

VaultPress Backup details

Having a recent backup on hand enables you to restore your website without delay, minimizing downtime. Note that a full WordPress backup involves both the site files and the database.

Ideally, this process should be automated with a reliable plugin like Jetpack VaultPress Backup (which also creates backups in real-time and stores them on separate servers). This way, you don’t need to back up the site manually every day.

Enterprise WordPress sites should also look for backup solutions that save changes in real time. Incremental, real‑time backups, like those created by VaultPress Backup, are efficient for storage, but save every single change or update as soon as it takes place. In other words, you’ll never lose an update, order, or forum submission.

14. Keep backups on a separate server

Regular backups are an essential step in keeping your website and its data secure. But storing backups in a single location can lead to a security failure if the platform or server malfunctions. Many secure hosting services include some form of site backups as part of their plans, but that doesn’t mean you’re completely covered. You need more than what your hosting provider alone can offer.

Enterprise WordPress sites, especially, should save backups on a separate server to ensure that even if your main server is compromised, your backups remain secure and accessible. This helps you restore your website to a safe state and reduces the risk of data loss in the event of a security breach.

15. Disable unused plugins

Poorly-coded plugins add security vulnerabilities to your website that attackers can exploit. Even the best plugins and themes can become vulnerable to attack — malicious actors may eventually find loopholes in the software. 

Regular updates can minimize that risk. But if there are any plugins on your site that you don’t use anymore, you should remove them right away.

This won’t affect your site’s functionality in any way, but it will help eliminate their potential as attack vectors. To keep your site safe, we recommend doing this periodically.

Part 2: Advanced items

Now that we’ve covered the basics of WordPress security, let’s move on to more advanced tasks. These security measures will help to further protect your website.

16. Leverage WPScan’s vulnerability database

WPScan maintains a comprehensive database of known WordPress vulnerabilities. Using a tool that leverages this database will enable you to monitor your WordPress website for the latest vulnerabilities and security flaws as they’re discovered.

WPScan homepage with a list of vulnerabilities

Knowing your site is vulnerable is half the equation when it comes to security. Once your team is aware of existing vulnerabilities, they can look into ways to patch or eliminate them.

Leverage WPScan today.

17. Regularly assess third‑party themes and plugins

Third-party plugins and themes can introduce vulnerabilities to your WordPress site. To keep your website safe, we recommend conducting regular assessments of all third-party tools you’ve installed. 

For WordPress themes and plugins, this involves checking for updates and looking at recent reviews and/or developer notes for security issues. In most cases, you shouldn’t run into problems with plugins or themes if you obtain them from reputable sources like the WordPress.org repository.

18. Change the default WordPress database prefix

By default, WordPress uses ‘wp_’ as a database prefix. This makes it easy to identify the database, both for developers and attackers.

Changing the prefix is simple, and it defends against a potential attack. While there are plugins that enable you to do this, we recommend changing the database prefix manually by editing the WordPress wp-config.php file in the root directory.

Before making any changes to core files, remember to back up the website and database fully. After changing the database prefix in wp-config.php, you’ll also need to rename all existing tables within the database.

19. Use custom /wp-admin and /wp-login.php URLs

The same default WordPress login URL and admin URL is used for every installation. These are:

  • yourwebsite.com/wp-login.php
  • yourwebsite.com/wp-admin.php

This base structure makes it easy to remember the URLs, but it also means they’re easy to find by attackers. Changing the default URLs for both pages will help prevent brute force attacks on your WordPress website.

If you are running an Apache server, you can change the default /wp-admin and /wp-login.php URLs manually by editing the .htaccess file in the WordPress root directory. 

WPS Hide Login page in the repository

Alternatively, you could use a plugin like WPS Hide Login.

20. Restrict wp-admin access by IP address

Changing the default wp-admin URL is a great step in terms of security. But if you want to protect your website even further, we recommend creating an allowlist of IP addresses that can access the dashboard.

The logic of this approach is that no one without an account should be accessing the dashboard anyway. Every employee should have a unique IP address (or get one with a VPN). 

If you’re running an Apache server, you can add these addresses to an allowlist in the .htaccess file. This will look like the following:

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]

RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$

RewriteCond %{REMOTE_ADDR} !^IP_ADDRESS$

RewriteCond %{REMOTE_ADDR} !^IP_ADDRESS$

RewriteRule ^(.*)$ - [R=403,L]

</IfModule>

If the address of the user isn’t in the allowlist, WordPress will return a 403 Access Denied error.

21. Use Multi‑Factor Authentication (MFA) for critical users

Two‑factor authentication is more than enough to keep most user accounts safe, but you may want to implement a more advanced measure on your login page. Multi‑factor authentication requires users to submit one‑time codes sent via at least two methods like email, SMS, and/or authentication apps.

multi-factor authentication setup

MFA is a critical security measure for accounts with high‑level privileges like administrators. Adding more authentication factors diminishes the chances of attackers gaining access to these accounts, even if they manage to hijack the email.

Most WordPress security plugins don’t support MFA. If you want to enforce this security policy, we recommend using MiniOrange Two Factor Authentication. The premium version of this plugin enables you to configure multiple authentication factors for specific user roles.

22. Secure your wp-config.php file

The wp-config.php file contains sensitive information about your WordPress installation, including database connection details. Ideally, no one except the administrator should have access to it.

To do this, you’ll want to limit SFTP access to the administrator and other employees that absolutely require it for development purposes. Additionally, you’ll want to configure WordPress to prevent accessing wp-config.php if an attacker finds a way to execute the file.

The simplest fix here is to edit .htaccess to block access to wp-config.php from all IP addresses. Here’s the code you’ll need to use:

<files wp-config.php>

order allow,deny

deny from all

</files>

Note that this code doesn’t prevent you from accessing the file via FTP or through the control panel from your hosting provider. It only blocks access from browsers, which is a method that attackers would use in most cases.

23. Disable file editing

WordPress allows anyone with an admin account to edit theme and plugin files directly from the dashboard. This feature can be helpful if you need to make quick changes to the site’s code. But in most cases, you’re much better off using SFTP and a regular code editor to make any changes.

Disabling file editing from the dashboard prevents attackers from messing with your site’s code if they manage to get in. You can disable both the theme and plugin editors in the admin area by editing the wp-config.php file and adding this line of code:

define('DISALLOW_FILE_EDIT',true);

Once you add the code, save the changes to the file and close it. Now, the administrator role won’t be able to access either editor from the dashboard.

24. Disable directory browsing/listing

If directory browsing is enabled on your website, anyone will be able to view the contents of folders that don’t have an index file. This can expose sensitive files and information to potential attackers.

Most secure WordPress hosting providers disable directory browsing by default. You can check if yours does this by trying to access a directory through the browser, using the following URL:

yourwebsite.com/wp-includes/

If directory browsing is disabled, you’ll see a 403 error. Otherwise, a full list of the directory files and folders will appear, enabling you to navigate it from the browser.

To disable directory browsing, open the .htaccess file and add the following line of code at the end:

Options -Indexes

Save the changes to .htaccess and try to open any directory on your website using a browser. The browser should now return an Access Forbidden error.

25. Disable PHP error reporting

Sometimes, when you load a website that uses PHP, you’ll see error messages related to the language in the browser. These messages can be useful for troubleshooting, but they can also reveal sensitive information about your site.

In WordPress, you might see these error messages appear on-screen if you enable error reporting or the debug mode. You can disable these error messages by accessing the wp-config.php file in the WordPress root directory and adding the following code to it:

ini_set('display_errors','Off');

ini_set('error_reporting', E_ALL );

define('WP_DEBUG', false);

define('WP_DEBUG_DISPLAY', false);

This will disable PHP error reporting, as well as the WordPress debug mode. While you’re at it, make sure there isn’t a duplicate line defining the status of WP_DEBUG, which can cause further errors on your website.

26. Disable WordPress version disclosure

Some WordPress themes disclose the version of the content management system (CMS) that you use to the public. This is problematic, as some versions of the CMS include well‑known security vulnerabilities.

This isn’t necessarily a big deal if you update often, but there’s no reason why visitors should know what WordPress version you’re using. 

To disable this feature, connect to your website via SFTP and navigate to your active theme’s folder (wp-content/themes/). 

Once inside, locate the functions.php file and open it. Add the following line of code at the end of the file:

remove_action('wp_head', 'wp_generator');

Save the changes to functions.php and close the file. Keep in mind that if you change themes or update your theme without using a child theme, you’ll need to repeat this step to avoid WordPress version disclosure.

27. Enable security headers

Security headers are server responses that add an extra layer of protection for your website. They can help prevent attacks like clickjacking and code injection by controlling the way the site loads and displays in the browser.

There are several types of security headers you can use on your website. These include:

  • Content-Security-Policy (CSP). A CSP sets rules for where resources (like scripts, stylesheets, and images) can be loaded from, helping to prevent attacks like Cross-Site Scripting (XSS).
  • X-Frame-Options. This header can prevent your site from being used in clickjacking attacks by controlling whether your site can be loaded in a frame or iframe.
  • Strict-Transport-Security (HSTS). The HSTS header forces the browser to only use secure (HTTPS) connections, which helps prevent man-in-the-middle attacks.
  • X-Content-Type-Option. This header prevents “mime” based attacks by disabling the browser’s MIME-sniffing.

Here’s an example of what a security header might look like in a site’s HTML code. As the name implies, the headers go in the head section of the code:

<head>

    <title>Your Website Title</title>

    <meta http-equiv="Content-Security-Policy" content="default-src 'self';">

    <!-- Other meta tags, stylesheets, scripts etc. -->

</head>

Implementing security headers in WordPress requires you to edit the .htaccess file. Some security plugins automatically insert specific types of headers into your site, so you might want to check your head tags before adding more.

28. Implement a code review & QA process (for developers)

As with code reviews, a comprehensive quality assurance process is essential to any development project.

With an enterprise‑grade WordPress website, any change you make to the code should have to go through multiple steps of reviews and approval before it goes live. Plus, the code should go through a staging site before being launched into production.

If there isn’t a set code review and QA process in your organization, it needs to be implemented right away. This process can slow down updates, but it makes sure that, when they do happen, your website doesn’t break.

29. Conduct regular employee training

Human error is one of the most common causes of security breaches. Regularly training employees on security best practices, how to recognize threats, and how to respond to potential incidents can significantly reduce the risk of a security breach.

For a secure WordPress site, you should train your workforce on the fundamentals of the CMS and why security measures like updates, 2FA, and code reviews are essential. If employees understand the logic behind each security measure, they’re more likely to adhere to it.

Frequently asked questions

Even after going through a comprehensive WordPress security checklist, you may still have some questions about keeping your site safe. Let’s answer some of them.

What is WPScan, and who can benefit from using its vulnerability database?

WPScan is an open‑source WordPress vulnerability database and scanning tool. Anyone with a WordPress website can benefit from using it, as it can help reveal vulnerabilities on your website.

There are several ways to scan your website using the WPScan database. The easiest way is to use Jetpack Protect, which can help you set up daily scanning for your site and recommend solutions based on the results you get.

Represent an enterprise-level organization? Get a quote here.

How often should I revisit the WordPress security checklist?

We designed this checklist as a source that you can reference at any time. If you have internal security processes for WordPress, we recommend comparing them against the checklist to make sure that you’re not overlooking any key items.

Some items within the checklist are one‑off tasks, whereas others require you to perform them periodically. Every task in the checklist provides instructions on how to carry it out, so we encourage you to bookmark and revisit it often.

How does WPScan collect its WordPress vulnerability data?

WPScan works with WordPress security experts to collect data from sources that include official WordPress releases, public security advisories, community submissions, and independent research. All of that data comes together in the most comprehensive WordPress vulnerability database available online.

WordPress vulnerability statistics

Are there any automated tools or services that can help with WordPress security?

If you want to automate part of your WordPress security checklist, you could use a plugin like Jetpack Security. With this tool, you can automate key tasks like malware scanning, full-site backups, and a web application firewall.

Protect your business website

Every website is open to vulnerabilities, including enterprise sites. WordPress is an incredibly powerful and flexible platform, but its popularity also makes it a target for attackers.

If you want to protect your business, you’ll need to make security a cornerstone of your operation. That means having comprehensive WordPress security processes in place. For instance, you’ll want to keep a close eye on your WordPress plugins and themes, enforce strong passwords, and create regular backups.

It’s also important to arm yourself with the right tools. WPScan will help you stay on top of WordPress vulnerabilities, so you can keep your site safe. 

Uncovering a PHAR Deserialization Vulnerability in WP Meta SEO and Escalating to RCE

During an internal audit, the WPScan team found a vulnerability in the WP Meta SEO plugin. This vulnerability allows attackers with at least Author privileges to upload and deserialize a PHAR file, leading to arbitrary PHP object deserialization. We were able to escalate this vulnerability to remote code execution, without the need for additional code on the server.

In this post, we’ll provide an overview of the vulnerability and explain how it can be exploited. We’ll also share our advanced proof‑of‑concept that escalates to RCE.

We reported this issue to the plugin authors, and a fix was released in version 4.5.5. We strongly recommend that site owners update to the latest version to protect their sites. Additionally, using a robust security solution like Jetpack Security can help to protect against such vulnerabilities in the future.

Plugin NameWP Meta SEO
Plugin URLhttps://wordpress.org/plugins/wp-meta-seo
Authorhttps://www.joomunited.com
Fixed Version4.5.5
CVE-IDCVE-2023-1381
WPScan IDf140a928-d297-4bd1-8552-bfebcedba536
CVSSv3.17.2

Vulnerability Details

WP Meta SEO offers an “SEO Page Optimization” feature that can analyze post content and images.

When the “Reload Analysis” button is clicked, the post contents within the editor are sent to the server for analysis. As a part of this analysis, any referenced image files are inspected and processed.

Here are the relevant snippets from the inc/class.metaseo‑admin.php file:

public function reloadAnalysis()
{
    ...

    $content = apply_filters(
        'wpms_the_content',
        '<div>' . html_entity_decode(stripcslashes($_POST['datas']['content']), ENT_COMPAT, 'UTF-8') . '</div>',
        $_POST['datas']['post_id']
    );

    ...

    // image resize
    if ($content === '') {
        ...
    } else {
        // Extracting the specified elements from the web page
        $img_tags = wpmsExtractTags($content, 'img', true, true);
        $img_wrong = false;
        $img_wrong_alt = false;
        foreach ($img_tags as $order => $tag) {
            if (!isset($tag['attributes']['src'])) {
                continue;
            }

            $src = $tag['attributes']['src'];
            $imgpath = str_replace(site_url(), ABSPATH, $src);
            if (!file_exists($imgpath)) {
                continue;
            }
            ...
        }
        ...
    }
    ...
}

The $content variable is populated with POST data from the browser. This is used to find image URL’s, which are then converted to file paths and passed to the file_exists function.

This can be exploited because of a quirk in PHP: if the path given to file_exists uses the phar:// stream wrapper and points to a .phar file or its contents, the PHP metadata object within this file will be automatically deserialized.

Caveat

This type of vulnerability was addressed in PHP 8.0 by disabling the automatic deserialization of PHAR metadata. As a result, WordPress instances running on PHP 8.0 and above are not susceptible to this vulnerability.

Proof Of Concept

The public disclosure includes a step‑by‑step proof‑of‑concept demonstrating how to exploit the vulnerability. In summary, an attacker can upload a malicious PHAR file to the server disguised as a JPG and then trigger a file_exists call using a crafted string, such as phar://path/to/malicious.phar/example.png, in an image src attribute. This will cause the server to deserialize the PHAR file and potentially trigger a gadget, such as the __wakeup method of the Evil class in the provided POC.

Escalating to RCE

During the investigation, we noticed the inc/lib/google‑api/vendor directory contained libraries with known deserialization gadgets, including guzzlehttp and monolog. However, at the time when the vulnerable code was executed, these libraries were not being loaded.

Upon further inspection, however, were able to identify a way to modify the request to force the libraries with the gadgets to be autoloaded before the vulnerable code was executed.

Consider the following code snippets. First, in wp‑meta‑seo.php we see the following:

if (is_admin()) {

    ...


    if (isset($_GET['task']) && $_GET['task'] === 'wpms_ga') {
        if (!empty($_GET['code'])) {
            $google_analytics =  get_option('wpms_google_alanytics');

            if (is_array($google_analytics)) {
                $google_analytics['code'] = $_GET['code'];

                require_once WPMETASEO_PLUGIN_DIR . 'inc/google_analytics/wpmstools.php';
                $ggClient = WpmsGaTools::initClient($google_analytics['wpmsga_dash_clientid'], $google_analytics['wpmsga_dash_clientsecret']);

                ...
            }
            ...
        }
        ...
    }
    ...
}

Second, the implementation of WpmsGaTools::initClient within inc/google_analytics/wpmstools.php is as follows:

public static function initClient($clientId, $clientSecret)
{
    require_once WPMETASEO_PLUGIN_DIR . 'inc/google_analytics/wpmsgapi.php';
    require_once WPMETASEO_PLUGIN_DIR . 'inc/lib/google-api/vendor/autoload.php';

    ...
}

When triggered, this will load the autoloader from the google‑api library, which will in turn autoload the gadget code.

Since this code is loaded at the beginning of every request to WP Admin, we were able to craft a request that passed all of the conditions and use a gadget to acheive remote code execution.

Following is the step‑by‑step POC. Note that this POC requires a vulnerable configuration, as outlined below.

  1. Use a WordPress instance on PHP 7.x.
  2. Create a PHAR file with an RCE gadget chain for the monolog PHP library. This can be done using the phpggc tool. Run the following command with an arbitrary JPG file (you may need to set Phar.readonly = Off in your php.ini file): phpggc --phar‑jpeg path/to/image.jpg -o poc.jpg Monolog/RCE1 system id
  3. Upload poc.jpg using the Media Editor. Take note of its path within wp‑content/uploads
  4. To ensure the site is in the vulnerable configuration, as an admin user, visit /wp‑admin/admin.php?page=metaseo_google_analytics&view=wpms_gg_service_data, enter arbitrary information in the Client ID and Client Secret fields, and click “Save and Connect”. This will fail to connect if the ID and Secret are invalid, but either way it will add the needed data to the database.
  5. Create or edit a post or page in the block editor. Add an HTML block with the following contents (but replace any parts of the path to poc.jpg as needed for your test server): <img src="phar://../wp‑content/uploads/2023/03/poc.jpg/test.txt">
  6. Without saving the post or page, open the browser console to view network traffic, then click on “Reload Analysis” in the “SEO Page Optimization” section. Intercept the request (e.g. using BurpSuite), and add the following URL parameters: task=wpms_ga&code=UA‑1234
  7. Note that the response body of the request will contain the output of the id command after the end of the JSON output.

Conclusion

The discovered vulnerability in WP Meta SEO allows attackers with at least Author privileges to upload and deserialize an arbitrary PHAR file. On PHP versions before 8.0, this can be used to achieve remove code execution due to the existence of suitable gadgets within the plugin. The vulnerability has been fixed in version 4.5.5, and we strongly recommend that all site owners update to the latest version of the plugin as soon as possible.

It’s important to note that vulnerabilities can be discovered in any plugin or software, and the WPScan team works hard to protect users by identifying and reporting such issues to the plugin authors. Remember to always keep your software up‑to‑date, and consider using a robust security solution like Jetpack Security to further improve the security of your site.

❌