# CVE-2021-29504: Improper Certificate Validation in WP-CLI framework

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.1
- **CVSS:** 9.1 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`
- **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
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.31% (percentile 71, 2026-11-26)
- **CWE:** CWE-295
- **Aliases:** BIT-wp-cli-2021-29504, GHSA-rwgm-f83r-v3qj
- **Published:** 2021-05-19T23:03:11.000Z
- **Modified:** 2026-07-08T06:28:33.162Z

## 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

## 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

- Packagist `wp-cli/wp-cli`: affected \>= 0.12.0, \< 2.5.0; fixed 2.5.0 (osv)
- wp-cli: \< 2.5.0 (cvelist)

## Mitigation

- Upgrade wp-cli/wp-cli to 2.5.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
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.
```

## 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.

## References

- vendor: <https://github.com/wp-cli/wp-cli/security/advisories/GHSA-rwgm-f83r-v3qj>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2021-29504>
- patch: <https://github.com/wp-cli/checksum-command/pull/86>
- patch: <https://github.com/wp-cli/config-command/pull/128>
- patch: <https://github.com/wp-cli/core-command/pull/186>
- patch: <https://github.com/wp-cli/extension-command/pull/287>
- patch: <https://github.com/wp-cli/package-command/pull/138>
- patch: <https://github.com/wp-cli/wp-cli/pull/5523>
- other: <https://github.com/FriendsOfPHP/security-advisories/blob/master/wp-cli/wp-cli/CVE-2021-29504.yaml>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-29504>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-rwgm-f83r-v3qj> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2021-29504> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-29504>
