CVE-2021-21283 XSS in Flarum Sticky extension.

Medium 5.4 Published Updated

Attackers with pinning or editing privileges can inject malicious scripts into pinned discussions, leading to cross-site scripting attacks.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-21283?

CVE-2021-21283 is a medium-severity cross-site scripting vulnerability in flarum sticky, published on 26 Jan 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

Flarum is an open source discussion platform for websites. The "Flarum Sticky" extension versions 0.1.0-beta.14 and 0.1.0-beta.15 has a cross-site scripting vulnerability. A change in release beta 14 of the Sticky extension caused the plain text content of the first post of a pinned discussion to be injected as HTML on the discussion list. The issue was discovered following an internal audit. Any HTML would be injected through the m.trust() helper. This resulted in an HTML injection where <script> tags would not be executed. However it was possible to run javascript from other HTML attributes, enabling a cross-site scripting (XSS) attack to be performed. Since the exploit only happens with the first post of a pinned discussion, an attacker would need the ability to pin their own discussion, or be able to edit a discussion that was previously pinned. On forums where all pinned posts are authored by your staff, you can be relatively certain the vulnerability has not been exploited. Forums where some user-created discussions were pinned can look at the first post edit date to find whether the vulnerability might have been exploited. Because Flarum doesn't store the post content history, you cannot be certain if a malicious edit was reverted. The fix will be available in version v0.1.0-beta.16 with Flarum beta 16. The fix has already been back-ported to Flarum beta 15 as version v0.1.0-beta.15.1 of the Sticky extension. Forum administrators can disable the Sticky extension until they are able to apply the update. The vulnerability cannot be exploited while the extension is disabled.

Weakness: CWE-79

Which versions are affected by CVE-2021-21283?

2 open source packages ship an affected version, including flarum/sticky. It affects 1 product.

PackageAffectedFixed in
flarum/sticky PackagistFrom 0.1.0-beta.140.1.0-beta.15.1
flarum/sticky PackagistFrom 0.1.0-beta.140.1.0-beta.15.1

Products include Flarum Sticky.

How do I fix CVE-2021-21283?

Upgrade flarum/sticky to 0.1.0-beta.15.1 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2021-21283 being exploited?

There is no known exploitation of CVE-2021-21283 in the wild and no public exploit code.

Sources

Also known as GHSA-h3gg-7wx2-cq3h.

Is CVE-2021-21283 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free