Affected plugin | All In One WP Security & Firewall |
Active installs | 1+ million |
Vulnerable version | <= 5.0.7 |
Audited version | 5.0.7 |
Fully patched version | – |
Recommended remediation | Removal of the plugin |
Description
The plugin is wide open to IP spoofing, which an attacker can exploit to ban search engine crawlers, the site’s reverse proxy, or legitimate users.
Alternatively, an attacker can bring down the entire MySQL server by flooding the database with the entire IPv4 range.
Proof of concept
The plugin uses the AIOWPSecurity_Utility_IP::get_user_ip_address() method in all places that need access to the current request’s IP address.
This method is vulnerable to IP spoofing since it blindly trusts HTTP headers to contain truthful information.
This fact can be quickly verified using the following must-use plugin:
==> Spoofed one of Google-Bot’s IPs.
Attack vectors
We will demonstrate a few select attack vectors. However, there are many more since the plugin uses the spoofed IP in many security-related contexts.
1. Permanently getting a random IP banned
This attacker requires the following preconditions:
- User registration must be enabled on the site.
- Manual user registration review must be enabled in the plugin.
Now, submitting the following request will create a new user registration review.

Note that the IP address is the spoofed one that belongs to Google-Bot.
If the site administrator now blocks this obvious spam registration, the spoofed IP will be permanently banned from accessing the site.

The attacker was able to trick the site owner into banning one of Google’s crawlers from accessing his site, which will cause catastrophic damage to search engine rankings.
The 302 redirect to 127.0.0.1 confirms that the IP is indeed blocked. (Although we don’t know why the vendor chooses to redirect banned IPs to localhost)
2. Preventing certain IPs from logging in

The spoofed IP is now banned from logging into the site.
Applications:
- An attacker bans a targeted list of IPs. For example, banning your customer’s IP addresses at a competing site.
- Banning a site’s reverse proxy (small IP ranges) from requesting the wp-login endpoint to cause a DOS for all users. This requires the attacker to find out the reverse proxy’s IP.
3. DOS on the MySQL server
The plugin will store failed login attempts for 90 days. Each unique IP will trigger the insertion of a new record.
The below bash script can be used to ban random IPs from logging in and slowly fill the database table with the entire range of IPv4 addresses.
An attacker can bring down the database quickly if the target site does not have any network-level rate-limiting. However, even in the case of aggressive rate-limiting, an attacker can pull off the attack slowly and steadily since the plugin only prunes logs every 90 days.
Running the above command will insert almost 900 different records.

Furthermore, the site owner is now tricked into thinking that a distributed brute-force attack is taking place since each failed login comes from a different IP.
If the number of inserted records exceeds a certain threshold (depending on the server), the entire site will become unusable since the plugin runs the following code for every request:
This will ultimately run the following SQL query:
The “blocked_ip” column does not have an index, meaning the query will result in a full table scan.
Proposed patch
The needed patch is described in great length in this article of us.
Summary: Only ever use REMOTE_ADDR to access to current IP.
Timeline
Vendor contacted | September 10, 2022 |
First Response | September 12, 2022 |
Fully patched at | – |
Publicly disclosed | April 24, 2023 |
Leave a Reply to indigetal Cancel reply