CVE-2021-29504

9.1 CRITICAL

📋 TL;DR

This vulnerability in WP-CLI allows attackers who can intercept network traffic to disable TLS certificate verification, enabling man-in-the-middle attacks. Attackers could impersonate update servers and push malicious updates to WordPress installations or WP-CLI itself. Affects WP-CLI versions 0.12.0 through 2.4.0.

💻 Affected Systems

Products:
  • WP-CLI (WordPress Command Line Interface)
Versions: 0.12.0 through 2.4.0
Operating Systems: All operating systems running WP-CLI
Default Config Vulnerable: ⚠️ Yes
Notes: All installations using default settings are vulnerable. The vulnerability affects the underlying http_request() function used by multiple WP-CLI commands.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers gain full control over WP-CLI communications, push malicious WordPress updates to compromise entire sites, and potentially achieve remote code execution on affected systems.

🟠

Likely Case

Attackers intercept communications to push malicious updates, compromise WordPress installations, and potentially steal credentials or install backdoors.

🟢

If Mitigated

With proper network segmentation and certificate validation, impact is limited to potential denial of service from failed TLS connections.

🌐 Internet-Facing: MEDIUM - Requires attacker to intercept traffic between WP-CLI and update servers, which is more feasible on public networks.
🏢 Internal Only: LOW - Internal networks with proper segmentation and monitoring reduce interception opportunities.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires network interception capability (man-in-the-middle position). No authentication needed as it exploits default error handling behavior.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.5.0

Vendor Advisory: https://github.com/wp-cli/wp-cli/pull/5523

Restart Required: No

Instructions:

1. Update WP-CLI to version 2.5.0 or later using: wp cli update --stable
2. Verify update with: wp --version
3. Test that WP-CLI commands still work with your environment's certificate configuration.

🔧 Temporary Workarounds

Use --insecure flag for affected commands

all

For versions 2.5.0+, explicitly opt-in to insecure behavior when needed for compatibility

wp cli update --insecure
wp core update --insecure

🧯 If You Can't Patch

  • Avoid using WP-CLI on untrusted networks where traffic interception is possible
  • Implement network monitoring for unexpected certificate validation failures or unusual update requests

🔍 How to Verify

Check if Vulnerable:

Run: wp --version. If version is between 0.12.0 and 2.4.0 inclusive, system is vulnerable.

Check Version:

wp --version

Verify Fix Applied:

Run: wp --version. If version is 2.5.0 or higher, the fix is applied. Test with: wp cli check-update to verify secure connections work.

📡 Detection & Monitoring

Log Indicators:

  • Multiple TLS handshake failures followed by successful connections without certificate validation
  • Unexpected update requests or sources in WP-CLI logs

Network Indicators:

  • Unencrypted HTTP traffic from WP-CLI where HTTPS was expected
  • Connections to unusual update server addresses

SIEM Query:

Search for 'certificate verification failed' or 'TLS handshake error' in WP-CLI logs followed by successful connections

🔗 References

📤 Share & Export