CVE-2023-22487: Flarum/mentions Flarum Post Mentions Can Be Vulnerability

HIGH
Advisory Identifier: GHSA-22m9-m3ww-53h3
CVSS 7.7
CWE-284
Published
Advisory Summary

CVE-2023-22487 is a HIGH (CVSS 7.7) flarum post mentions can be vulnerability (CWE-284: Improper Access Control) affecting Flarum/mentions libraries in the Packagist ecosystem. The issue involves flarum post mentions can be used to read any post on the forum without access control. Remediation is available by upgrading affected packages to version 1.6.3.

CVE-2023-22487 at a Glance

CVE Identifier CVE-2023-22487
GHSA Identifier GHSA-22m9-m3ww-53h3
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-284: Improper Access Control
Affected Product Flarum/mentions
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.7

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

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

How to Fix CVE-2023-22487

To remediate this vulnerability, upgrade all affected Flarum/mentions 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/mentions fixed: 1.6.3
Upgrade flarum/mentions to 1.6.3
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/mentions

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-22487, inspect your project dependencies for Flarum/mentions:

inspect dependencies for flarum/mentions

Analyze the terminal output to locate any version of Flarum/mentions in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.3), 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Flarum/mentions, 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

Using the mentions feature provided by the flarum/mentions extension, users can mention any post ID on the forum with the special `@"<username>"#p<id>` syntax. The following behavior never changes no matter if the actor should be able to read the mentioned post or not: A URL to the mentioned post is inserted into the actor post HTML, leaking its discussion ID and post number. The `mentionsPosts` relationship included in the `POST /api/posts` and `PATCH /api/posts/<id>` JSON responses leaks the full JSON:API payload of all mentioned posts without any access control. This includes the content, date, number and attributes added by other extensions. An attacker only needs the ability to create new posts on the forum to exploit the vulnerability. This works even if new posts require approval. If they have the ability to edit posts, the attack can be performed even more discreetly by using a single post to scan any size of database and hiding the attack post content afterward. ### Impact The attack allows the leaking of all posts in the forum database, including posts awaiting approval, posts in tags the user has no access to, and private discussions created by other extensions like FriendsOfFlarum Byobu. This also includes non-comment posts like tag changes or renaming events. The discussion payload is not leaked but using the mention HTML payload it's possible to extract the discussion ID of all posts and combine all posts back together into their original discussions even if the discussion title remains unknown. All Flarum versions prior to `v1.6.3` are affected. ### Patches The vulnerability has been fixed and published as flarum/core v1.6.3. All communities running Flarum have to upgrade as soon as possible to v1.6.3 using: ``` composer update --prefer-dist --no-dev -a -W ``` You can then confirm you run the latest version using: ``` composer show flarum/core ``` ### Workarounds Disable the mentions extension. ### For more information For any questions or comments on this vulnerability please visit https://discuss.flarum.org/ 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-2023-22487 Affected Flarum/mentions Versions

1 component(s)
Fixed Versions:
1.6.3
Product / Package Ecosystem Affected Versions Fixed Version
flarum/mentions
Packagist
< 1.6.3
1.6.3

References

Frequently Asked Questions

What is CVE-2023-22487?
CVE-2023-22487 is a security vulnerability in Flarum/mentions involving Flarum post mentions can be used to read any post on the forum without access control under CWE-284: Improper Access Control.
Which Flarum/mentions versions are affected?
Affected versions include releases prior to 1.6.3 across affected packages: flarum/mentions.
What version fixes CVE-2023-22487?
Upgrading to 1.6.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flarum/mentions affected?
Yes, flarum/mentions is affected in releases prior to 1.6.3. Upgrade your dependency to 1.6.3 or later.
What is the CVSS score of CVE-2023-22487?
CVE-2023-22487 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2023-22487?
CVE-2023-22487 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check Packagist dependencies for CVE-2023-22487?
Run the dependency tree command: 'inspect dependencies for flarum/mentions'. 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-22m9-m3ww-53h3",
  "modified" : "2023-01-19T21:31:41Z",
  "published" : "2023-01-10T22:19:49Z",
  "aliases" : [ "CVE-2023-22487" ],
  "summary" : "Flarum post mentions can be used to read any post on the forum without access control",
  "details" : "Using the mentions feature provided by the flarum/mentions extension, users can mention any post ID on the forum with the special `@\"<username>\"#p<id>` syntax.\n\nThe following behavior never changes no matter if the actor should be able to read the mentioned post or not:\n\nA URL to the mentioned post is inserted into the actor post HTML, leaking its discussion ID and post number.\n\nThe `mentionsPosts` relationship included in the `POST /api/posts` and `PATCH /api/posts/<id>` JSON responses leaks the full JSON:API payload of all mentioned posts without any access control. This includes the content, date, number and attributes added by other extensions.\n\nAn attacker only needs the ability to create new posts on the forum to exploit the vulnerability. This works even if new posts require approval. If they have the ability to edit posts, the attack can be performed even more discreetly by using a single post to scan any size of database and hiding the attack post content afterward.\n\n### Impact\nThe attack allows the leaking of all posts in the forum database, including posts awaiting approval, posts in tags the user has no access to, and private discussions created by other extensions like FriendsOfFlarum Byobu. This also includes non-comment posts like tag changes or renaming events. \n\nThe discussion payload is not leaked but using the mention HTML payload it's possible to extract the discussion ID of all posts and combine all posts back together into their original discussions even if the discussion title remains unknown.\n\nAll Flarum versions prior to `v1.6.3` are affected.\n\n### Patches\nThe vulnerability has been fixed and published as flarum/core v1.6.3. All communities running Flarum have to upgrade as soon as possible to v1.6.3 using:\n\n```\ncomposer update --prefer-dist --no-dev -a -W\n```\nYou can then confirm you run the latest version using:\n\n```\ncomposer show flarum/core\n```\n\n### Workarounds\nDisable the mentions extension.\n\n### For more information\nFor any questions or comments on this vulnerability please visit https://discuss.flarum.org/\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:N/S:C/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "flarum/mentions"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.6.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/security/advisories/GHSA-22m9-m3ww-53h3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22487"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/commit/ab1c868b978e8b0d09a5d682c54665dae17d0985"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flarum/framework"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flarum/framework/releases/tag/v1.6.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-10T22:19:49Z",
    "nvd_published_at" : "2023-01-11T20:15:00Z"
  }
}