CVE-2021-24323: Woocommerce/woocommerce Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-mp46-7x6q-f28m
CVSS 4.8
CWE-79
Published
Advisory Summary

CVE-2021-24323 is a MODERATE (CVSS 4.8) remote code execution vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Woocommerce/woocommerce libraries in the Packagist ecosystem. The issue involves woocommerce cross-site scripting via additional tax classes field when taxes are enabled. Remediation is available by upgrading affected packages to version 5.2.0.

CVE-2021-24323 at a Glance

CVE Identifier CVE-2021-24323
GHSA Identifier GHSA-mp46-7x6q-f28m
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
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-2021-24323

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: 5.2.0
Upgrade woocommerce/woocommerce to 5.2.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-2021-24323, 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 5.2.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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. 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

When taxes are enabled, the "Additional tax classes" field was not properly sanitised or escaped before being output back in the admin dashboard, allowing high privilege users such as admin to use XSS payloads even when the unfiltered_html is disabled

CVE-2021-24323 Affected Woocommerce/woocommerce Versions

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

References

Frequently Asked Questions

What is CVE-2021-24323?
CVE-2021-24323 is a security vulnerability in Woocommerce/woocommerce involving Woocommerce Cross-site Scripting via Additional tax classes field when taxes are enabled under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Woocommerce/woocommerce versions are affected?
Affected versions include releases prior to 5.2.0 across affected packages: woocommerce/woocommerce.
What version fixes CVE-2021-24323?
Upgrading to 5.2.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 5.2.0. Upgrade your dependency to 5.2.0 or later.
What is the CVSS score of CVE-2021-24323?
CVE-2021-24323 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-2021-24323?
CVE-2021-24323 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2021-24323?
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-mp46-7x6q-f28m",
  "modified" : "2024-01-10T18:33:55Z",
  "published" : "2022-05-24T19:02:37Z",
  "aliases" : [ "CVE-2021-24323" ],
  "summary" : "Woocommerce Cross-site Scripting via Additional tax classes field when taxes are enabled",
  "details" : "When taxes are enabled, the \"Additional tax classes\" field was not properly sanitised or escaped before being output back in the admin dashboard, allowing high privilege users such as admin to use XSS payloads even when the unfiltered_html is disabled",
  "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" : "5.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-24323"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/woocommerce/woocommerce/commit/6ede8c5f59aec3ca70aa27d1ffd5a6574473f2ce"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/woocommerce/woocommerce"
  }, {
    "type" : "WEB",
    "url" : "https://wpscan.com/vulnerability/6d262555-7ae4-4e36-add6-4baa34dc3010"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-01-10T18:33:55Z",
    "nvd_published_at" : "2021-05-17T17:15:00Z"
  }
}