CVE-2021-32621: Xwiki commons core Script Injection Without Script Or Vulnerability

HIGH
Advisory Identifier: GHSA-h353-hc43-95vc
CVSS 8.8
CWE-94
Published
Advisory Summary

CVE-2021-32621 is a HIGH (CVSS 8.8) script injection without script or vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Xwiki commons core libraries in the Maven ecosystem. The issue involves script injection without script or programming rights through gadget titles. Remediation is available by upgrading affected packages to version 12.6.7, 12.10.3.

CVE-2021-32621 at a Glance

CVE Identifier CVE-2021-32621
GHSA Identifier GHSA-h353-hc43-95vc
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Xwiki commons core
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

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

How to Fix CVE-2021-32621

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

org.xwiki.commons:xwiki-commons-core fixed: 12.6.7
<dependency>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-core</artifactId>
    <version>12.6.7</version>
</dependency>
org.xwiki.commons:xwiki-commons-core fixed: 12.10.3
<dependency>
    <groupId>org.xwiki.commons</groupId>
    <artifactId>xwiki-commons-core</artifactId>
    <version>12.10.3</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=org.xwiki.commons

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2021-32621, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.xwiki.commons

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

Note: The mvn dependency:tree -Dincludes=org.xwiki.commons command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Xwiki commons core, 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

### Impact A user without Script or Programming right is able to execute script requiring privileges by editing gadget titles in the dashboard. ### Patches The issue has been patched in XWiki 12.6.7, 12.10.3 and 13.0RC1. ### Workarounds There's no easy workaround for this issue, it is recommended to upgrade XWiki. ### References https://jira.xwiki.org/browse/XWIKI-17794 ### For more information If you have any questions or comments about this advisory: * Open an issue in [JIRA](https://jira.xwiki.org) * Email us at [XWiki security mailing-list](mailto:security@xwiki.org)

CVE-2021-32621 Affected Xwiki commons core Versions

2 component(s)
Fixed Versions:
12.6.712.10.3
Product / Package Ecosystem Affected Versions Fixed Version
org.xwiki.commons:xwiki-commons-core
Maven
< 12.6.7
12.6.7
org.xwiki.commons:xwiki-commons-core
Maven
≥ 12.10.0
< 12.10.3
12.10.3

References

Frequently Asked Questions

What is CVE-2021-32621?
CVE-2021-32621 is a security vulnerability in Xwiki commons core involving Script injection without script or programming rights through Gadget titles under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Xwiki commons core versions are affected?
Affected versions include releases prior to 12.6.7, 12.10.3 across affected packages: org.xwiki.commons:xwiki-commons-core.
What version fixes CVE-2021-32621?
Upgrading to 12.6.7, 12.10.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xwiki-commons-core affected?
Yes, org.xwiki.commons:xwiki-commons-core is affected in releases prior to 12.6.7, 12.10.3. Upgrade your dependency to 12.6.7, 12.10.3 or later.
What is the CVSS score of CVE-2021-32621?
CVE-2021-32621 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-32621?
CVE-2021-32621 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Maven dependencies for CVE-2021-32621?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.xwiki.commons'. 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-h353-hc43-95vc",
  "modified" : "2023-09-29T20:11:43Z",
  "published" : "2021-05-18T18:36:16Z",
  "aliases" : [ "CVE-2021-32621" ],
  "summary" : "Script injection without script or programming rights through Gadget titles",
  "details" : "### Impact\nA user without Script or Programming right is able to execute script requiring privileges by editing gadget titles in the dashboard.\n\n### Patches\nThe issue has been patched in XWiki 12.6.7, 12.10.3 and 13.0RC1.\n\n### Workarounds\nThere's no easy workaround for this issue, it is recommended to upgrade XWiki.\n\n### References\nhttps://jira.xwiki.org/browse/XWIKI-17794\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [JIRA](https://jira.xwiki.org)\n* Email us at [XWiki security mailing-list](mailto:security@xwiki.org)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.commons:xwiki-commons-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.6.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.commons:xwiki-commons-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.10.0"
      }, {
        "fixed" : "12.10.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-h353-hc43-95vc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32621"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/commit/bb7068bd911f91e5511f3cfb03276c7ac81100bc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xwiki/xwiki-platform"
  }, {
    "type" : "WEB",
    "url" : "https://jay-from-future.github.io/cve/2021/06/17/xwiki-rce-cve.html"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/XWIKI-17794"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-05-18T16:46:49Z",
    "nvd_published_at" : "2021-05-28T21:15:00Z"
  }
}