{"answers":{"affected":"3 open source packages ship an affected version, including wp-cli/wp-cli and wp-cli. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-29504 in the wild and no public exploit code.","fix":"Upgrade wp-cli/wp-cli to 2.5.0 or later.","what":"CVE-2021-29504 is a critical vulnerability in wp-cli, published on 7 Jun 2021. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-29504 and fix it if it is affected.\n\nWhat it is: CVE-2021-29504 is a critical vulnerability in wp-cli, published on 7 Jun 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-29504 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- wp-cli/wp-cli (Packagist): affected from 0.12.0; fixed in 2.5.0\n- wp-cli/wp-cli (Packagist): affected from 0.12.0; fixed in 2.5.0\n- wp-cli (Bitnami): affected from 0.12.0; fixed in 2.5.0\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-29504/ (Markdown: https://insights.sbomify.com/CVE-2021-29504/index.md)","id":"CVE-2021-29504","markdown":"https://insights.sbomify.com/CVE-2021-29504/index.md","name":"CVE-2021-29504","record":{"aliases":["BIT-wp-cli-2021-29504","GHSA-rwgm-f83r-v3qj","openSUSE-SU-2024:11514-1"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"WordPress CLI tool","requires_auth":"none","summary":"Attackers can bypass TLS certificate validation in WP-CLI to intercept traffic and push malicious updates to WordPress instances or the CLI itself.","user_interaction":"not_required","vuln_class":"security_feature_bypass"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"wp-cli","vendor":"wp-cli"}],"cvss":{"score":9.1,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-295","name":"Improper Certificate Validation"}],"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.","ecosystems":["Bitnami","Packagist","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Improper Certificate Validation in WP-CLI framework","id":"CVE-2021-29504","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"security_feature_bypass","year":"2021"},"n_packages":4,"n_references":7,"next":{"headline":"XStream is vulnerable to a Remote Command Execution attack","id":"CVE-2021-29505"},"packages":[{"ecosystem":"Bitnami","fixed":["2.5.0"],"introduced":["0.12.0"],"last_affected":[],"package":"wp-cli","purl":"pkg:bitnami/wp-cli","source":"BIT-wp-cli-2021-29504"},{"ecosystem":"Packagist","fixed":["2.5.0"],"introduced":["0.12.0"],"last_affected":[],"package":"wp-cli/wp-cli","purl":null,"source":"GHSA-rwgm-f83r-v3qj"},{"ecosystem":"Packagist","fixed":["2.5.0"],"introduced":["0.12.0"],"last_affected":[],"package":"wp-cli/wp-cli","purl":"pkg:composer/wp-cli/wp-cli","source":"GHSA-rwgm-f83r-v3qj"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["2.5.0-1.2"],"introduced":["0"],"last_affected":[],"package":"wp-cli","purl":"pkg:rpm/opensuse/wp-cli\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2024:11514-1"}],"prev":{"headline":"Improper Neutralization of Script-Related HTML Tags in Notes","id":"CVE-2021-29503"},"products":["wp-cli"],"published":"2021-06-07","related":[],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["wp-cli"]},"summary":"Attackers can bypass TLS certificate validation in WP-CLI to intercept traffic and push malicious updates to WordPress instances or the CLI itself.","url":"https://insights.sbomify.com/CVE-2021-29504/"}