CVE-2022-41938: Flarum/core Cross Site Scripting Vulnerability With Vulnerability

CRITICAL
Advisory Identifier: GHSA-7x4w-j98p-854x
CVSS 9.0
CWE-79
Published
Advisory Summary

CVE-2022-41938 is a CRITICAL (CVSS 9.0) cross site scripting vulnerability with vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Flarum/core libraries in the Packagist ecosystem. The issue involves cross site scripting vulnerability with discussion titles. Remediation is available by upgrading affected packages to version 1.6.2.

CVE-2022-41938 at a Glance

CVE Identifier CVE-2022-41938
GHSA Identifier GHSA-7x4w-j98p-854x
Severity CRITICAL
CVSS v3.1 Base Score 9.0
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Flarum/core
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.0

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:R/S:C/C:H/I:H/A:H).

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

How to Fix CVE-2022-41938

To remediate this vulnerability, upgrade all affected Flarum/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.

flarum/core fixed: 1.6.2
Upgrade flarum/core to 1.6.2
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 flarum/core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-41938, inspect your project dependencies for Flarum/core:

inspect dependencies for flarum/core

Analyze the terminal output to locate any version of Flarum/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.2), 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 Flarum/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

Flarum's page title system allowed for page titles to be converted into HTML DOM nodes when pages were rendered. The change was made after `v1.5` and was not noticed. This allowed an attacker to inject malicious HTML markup using a discussion title input, either by creating a new discussion or renaming one. The XSS attack occurs after a visitor opens the relevant discussion page. ### Impact All communities running Flarum from `v1.5.0` to `v1.6.1` are impacted. ### Patches The vulnerability has been fixed and published as flarum/core `v1.6.2`. All communities running Flarum from `v1.5.0` to `v1.6.1` have to upgrade as soon as possible to v1.6.2 using: ``` composer update --prefer-dist --no-dev -a -W ``` You can then confirm you run the latest version using: ``` composer show flarum/core ``` ### Workarounds **None** ### For more information For any questions or comments on this vulnerability please visit https://discuss.flarum.org/d/27558. For support questions create a discussion at https://discuss.flarum.org/t/support. A reminder that if you ever become aware of a security issue in Flarum, please report it to us privately by emailing [security@flarum.org](mailto:security@flarum.org), and we will address it promptly.

CVE-2022-41938 Affected Flarum/core Versions

1 component(s)
Fixed Versions:
1.6.2
Product / Package Ecosystem Affected Versions Fixed Version
flarum/core
Packagist
≥ 1.5.0
< 1.6.2
1.6.2

References

Frequently Asked Questions

What is CVE-2022-41938?
CVE-2022-41938 is a security vulnerability in Flarum/core involving Cross site scripting vulnerability with discussion titles under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Flarum/core versions are affected?
Affected versions include releases prior to 1.6.2 across affected packages: flarum/core.
What version fixes CVE-2022-41938?
Upgrading to 1.6.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flarum/core affected?
Yes, flarum/core is affected in releases prior to 1.6.2. Upgrade your dependency to 1.6.2 or later.
What is the CVSS score of CVE-2022-41938?
CVE-2022-41938 has a CVSS v3.1 base score of 9.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-41938?
CVE-2022-41938 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-2022-41938?
Run the dependency tree command: 'inspect dependencies for flarum/core'. 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-7x4w-j98p-854x",
  "modified" : "2022-11-28T16:18:16Z",
  "published" : "2022-11-21T23:53:32Z",
  "aliases" : [ "CVE-2022-41938" ],
  "summary" : "Cross site scripting vulnerability with discussion titles",
  "details" : "Flarum's page title system allowed for page titles to be converted into HTML DOM nodes when pages were rendered. The change was made after `v1.5` and was not noticed.\n\nThis allowed an attacker to inject malicious HTML markup using a discussion title input, either by creating a new discussion or renaming one. The XSS attack occurs after a visitor opens the relevant discussion page.\n\n### Impact\nAll communities running Flarum from `v1.5.0` to `v1.6.1` are impacted.\n\n### Patches\nThe vulnerability has been fixed and published as flarum/core `v1.6.2`. All communities running Flarum from `v1.5.0` to `v1.6.1` have to upgrade as soon as possible to v1.6.2 using:\n\n```\ncomposer update --prefer-dist --no-dev -a -W\n```\n\nYou can then confirm you run the latest version using:\n\n```\ncomposer show flarum/core\n```\n\n### Workarounds\n**None**\n\n### For more information\nFor any questions or comments on this vulnerability please visit https://discuss.flarum.org/d/27558.\n\nFor support questions create a discussion at https://discuss.flarum.org/t/support.\n\nA reminder that if you ever become aware of a security issue in Flarum, please report it to us privately by emailing [security@flarum.org](mailto:security@flarum.org), and we will address it promptly.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flarum/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.5.0"
      }, {
        "fixed" : "1.6.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/security/advisories/GHSA-7x4w-j98p-854x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-41938"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/commit/690de9ce0ffe7ac4d45b73e303f44340c3433138"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.flarum.org/d/27558"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flarum/framework"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-21T23:53:32Z",
    "nvd_published_at" : "2022-11-19T01:15:00Z"
  }
}