CVE-2021-21379: Xwiki platform rendering wikimacro store It's Possible To Execute Anything Vulnerability

LOW
Advisory Identifier: GHSA-v662-xpcc-9xf6
CWE-281
Published
Advisory Summary

CVE-2021-21379 is a LOW it's possible to execute anything vulnerability (CWE-281: Improper Preservation of Permissions) affecting Xwiki platform rendering wikimacro store libraries in the Maven ecosystem. The issue involves it's possible to execute anything with the rights of the author of a macro which uses the {{wikimacrocontent}} macro. Remediation is available by upgrading affected packages to version 11.10.11, 12.6.3, 12.8.

CVE-2021-21379 at a Glance

CVE Identifier CVE-2021-21379
GHSA Identifier GHSA-v662-xpcc-9xf6
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-281: Improper Preservation of Permissions
Affected Product Xwiki platform rendering wikimacro store
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2021-21379

To remediate this vulnerability, upgrade all affected Xwiki platform rendering wikimacro store 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.platform:xwiki-platform-rendering-wikimacro-store fixed: 11.10.11
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-rendering-wikimacro-store</artifactId>
    <version>11.10.11</version>
</dependency>
org.xwiki.platform:xwiki-platform-rendering-wikimacro-store fixed: 12.6.3
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-rendering-wikimacro-store</artifactId>
    <version>12.6.3</version>
</dependency>
org.xwiki.platform:xwiki-platform-rendering-wikimacro-store fixed: 12.8
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-rendering-wikimacro-store</artifactId>
    <version>12.8</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.platform

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.xwiki.platform 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-281: Improper Preservation of Permissions, where the product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended. In Xwiki platform rendering wikimacro store, 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 The `{{wikimacrocontent}}` executes the content with the rights of the wiki macro author instead of the caller of that wiki macro. This makes possible to inject scripts through it and they will be executed with the rights of the wiki macro (very often a user which has Programming rights). Fortunately, no such macro exists by default in XWiki Standard but one could have been created or installed with an extension. ### Patches It has been patched in versions XWiki 12.6.3, 11.10.11 and 12.8-rc-1. ### Workarounds There is no easy workaround other than disabling the affected macros. Inserting content in a safe way or knowing what is the user who called the wiki macro is not easy. ### References https://jira.xwiki.org/browse/XWIKI-17759 ### For more information If you have any questions or comments about this advisory: * Open an issue in [Jira XWiki](https://jira.xwiki.org) * Email us at [our security mailing list](mailto:security@xwiki.org)

CVE-2021-21379 Affected Xwiki platform rendering wikimacro store Versions

3 component(s)
Fixed Versions:
11.10.1112.6.312.8
Product / Package Ecosystem Affected Versions Fixed Version
org.xwiki.platform:xwiki-platform-rendering-wikimacro-store
Maven
≥ 11.4
< 11.10.11
11.10.11
org.xwiki.platform:xwiki-platform-rendering-wikimacro-store
Maven
≥ 12.0
< 12.6.3
12.6.3
org.xwiki.platform:xwiki-platform-rendering-wikimacro-store
Maven
≥ 12.7
< 12.8
12.8

References

Frequently Asked Questions

What is CVE-2021-21379?
CVE-2021-21379 is a security vulnerability in Xwiki platform rendering wikimacro store involving It's possible to execute anything with the rights of the author of a macro which uses the {{wikimacrocontent}} macro under CWE-281: Improper Preservation of Permissions.
Which Xwiki platform rendering wikimacro store versions are affected?
Affected versions include releases prior to 11.10.11, 12.6.3, 12.8 across affected packages: org.xwiki.platform:xwiki-platform-rendering-wikimacro-store.
What version fixes CVE-2021-21379?
Upgrading to 11.10.11, 12.6.3, 12.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xwiki-platform-rendering-wikimacro-store affected?
Yes, org.xwiki.platform:xwiki-platform-rendering-wikimacro-store is affected in releases prior to 11.10.11, 12.6.3, 12.8. Upgrade your dependency to 11.10.11, 12.6.3, 12.8 or later.
What CWE is associated with CVE-2021-21379?
CVE-2021-21379 is classified under CWE-281: Improper Preservation of Permissions (The product does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.).
How can I check Maven dependencies for CVE-2021-21379?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.xwiki.platform'. 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-v662-xpcc-9xf6",
  "modified" : "2021-03-23T22:24:20Z",
  "published" : "2021-03-23T22:47:26Z",
  "aliases" : [ "CVE-2021-21379" ],
  "summary" : "It's possible to execute anything with the rights of the author of a macro which uses the {{wikimacrocontent}} macro",
  "details" : "### Impact\n\nThe `{{wikimacrocontent}}` executes the content with the rights of the wiki macro author instead of the caller of that wiki macro. This makes possible to inject scripts through it and they will be executed with the rights of the wiki macro (very often a user which has Programming rights).\n\nFortunately, no such macro exists by default in XWiki Standard but one could have been created or installed with an extension.\n\n### Patches\n\nIt has been patched in versions XWiki 12.6.3, 11.10.11 and 12.8-rc-1.\n\n### Workarounds\n\nThere is no easy workaround other than disabling the affected macros.\nInserting content in a safe way or knowing what is the user who called the wiki macro is not easy.\n\n### References\n\nhttps://jira.xwiki.org/browse/XWIKI-17759\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [Jira XWiki](https://jira.xwiki.org)\n* Email us at [our security mailing list](mailto:security@xwiki.org)",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-rendering-wikimacro-store"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "11.4"
      }, {
        "fixed" : "11.10.11"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-rendering-wikimacro-store"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.0"
      }, {
        "fixed" : "12.6.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-rendering-wikimacro-store"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.7"
      }, {
        "fixed" : "12.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 12.7.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-v662-xpcc-9xf6"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21379"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/XWIKI-17759"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-281" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-23T22:24:20Z",
    "nvd_published_at" : "2021-03-12T18:15:00Z"
  }
}