CVE-2022-2099: Woocommerce/woocommerce Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-jwvf-28fg-g4xg
CVSS 4.8
CWE-116 CWE-94
Published
Advisory Summary

CVE-2022-2099 is a MODERATE (CVSS 4.8) remote code execution vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Woocommerce/woocommerce libraries in the Packagist ecosystem. The issue involves woocommerce wordpress plugin before 6.6.0 vulnerable to stored html injection. Remediation is available by upgrading affected packages to version 6.6.0.

CVE-2022-2099 at a Glance

CVE Identifier CVE-2022-2099
GHSA Identifier GHSA-jwvf-28fg-g4xg
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Woocommerce/woocommerce
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-2099

To remediate this vulnerability, upgrade all affected Woocommerce/woocommerce dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

woocommerce/woocommerce fixed: 6.6.0
Upgrade woocommerce/woocommerce to 6.6.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for woocommerce/woocommerce

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-2099, inspect your project dependencies for Woocommerce/woocommerce:

inspect dependencies for woocommerce/woocommerce

Analyze the terminal output to locate any version of Woocommerce/woocommerce in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.6.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Woocommerce/woocommerce, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The WooCommerce WordPress plugin before 6.6.0 is vulnerable to stored HTML injection due to lack of escaping and sanitizing in the payment gateway titles

CVE-2022-2099 Affected Woocommerce/woocommerce Versions

1 component(s)
Fixed Versions:
6.6.0
Product / Package Ecosystem Affected Versions Fixed Version
woocommerce/woocommerce
Packagist
< 6.6.0
6.6.0

References

Frequently Asked Questions

What is CVE-2022-2099?
CVE-2022-2099 is a security vulnerability in Woocommerce/woocommerce involving WooCommerce WordPress plugin before 6.6.0 vulnerable to stored HTML injection under CWE-116: Improper Encoding or Escaping of Output.
Which Woocommerce/woocommerce versions are affected?
Affected versions include releases prior to 6.6.0 across affected packages: woocommerce/woocommerce.
What version fixes CVE-2022-2099?
Upgrading to 6.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is woocommerce/woocommerce affected?
Yes, woocommerce/woocommerce is affected in releases prior to 6.6.0. Upgrade your dependency to 6.6.0 or later.
What is the CVSS score of CVE-2022-2099?
CVE-2022-2099 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2022-2099?
CVE-2022-2099 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check Packagist dependencies for CVE-2022-2099?
Run the dependency tree command: 'inspect dependencies for woocommerce/woocommerce'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jwvf-28fg-g4xg",
  "modified" : "2022-07-21T21:40:20Z",
  "published" : "2022-07-18T00:00:33Z",
  "aliases" : [ "CVE-2022-2099" ],
  "summary" : "WooCommerce WordPress plugin before 6.6.0 vulnerable to stored HTML injection",
  "details" : "The WooCommerce WordPress plugin before 6.6.0 is vulnerable to stored HTML injection due to lack of escaping and sanitizing in the payment gateway titles",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "woocommerce/woocommerce"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-2099"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/woocommerce/woocommerce"
  }, {
    "type" : "WEB",
    "url" : "https://wpscan.com/vulnerability/0316e5f3-3302-40e3-8ff4-be3423a3be7b"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-94" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-21T21:40:20Z",
    "nvd_published_at" : "2022-07-17T11:15:00Z"
  }
}