GHSA-22m9-m3ww-53h3

Suggest an improvement
Source
https://github.com/advisories/GHSA-22m9-m3ww-53h3
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2023/01/GHSA-22m9-m3ww-53h3/GHSA-22m9-m3ww-53h3.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-22m9-m3ww-53h3
Aliases
  • CVE-2023-22487
Published
2023-01-10T22:19:49Z
Modified
2023-11-08T04:11:36.419074Z
Severity
  • 7.7 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N CVSS Calculator
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.

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, and we will address it promptly.

References

Affected packages

Packagist / flarum/mentions

Package

Name
flarum/mentions
Purl
pkg:composer/flarum/mentions

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.6.3

Affected versions

v0.*

v0.1.0-beta.3
v0.1.0-beta.5
v0.1.0-beta.6
v0.1.0-beta.7
v0.1.0-beta.8
v0.1.0-beta.8.1
v0.1.0-beta.9
v0.1.0-beta.10
v0.1.0-beta.12
v0.1.0-beta.13
v0.1.0-beta.14
v0.1.0-beta.15
v0.1.0-beta.16

v1.*

v1.0.0
v1.1.0
v1.1.1
v1.1.2
v1.1.3
v1.2.0
v1.3.0
v1.3.1
v1.4.0
v1.5.0
v1.6.0
v1.6.1