# CVE-2024-28850: WP Crontrol possible RCE when combined with a pre-condition

> Administrators can execute arbitrary PHP code via WP Crontrol if combined with other vulnerabilities like SQL injection or database compromise.

- **Severity:** High 8.2 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Mar 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-9xvf-cjvf-ff5q

## What is CVE-2024-28850?

CVE-2024-28850 is a high-severity code injection vulnerability in johnbillion wp-crontrol, published on 25 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

WP Crontrol controls the cron events on WordPress websites.  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. 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, or the site is vulnerable to a method of triggering an arbitrary action, filter, or function with control of the parameters.  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.

Weakness: CWE-494 (Download of Code Without Integrity Check)

## Which versions are affected by CVE-2024-28850?

2 open source packages ship an affected version, including johnbillion/wp-crontrol. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `johnbillion/wp-crontrol` | Packagist | All versions | 1.16.2 |
| `johnbillion/wp-crontrol` | Packagist | All versions | 1.16.2 |

Products: Johnbillion Wp Crontrol.

## How do I fix CVE-2024-28850?

Upgrade johnbillion/wp-crontrol to 1.16.2 or later.

## Is CVE-2024-28850 being exploited?

There is no known exploitation of CVE-2024-28850 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-28850 and fix it if it is affected.

What it is: CVE-2024-28850 is a high-severity code injection vulnerability in johnbillion wp-crontrol, published on 25 Mar 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-28850 in the wild and no public exploit code.

Affected packages and fixed versions:
- johnbillion/wp-crontrol (Packagist): affected all versions; fixed in 1.16.2
- johnbillion/wp-crontrol (Packagist): affected all versions; fixed in 1.16.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-28850/ (Markdown: https://insights.sbomify.com/CVE-2024-28850/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-28850
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-28850
- OSV: https://osv.dev/vulnerability/CVE-2024-28850

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-28850/
Summaries are generated and may contain mistakes; the official description above is the record.
