CVE-2021-32671: Flarum/core Cross-Site Scripting Vulnerability

CRITICAL
Advisory Identifier: GHSA-5qjq-69w6-fg57
CVSS 10.0
CWE-79
Published
Advisory Summary

CVE-2021-32671 is a CRITICAL (CVSS 10.0) cross-site scripting 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 xss vulnerability with translator. Remediation is available by upgrading affected packages to version 1.0.2.

CVE-2021-32671 at a Glance

CVE Identifier CVE-2021-32671
GHSA Identifier GHSA-5qjq-69w6-fg57
Severity CRITICAL
CVSS v3.1 Base Score 10.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: 10.0

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

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

How to Fix CVE-2021-32671

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.0.2
Upgrade flarum/core to 1.0.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-2021-32671, 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.0.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 translation system allowed for string inputs to be converted into HTML DOM nodes when rendered. This change was made after v0.1.0-beta.16 (our last beta before v1.0.0) and was not noticed or documented. This allowed for any user to type malicious HTML markup within certain user input fields and have this execute on client browsers. The example which led to the discovery of this vulnerability was in the forum search box. Entering faux-malicious HTML markup, such as <script>alert('test')</script> resulted in an alert box appearing on the forum. This attack could also be modified to perform AJAX requests on behalf of a user, possibly deleting discussions, modifying their settings or profile, or even modifying settings on the Admin panel if the attack was targetted towards a privileged user. ### Impact All Flarum communities that run flarum v1.0.0 or v1.0.1 are impacted. ### Patches The vulnerability has been fixed and published as flarum/core v1.0.2. All communities running Flarum v1.0 have to upgrade as soon as possible to v1.0.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, and we will address it promptly.

CVE-2021-32671 Affected Flarum/core Versions

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

References

Frequently Asked Questions

What is CVE-2021-32671?
CVE-2021-32671 is a security vulnerability in Flarum/core involving XSS vulnerability with translator 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.0.2 across affected packages: flarum/core.
What version fixes CVE-2021-32671?
Upgrading to 1.0.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.0.2. Upgrade your dependency to 1.0.2 or later.
What is the CVSS score of CVE-2021-32671?
CVE-2021-32671 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2021-32671?
CVE-2021-32671 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-32671?
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-5qjq-69w6-fg57",
  "modified" : "2021-06-07T21:05:48Z",
  "published" : "2021-06-07T21:48:17Z",
  "aliases" : [ "CVE-2021-32671" ],
  "summary" : "XSS vulnerability with translator",
  "details" : "Flarum's translation system allowed for string inputs to be converted into HTML DOM nodes when rendered. This change was made after v0.1.0-beta.16 (our last beta before v1.0.0) and was not noticed or documented.\n\nThis allowed for any user to type malicious HTML markup within certain user input fields and have this execute on client browsers. The example which led to the discovery of this vulnerability was in the forum search box. Entering faux-malicious HTML markup, such as <script>alert('test')</script> resulted in an alert box appearing on the forum. This attack could also be modified to perform AJAX requests on behalf of a user, possibly deleting discussions, modifying their settings or profile, or even modifying settings on the Admin panel if the attack was targetted towards a privileged user.\n\n### Impact\n\nAll Flarum communities that run flarum v1.0.0 or v1.0.1 are impacted.\n\n### Patches\n\nThe vulnerability has been fixed and published as flarum/core v1.0.2. All communities running Flarum v1.0 have to upgrade as soon as possible to v1.0.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\n__None.__\n\n### For more information\n\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, and we will address it promptly.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flarum/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flarum/core/security/advisories/GHSA-5qjq-69w6-fg57"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32671"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/core/commit/440bed81b8019dff00642c8f493b4909d505a28a"
  }, {
    "type" : "WEB",
    "url" : "https://packagist.org/packages/flarum/core"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-06-07T21:05:48Z",
    "nvd_published_at" : "2021-06-07T22:15:00Z"
  }
}