CVE-2022-41933: Xwiki platform security authentication default Xwiki-platform-security-authentication-default Vulnerability

MODERATE
Advisory Identifier: GHSA-q2hm-2h45-v5g3
CVSS 6.2
CWE-312 CWE-522
Published
Advisory Summary

CVE-2022-41933 is a MODERATE (CVSS 6.2) xwiki-platform-security-authentication-default vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting Xwiki platform security authentication default libraries in the Maven ecosystem. The issue involves xwiki-platform-security-authentication-default. Remediation is available by upgrading affected packages to version 13.10.8, 14.4.3.

CVE-2022-41933 at a Glance

CVE Identifier CVE-2022-41933
GHSA Identifier GHSA-q2hm-2h45-v5g3
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-312: Cleartext Storage of Sensitive Information
Affected Product Xwiki platform security authentication default
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.2

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:H/I:N/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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2022-41933

To remediate this vulnerability, upgrade all affected Xwiki platform security authentication default 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-security-authentication-default fixed: 13.10.8
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-security-authentication-default</artifactId>
    <version>13.10.8</version>
</dependency>
org.xwiki.platform:xwiki-platform-security-authentication-default fixed: 14.4.3
<dependency>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-security-authentication-default</artifactId>
    <version>14.4.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.platform

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2022-41933, 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 security authentication default in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 13.10.8), 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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. In Xwiki platform security authentication default, 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 We discovered that when the reset a forgotten password feature of XWiki was used, the password was then stored in plain text in database. This only concerns XWiki 13.1RC1 and next versions. Note that it only concerns the reset password feature available from the "Forgot your password" link in the login view: the features allowing a user to change their password, or for an admin to change a user password are not impacted. This vulnerability is particularly dangerous in combination with other vulnerabilities allowing to perform data leak of personal data from users, such as https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-599v-w48h-rjrm. Note that this vulnerability only concerns the users of the main wiki: in case of farms, the users registered on subwiki are not impacted thanks to a bug we discovered when investigating this. ### Patches The problem has been patched in version 14.6RC1, 14.4.3 and 13.10.8. The patch involves a migration of the impacted users as well as the history of the page, to ensure no password remains in plain text in the database. This migration also involves to inform the users about the possible disclosure of their passwords: by default, two emails are automatically sent to the impacted users. A first email to inform about the possibility that their password have been leaked, and a second email using the reset password feature to ask them to set a new password. See below for the configuration options to disable the mail sending. The first email contains by default the following text (could be translated depending on the wiki language settings): ``` Subject: Important security issue Dear user, due to a bug your password was stored in plain text in our wiki. We cannot exclude that your plain text password was exposed in a data leak. Therefore, you might receive a second email to choose a new password. Please contact the administrator in case of problem or for further questions. ``` It's possible to specify another text by creating a file at the root of the permanent directory named `140600000XWIKI19869-mail.txt`, this file should have same structure as used above: ``` Subject: [your custom subject] [your custom mail content] ``` This mail is sent plain text and cannot contain any variable. Note that the second mail for the reset password is using the standard feature, so you can find information about the email templates [there](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Authentication/#HMailTemplates). Also note that if the users doesn't have any registered email address obviously no mail will be sent, so it's the administrators responsibility to find a way to contact the user (through comment on the user profile, or any other channel used for that wiki). The administrator should be particularly careful on the presence of logs such as: ``` WARN WIKI19869DataMigrationListener - Reset email cannot be sent for user [reference = [xwiki:XWiki.Foo]] as no email address is provided ``` It's also possible for administrators to set some properties for the migration: it's possible to decide if the user password should be reset (default) or if the passwords should be kept but only hashed. Note that in the first option, the users won't be able to login anymore until they set a new password if they were impacted. Note that in both options, mails will be sent to users to inform them and encourage them to change their passwords. Two other properties are available to chose the behaviour regarding the mails to be sent: it's possible to chose to only send the first security email, or to only send the reset password email. It's important to note that those emails are sent after the migration during the initialization of the wiki, by reading a file creating by the migration in the permanent directory (the file is named `140600000XWIKI19869DataMigration-users.txt`): then it's possible for an administrator to chose to not sent any email when the migration is performed (by setting the properties to false), and to send them later in a future restart by then setting back the properties to true before the restart of the wiki. Also note that the file is deleted after the mails are sent. The mentioned properties can be found in `xwiki.properties` in the `[Security]` section: ``` #-# [Since 14.6RC1] #-# [Since 14.4.3] #-# [Since 13.10.8] #-# This option is only used when performing a migration from a wiki before the versions mentioning above. #-# This parameter defines if as part of the migration R140600000XWIKI19869 the passwords of impacted user should be #-# reset or not. It's advised to keep this value as true, now for some usecases advertised administrators might want #-# their users to keep their passwords nevertheless, then enable the configuration and set it to false before the #-# migration is executed. # security.migration.R140600000XWIKI19869.resetPassword = true #-# [Since 14.6RC1] #-# [Since 14.4.3] #-# [Since 13.10.8] #-# This option is only used when performing a migration from a wiki before the versions mentioned above. #-# This parameter defines if reset password emails should be sent as part of the migration R140600000XWIKI19869. #-# By default this value is set to true, so emails will be automatically produced. Now it's possible for admin to set #-# this option to false: note that in such case a file containing the list of users for whom a reset password email #-# should be sent will still be created in the permanent directory (named 140600000XWIKI19869DataMigration-users.txt). #-# If this file exists and this property is set back to true after the migration, the file will still be consumed to #-# send the emails, so it's possible to perform the migration and send the emails only later if needed. # security.migration.R140600000XWIKI19869.sendResetPasswordEmail = true #-# [Since 14.6RC1] #-# [Since 14.4.3] #-# [Since 13.10.8] #-# This option is only used when performing a migration from a wiki before the versions mentioned above. #-# #-# This parameter defines if a security email information should be sent as part of the migration R140600000XWIKI19869. #-# By default this value is set to true, so emails will be automatically produced. Now it's possible for admin to set #-# this option to false: note that in such case a file containing the list of users for whom a reset password email #-# should be sent will still be created in the permanent directory (named 140600000XWIKI19869DataMigration-users.txt). #-# If this file exists and this property is set back to true after the migration, the file will still be consumed to #-# send the emails, so it's possible to perform the migration and send the emails only later if needed. # security.migration.R140600000XWIKI19869.sendSecurityEmail = true ``` ### Workarounds There is actually 2 parts of the vulnerability: 1. users who might have use the reset feature should get their password protected. We provide some instructions how to identify and fix those. 2. the next usage of the reset password feature shouldn't lead to plain text password: sadly there is no easy workaround for that, except by recompiling `xwiki-platform-security-authentication-default` with that change: https://github.com/xwiki/xwiki-platform/commit/443e8398b75a1295067d74afb5898370782d863a#diff-f8a8f8ba80dfc55f044e2e60b521ce379176430ca6921b0f87b79cf682531f79L322 It's possible to identify all impacted users and to manually reset their passwords with an Admin account. For identifying the impacted users, a query such as the following is possible: ``` {{velocity}} ## The statement is put on multiple lines for readability of the snippet #set ($statement = "select distinct doc.fullName from Document doc, doc.object(XWiki.XWikiUsers) objUser where objUser.password not like 'hash:%' and objUser.password <> '' order by doc.fullName") $services.query.xwql($statement).execute() {{/velocity}} ``` Once impacted users are identified at least 2 options are possible: 1. Set a new password (manually by going to the user profile, or automatically with a groovy script for example) 4. rollback to a previous version of the user document: in such case the password will be automatically processed properly Be aware that those workarounds won't remove the clear password entry that might remain in database due to history. ### References * Jira ticket: https://jira.xwiki.org/browse/XWIKI-19869 * Advisory of a data leak vulnerability that increases the criticality of this vulnerability: https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-599v-w48h-rjrm * Bug discovered "protecting" subwiki from this vulnerability: https://jira.xwiki.org/browse/XWIKI-19945 ### 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 [security ML](mailto:security@xwiki.org)

CVE-2022-41933 Affected Xwiki platform security authentication default Versions

2 component(s)
Fixed Versions:
13.10.814.4.3
Product / Package Ecosystem Affected Versions Fixed Version
org.xwiki.platform:xwiki-platform-security-authentication-default
Maven
≥ 13.1RC1
< 13.10.8
13.10.8
org.xwiki.platform:xwiki-platform-security-authentication-default
Maven
≥ 14.0.0
< 14.4.3
14.4.3

References

Frequently Asked Questions

What is CVE-2022-41933?
CVE-2022-41933 is a security vulnerability in Xwiki platform security authentication default involving xwiki-platform-security-authentication-default under CWE-312: Cleartext Storage of Sensitive Information.
Which Xwiki platform security authentication default versions are affected?
Affected versions include releases prior to 13.10.8, 14.4.3 across affected packages: org.xwiki.platform:xwiki-platform-security-authentication-default.
What version fixes CVE-2022-41933?
Upgrading to 13.10.8, 14.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xwiki-platform-security-authentication-default affected?
Yes, org.xwiki.platform:xwiki-platform-security-authentication-default is affected in releases prior to 13.10.8, 14.4.3. Upgrade your dependency to 13.10.8, 14.4.3 or later.
What is the CVSS score of CVE-2022-41933?
CVE-2022-41933 has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2022-41933?
CVE-2022-41933 is classified under CWE-312: Cleartext Storage of Sensitive Information (The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.).
How can I check Maven dependencies for CVE-2022-41933?
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-q2hm-2h45-v5g3",
  "modified" : "2022-12-03T04:09:18Z",
  "published" : "2022-11-21T22:37:11Z",
  "aliases" : [ "CVE-2022-41933" ],
  "summary" : "Plaintext storage of password after a reset in org.xwiki.platform:xwiki-platform-security-authentication-default",
  "details" : "### Impact\n\nWe discovered that when the reset a forgotten password feature of XWiki was used, the password was then stored in plain text in database. This only concerns XWiki 13.1RC1 and next versions.\nNote that it only concerns the reset password feature available from the \"Forgot your password\" link in the login view: the features allowing a user to change their password, or for an admin to change a user password are not impacted.\n\nThis vulnerability is particularly dangerous in combination with other vulnerabilities allowing to perform data leak of personal data from users, such as https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-599v-w48h-rjrm. \n\nNote that this vulnerability only concerns the users of the main wiki: in case of farms, the users registered on subwiki are not impacted thanks to a bug we discovered when investigating this.\n\n### Patches\n\nThe problem has been patched in version 14.6RC1, 14.4.3 and 13.10.8.\n\nThe patch involves a migration of the impacted users as well as the history of the page, to ensure no password remains in plain text in the database. This migration also involves to inform the users about the possible disclosure of their passwords: by default, two emails are automatically sent to the impacted users. A first email to inform about the possibility that their password have been leaked, and a second email using the reset password feature to ask them to set a new password. See below for the configuration options to disable the mail sending.\n\nThe first email contains by default the following text (could be translated depending on the wiki language settings):\n```\nSubject: Important security issue\nDear user,\n\ndue to a bug your password was stored in plain text in our wiki. We cannot exclude that your plain text password was exposed in a data leak. Therefore, you might receive a second email to choose a new password. \nPlease contact the administrator in case of problem or for further questions.\n```\nIt's possible to specify another text by creating a file at the root of the permanent directory named `140600000XWIKI19869-mail.txt`, this file should have same structure as used above:\n```\nSubject: [your custom subject]\n[your custom mail content]\n```\nThis mail is sent plain text and cannot contain any variable. \nNote that the second mail for the reset password is using the standard feature, so you can find information about the email templates [there](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Authentication/#HMailTemplates).\nAlso note that if the users doesn't have any registered email address obviously no mail will be sent, so it's the administrators responsibility to find a way to contact the user (through comment on the user profile, or any other channel used for that wiki). The administrator should be particularly careful on the presence of logs such as: \n```\nWARN  WIKI19869DataMigrationListener - Reset email cannot be sent for user [reference = [xwiki:XWiki.Foo]] as no email address is provided\n```\n\nIt's also possible for administrators to set some properties for the migration: it's possible to decide if the user password should be reset (default) or if the passwords should be kept but only hashed. Note that in the first option, the users won't be able to login anymore until they set a new password if they were impacted. Note that in both options, mails will be sent to users to inform them and encourage them to change their passwords.\n\nTwo other properties are available to chose the behaviour regarding the mails to be sent: it's possible to chose to only send the first security email, or to only send the reset password email. It's important to note that those emails are sent after the migration during the initialization of the wiki, by reading a file creating by the migration in the permanent directory (the file is named `140600000XWIKI19869DataMigration-users.txt`): then it's possible for an administrator to chose to not sent any email when the migration is performed (by setting the properties to false), and to send them later in a future restart by then setting back the properties to true before the restart of the wiki. Also note that the file is deleted after the mails are sent. \n\nThe mentioned properties can be found in `xwiki.properties` in the `[Security]` section:\n```\n#-# [Since 14.6RC1]\n#-# [Since 14.4.3]\n#-# [Since 13.10.8]\n#-# This option is only used when performing a migration from a wiki before the versions mentioning above.\n#-# This parameter defines if as part of the migration R140600000XWIKI19869 the passwords of impacted user should be\n#-# reset or not. It's advised to keep this value as true, now for some usecases advertised administrators might want\n#-# their users to keep their passwords nevertheless, then enable the configuration and set it to false before the\n#-# migration is executed.\n# security.migration.R140600000XWIKI19869.resetPassword = true\n\n#-# [Since 14.6RC1]\n#-# [Since 14.4.3]\n#-# [Since 13.10.8]\n#-# This option is only used when performing a migration from a wiki before the versions mentioned above.\n\n#-# This parameter defines if reset password emails should be sent as part of the migration R140600000XWIKI19869.\n#-# By default this value is set to true, so emails will be automatically produced. Now it's possible for admin to set\n#-# this option to false: note that in such case a file containing the list of users for whom a reset password email\n#-# should be sent will still be created in the permanent directory (named 140600000XWIKI19869DataMigration-users.txt).\n#-# If this file exists and this property is set back to true after the migration, the file will still be consumed to\n#-# send the emails, so it's possible to perform the migration and send the emails only later if needed.\n# security.migration.R140600000XWIKI19869.sendResetPasswordEmail = true\n\n#-# [Since 14.6RC1]\n#-# [Since 14.4.3]\n#-# [Since 13.10.8]\n#-# This option is only used when performing a migration from a wiki before the versions mentioned above.\n#-#\n#-# This parameter defines if a security email information should be sent as part of the migration R140600000XWIKI19869.\n#-# By default this value is set to true, so emails will be automatically produced. Now it's possible for admin to set\n#-# this option to false: note that in such case a file containing the list of users for whom a reset password email\n#-# should be sent will still be created in the permanent directory (named 140600000XWIKI19869DataMigration-users.txt).\n#-# If this file exists and this property is set back to true after the migration, the file will still be consumed to\n#-# send the emails, so it's possible to perform the migration and send the emails only later if needed.\n# security.migration.R140600000XWIKI19869.sendSecurityEmail = true\n```\n\n\n### Workarounds\n\nThere is actually 2 parts of the vulnerability:\n  1. users who might have use the reset feature should get their password protected. We provide some instructions how to identify and fix those. \n  2. the next usage of the reset password feature shouldn't lead to plain text password: sadly there is no easy workaround for that, except by recompiling `xwiki-platform-security-authentication-default` with that change: https://github.com/xwiki/xwiki-platform/commit/443e8398b75a1295067d74afb5898370782d863a#diff-f8a8f8ba80dfc55f044e2e60b521ce379176430ca6921b0f87b79cf682531f79L322\n  \nIt's possible to identify all impacted users and to manually reset their passwords with an Admin account. For identifying the impacted users, a query such as the following is possible:\n\n```\n{{velocity}}\n## The statement is put on multiple lines for readability of the snippet\n#set ($statement = \"select distinct doc.fullName from Document doc, doc.object(XWiki.XWikiUsers) objUser \nwhere objUser.password not like 'hash:%' and objUser.password <> '' \norder by doc.fullName\")\n$services.query.xwql($statement).execute()\n{{/velocity}}\n```\nOnce impacted users are identified at least 2 options are possible:\n  1. Set a new password (manually by going to the user profile, or automatically with a groovy script for example)\n  4. rollback to a previous version of the user document: in such case the password will be automatically processed properly\n\nBe aware that those workarounds won't remove the clear password entry that might remain in database due to history.\n\n### References\n\n  * Jira ticket: https://jira.xwiki.org/browse/XWIKI-19869\n  * Advisory of a data leak vulnerability that increases the criticality of this vulnerability: https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-599v-w48h-rjrm\n  * Bug discovered \"protecting\" subwiki from this vulnerability: https://jira.xwiki.org/browse/XWIKI-19945\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 [security ML](mailto:security@xwiki.org)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-security-authentication-default"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.1RC1"
      }, {
        "fixed" : "13.10.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.xwiki.platform:xwiki-platform-security-authentication-default"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "14.0.0"
      }, {
        "fixed" : "14.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-599v-w48h-rjrm"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-q2hm-2h45-v5g3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41933"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xwiki/xwiki-platform/commit/443e8398b75a1295067d74afb5898370782d863a#diff-f8a8f8ba80dfc55f044e2e60b521ce379176430ca6921b0f87b79cf682531f79L322"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xwiki/xwiki-platform"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/XWIKI-19869"
  }, {
    "type" : "WEB",
    "url" : "https://jira.xwiki.org/browse/XWIKI-19945"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-312", "CWE-522" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-21T22:37:11Z",
    "nvd_published_at" : "2022-11-23T21:15:00Z"
  }
}