CVE-2024-28850: Johnbillion/wp crontrol Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-9xvf-cjvf-ff5q
CVSS 8.1
CWE-494
Published
Advisory Summary

CVE-2024-28850 is a HIGH (CVSS 8.1) remote code execution vulnerability (CWE-494: Download of Code Without Integrity Check) affecting Johnbillion/wp crontrol libraries in the Packagist ecosystem. The issue involves wp crontrol vulnerable to possible rce when combined with a pre-condition. Remediation is available by upgrading affected packages to version 1.16.2.

CVE-2024-28850 at a Glance

CVE Identifier CVE-2024-28850
GHSA Identifier GHSA-9xvf-cjvf-ff5q
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-494: Download of Code Without Integrity Check
Affected Product Johnbillion/wp crontrol
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-28850

To remediate this vulnerability, upgrade all affected Johnbillion/wp crontrol dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

johnbillion/wp-crontrol fixed: 1.16.2
Upgrade johnbillion/wp-crontrol to 1.16.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for johnbillion/wp-crontrol

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-28850, inspect your project dependencies for Johnbillion/wp crontrol:

inspect dependencies for johnbillion/wp-crontrol

Analyze the terminal output to locate any version of Johnbillion/wp crontrol in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-494: Download of Code Without Integrity Check, where the product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code. In Johnbillion/wp crontrol, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact WP Crontrol includes a feature that allows administrative users to create events in the WP-Cron system that store and execute PHP code [subject to the restrictive security permissions documented here](https://wp-crontrol.com/docs/php-cron-events/). While there is _no known vulnerability in this feature on its own_, there exists potential for this feature to be vulnerable to RCE if it were specifically targeted via vulnerability chaining that exploited a separate SQLi (or similar) vulnerability. This is exploitable on a site if one of the below preconditions are met: * The site is vulnerable to a writeable SQLi vulnerability in any plugin, theme, or WordPress core * The site's database is compromised at the hosting level * The site is vulnerable to a method of updating arbitrary options in the `wp_options` table * The site is vulnerable to a method of triggering an arbitrary action, filter, or function with control of the parameters ### Patches As a hardening measure, WP Crontrol version 1.16.2 ships with a new feature that prevents tampering of the code stored in a PHP cron event. All PHP cron events are now secured via an integrity check that makes use of an HMAC to store a hash of the code alongside it when the event is saved. When the event runs, the hash is verified to ensure the code has not been tampered with. WP Crontrol will not execute the PHP code if the hash cannot be verified or if a stored hash is not present. If an attacker with database-level access were to modify the code in an event in an attempt to execute arbitrary code, the code would no longer execute. Any PHP cron events that exist in the database prior to updating to version 1.16.2 will cease to execute until an administrative user re-saves them from the Cron Events screen in the admin area. A notice will be shown in the admin area informing administrative users if this is the case. ### Workarounds Given that one or more of the preconditions listed above are met, there are no known workarounds for this issue other than to update WP Crontrol to version 1.16.2 or later. Note that neither the `DISALLOW_FILE_MODS` constant nor the `DISALLOW_FILE_EDIT` constant prevent this from being exploitable because these constants do not prevent PHP cron events from being _executed_. It's an intended feature of WP Crontrol that PHP cron events in the database will continue to run according to their schedule even if editing PHP cron events is disabled due to one of these constants being defined. ### FAQ #### Is my site at risk? Your site is only at risk if at least one of the preconditions listed above are met and an attacker is actively attacking your site in order to exploit this. There is no known vulnerability in this feature on its own. #### Why is this classified as high severity? The CVSS score is used to classify the severity of a vulnerability in isolation, which in this case is high due to the possibility of RCE. The actual risk is likely to be low and is dependent entirely on one of the preconditions being met. #### How is this any different to an SQLi vulnerability that would allow an attacker to create an Administrator user and then access the theme or plugin editor? The difference is in the handling of the `DISALLOW_FILE_MODS` and `DISALLOW_FILE_EDIT` constants. With either one of these constants defined in your wp-config.php file then the plugin and theme editors are disabled. In WP Crontrol the ability to _edit_ PHP cron events in WP Crontrol is also disabled in this case, however PHP cron events in the database will continue to run according to their schedule. ### Thanks This issue was identified by John Blackbourn, the author of the WP Crontrol plugin. Thanks go to: * Calvin Alkan for researching and reporting many vulnerabilities in WordPress plugins and for [publishing the details on the snicco blog](https://snicco.io/vulnerability-disclosure). Calvin's work prompted me to investigate whether the PHP cron event functionality in WP Crontrol could be exploited when attacked via with vulnerability chaining, and he collaborated on this security advisory. * Joe Hoyle for collaborating on this advisory.

CVE-2024-28850 Affected Johnbillion/wp crontrol Versions

1 component(s)
Fixed Versions:
1.16.2
Product / Package Ecosystem Affected Versions Fixed Version
johnbillion/wp-crontrol
Packagist
< 1.16.2
1.16.2

References

Frequently Asked Questions

What is CVE-2024-28850?
CVE-2024-28850 is a security vulnerability in Johnbillion/wp crontrol involving WP Crontrol vulnerable to possible RCE when combined with a pre-condition under CWE-494: Download of Code Without Integrity Check.
Which Johnbillion/wp crontrol versions are affected?
Affected versions include releases prior to 1.16.2 across affected packages: johnbillion/wp-crontrol.
What version fixes CVE-2024-28850?
Upgrading to 1.16.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is johnbillion/wp-crontrol affected?
Yes, johnbillion/wp-crontrol is affected in releases prior to 1.16.2. Upgrade your dependency to 1.16.2 or later.
What is the CVSS score of CVE-2024-28850?
CVE-2024-28850 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-28850?
CVE-2024-28850 is classified under CWE-494: Download of Code Without Integrity Check (The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.).
How can I check Packagist dependencies for CVE-2024-28850?
Run the dependency tree command: 'inspect dependencies for johnbillion/wp-crontrol'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9xvf-cjvf-ff5q",
  "modified" : "2024-03-25T19:41:37Z",
  "published" : "2024-03-25T19:41:37Z",
  "aliases" : [ "CVE-2024-28850" ],
  "summary" : "WP Crontrol vulnerable to possible RCE when combined with a pre-condition",
  "details" : "### Impact\n\nWP Crontrol includes a feature that allows administrative users to create events in the WP-Cron system that store and execute PHP code [subject to the restrictive security permissions documented here](https://wp-crontrol.com/docs/php-cron-events/). While there is _no known vulnerability in this feature on its own_, there exists potential for this feature to be vulnerable to RCE if it were specifically targeted via vulnerability chaining that exploited a separate SQLi (or similar) vulnerability.\n\nThis is exploitable on a site if one of the below preconditions are met:\n\n* The site is vulnerable to a writeable SQLi vulnerability in any plugin, theme, or WordPress core\n* The site's database is compromised at the hosting level\n* The site is vulnerable to a method of updating arbitrary options in the `wp_options` table\n* The site is vulnerable to a method of triggering an arbitrary action, filter, or function with control of the parameters\n\n### Patches\n\nAs a hardening measure, WP Crontrol version 1.16.2 ships with a new feature that prevents tampering of the code stored in a PHP cron event.\n\nAll PHP cron events are now secured via an integrity check that makes use of an HMAC to store a hash of the code alongside it when the event is saved. When the event runs, the hash is verified to ensure the code has not been tampered with. WP Crontrol will not execute the PHP code if the hash cannot be verified or if a stored hash is not present. If an attacker with database-level access were to modify the code in an event in an attempt to execute arbitrary code, the code would no longer execute.\n\nAny PHP cron events that exist in the database prior to updating to version 1.16.2 will cease to execute until an administrative user re-saves them from the Cron Events screen in the admin area. A notice will be shown in the admin area informing administrative users if this is the case.\n\n### Workarounds\n\nGiven that one or more of the preconditions listed above are met, there are no known workarounds for this issue other than to update WP Crontrol to version 1.16.2 or later.\n\nNote that neither the `DISALLOW_FILE_MODS` constant nor the `DISALLOW_FILE_EDIT` constant prevent this from being exploitable because these constants do not prevent PHP cron events from being _executed_. It's an intended feature of WP Crontrol that PHP cron events in the database will continue to run according to their schedule even if editing PHP cron events is disabled due to one of these constants being defined.\n\n### FAQ\n\n#### Is my site at risk?\n\nYour site is only at risk if at least one of the preconditions listed above are met and an attacker is actively attacking your site in order to exploit this. There is no known vulnerability in this feature on its own.\n\n#### Why is this classified as high severity?\n\nThe CVSS score is used to classify the severity of a vulnerability in isolation, which in this case is high due to the possibility of RCE. The actual risk is likely to be low and is dependent entirely on one of the preconditions being met.\n\n#### How is this any different to an SQLi vulnerability that would allow an attacker to create an Administrator user and then access the theme or plugin editor?\n\nThe difference is in the handling of the `DISALLOW_FILE_MODS` and `DISALLOW_FILE_EDIT` constants. With either one of these constants defined in your wp-config.php file then the plugin and theme editors are disabled. In WP Crontrol the ability to _edit_ PHP cron events in WP Crontrol is also disabled in this case, however PHP cron events in the database will continue to run according to their schedule.\n\n### Thanks\n\nThis issue was identified by John Blackbourn, the author of the WP Crontrol plugin.\n\nThanks go to:\n\n* Calvin Alkan for researching and reporting many vulnerabilities in WordPress plugins and for [publishing the details on the snicco blog](https://snicco.io/vulnerability-disclosure). Calvin's work prompted me to investigate whether the PHP cron event functionality in WP Crontrol could be exploited when attacked via with vulnerability chaining, and he collaborated on this security advisory.\n* Joe Hoyle for collaborating on this advisory.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "johnbillion/wp-crontrol"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.16.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/johnbillion/wp-crontrol/security/advisories/GHSA-9xvf-cjvf-ff5q"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/johnbillion/wp-crontrol/commit/6d1fadcf6dfdd54e55feef27f916b0cfcd602405"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/johnbillion/wp-crontrol"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/johnbillion/wp-crontrol/releases/tag/1.16.2"
  }, {
    "type" : "WEB",
    "url" : "https://snicco.io/vulnerability-disclosure"
  }, {
    "type" : "WEB",
    "url" : "https://wp-crontrol.com/docs/php-cron-events"
  }, {
    "type" : "WEB",
    "url" : "https://wp-crontrol.com/help/check-php-cron-events"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-494" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-25T19:41:37Z",
    "nvd_published_at" : null
  }
}