CVE-2024-2018·PHP vulnerability
The WP Activity Log Premium plugin for WordPress is vulnerable to SQL Injection via the entry->roles parameter in all versions up to, and including, 4.6.4 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for authenticated attackers with subscriber privileges to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database. One demonstrated attack included the injection of a PHP Object.
- Severity
- high
- Software
- PHP
- Fixed in
- 4.6.4.1
- Published
- 2024-04-09
Affected versions
Until: 4.6.4.1
Fixed in: 4.6.4.1
How to fix this CVE
Upgrade the WP Activity Log Premium plugin to version 4.6.4.1 or later, which includes proper parameterized queries and input validation to prevent SQL injection attacks. If you cannot upgrade immediately, disable the plugin and review your database access logs for suspicious activity. Ensure all WordPress installations using this plugin are patched within 48 hours to prevent unauthorized data extraction.
sudo dnf update php php-mysql php-cliDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST|GET request containing URL parameters matching `entry(\[|->)roles` followed by SQL keywords: `(union|select|insert|update|delete|drop|or|and)\s+(select|1=1|benchmark|sleep)` in query strings or POST body dataWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Implement WAF rules to block HTTP requests containing suspicious SQL syntax in the entry->roles or entry[roles] parameters. Use a regex pattern: `entry(\[|->)roles.*?(union|select|insert|update|delete|drop|benchmark|sleep|cast|concat|0x[0-9a-f]+)` and set to block action. Additionally, enforce stored procedure parameterization at the application layer and implement request rate limiting on the plugin's API endpoints.How to check if you are affected
- Step 1: Check PHP version with `php --version` and verify WordPress plugin version with `grep "Version:" /path/to/wp-content/plugins/wp-activity-log/wp-activity-log.php`
- Step 2: Identify vulnerable installations by searching for WP Activity Log versions ≤4.6.4 in all WordPress directories: `find /var/www -name 'wp-activity-log.php' -exec grep -l 'Version:' {} \;`
- Step 3: Search web server logs for SQL injection patterns targeting the 'entry->roles' parameter: `grep -i "entry\[roles\]\|entry->roles\|union.*select\|or.*1=1" /var/log/apache2/access.log /var/log/nginx/access.log 2>/dev/null`
- Step 4: Verify the plugin is updated by checking the version string matches 4.6.4.1 or higher: `grep -i 'version.*4\.6\.[5-9]\|version.*4\.[7-9]\|version.*[5-9]' /path/to/wp-content/plugins/wp-activity-log/wp-activity-log.php`
FAQ
What is CVE-2024-2018?
CVE-2024-2018 is a SQL injection vulnerability in the WP Activity Log Premium WordPress plugin versions up to 4.6.4 that allows authenticated subscribers to manipulate the 'entry->roles' parameter and execute arbitrary SQL queries, potentially exposing sensitive database information including user credentials and site configuration data.
Is CVE-2024-2018 being actively exploited?
No, CVE-2024-2018 is not currently listed in CISA's Known Exploited Vulnerabilities (KEV) catalog and no public exploits have been disclosed, but it requires only subscriber-level access to trigger, making it a moderate-risk threat in multi-user WordPress environments.
What versions of PHP are affected by CVE-2024-2018?
This vulnerability affects WP Activity Log Premium plugin versions up to and including 4.6.4; it is not a PHP version-specific issue. The fix is available in plugin version 4.6.4.1 and later.
How do I check if my server is vulnerable to CVE-2024-2018?
Run `grep -i 'Version' /path/to/wp-content/plugins/wp-activity-log/wp-activity-log.php` to retrieve the installed plugin version. If the version is 4.6.4 or lower, your installation is vulnerable and requires immediate update to 4.6.4.1.
Does Defensia detect CVE-2024-2018?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If WP Activity Log Premium is installed on a monitored server, CVE-2024-2018 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
- https://melapress.com/support/kb/wp-activity-log-plugin-changelog/
- https://www.wordfence.com/threat-intel/vulnerabilities/id/2f060ea1-01e2-4e5b-82ba-b5cdd0d8290a?source=cve
- https://melapress.com/support/kb/wp-activity-log-plugin-changelog/
- https://www.wordfence.com/threat-intel/vulnerabilities/id/2f060ea1-01e2-4e5b-82ba-b5cdd0d8290a?source=cve
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-2018. Free for 1 server.
Get started free