CVE-2021-29504
Improper Certificate Validation in WP-CLI framework
Also known as BIT-wp-cli-2021-29504, GHSA-rwgm-f83r-v3qj
Mitigation
- Upgrade wp-cli/wp-cli to 2.5.0 or later.
Who should check
- Projects that depend on Packagist package wp-cli/wp-cli (>= 0.12.0, < 2.5.0)
- Anyone running wp-cli < 2.5.0
Vulnerability facts
- Affected
- wp-cli/wp-cli >= 0.12.0, < 2.5.0
- Fixed in
- 2.5.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.1 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: None
- EPSS
- 1.31% chance of exploitation in 30 days (percentile 71, 2026-11-26)
- CWE
- CWE-295
- Modified
Description
WP-CLI is the command-line interface for WordPress. An improper error handling in HTTPS requests management in WP-CLI version 0.12.0 and later allows remote attackers able to intercept the communication to remotely disable the certificate verification on WP-CLI side, gaining full control over the communication content, including the ability to impersonate update servers and push malicious updates towards WordPress instances controlled by the vulnerable WP-CLI agent, or push malicious updates toward WP-CLI itself. The vulnerability stems from the fact that the default behavior of `WP_CLI\Utils\http_request()` when encountering a TLS handshake error is to disable certificate validation and retry the same request. The default behavior has been changed with version 2.5.0 of WP-CLI and the `wp-cli/wp-cli` framework (via https://github.com/wp-cli/wp-cli/pull/5523) so that the `WP_CLI\Utils\http_request()` method accepts an `$insecure` option that is `false` by default and consequently that a TLS handshake failure is a hard error by default. This new default is a breaking change and ripples through to all consumers of `WP_CLI\Utils\http_request()`, including those in separate WP-CLI bundled or third-party packages. https://github.com/wp-cli/wp-cli/pull/5523 has also added an `--insecure` flag to the `cli update` command to counter this breaking change. There is no direct workaround for the default insecure behavior of `wp-cli/wp-cli` versions before 2.5.0. The workaround for dealing with the breaking change in the commands directly affected by the new secure default behavior is to add the `--insecure` flag to manually opt-in to the previous insecure behavior.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Packagist wp-cli/wp-cli | >= 0.12.0, < 2.5.0 | 2.5.0 | osv |
| wp-cli | < 2.5.0 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2021-29504. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2021-29504.md Affected: wp-cli/wp-cli >= 0.12.0, < 2.5.0 Fixed in: 2.5.0 Steps: 1. Search this machine and project for wp-cli/wp-cli (Packagist), wp-cli: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
FAQ
Is CVE-2021-29504 being exploited?
There is no confirmed exploitation: CVE-2021-29504 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.31% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2021-29504?
Critical: CVSS 9.1 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2021-29504?
wp-cli/wp-cli >= 0.12.0, < 2.5.0.
Is there a fix for CVE-2021-29504?
Yes. Fixed in 2.5.0. Upgrade wp-cli/wp-cli to 2.5.0 or later.
How do I check if I'm affected by CVE-2021-29504?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.