CVE-2021-21283: Flarum/sticky Cross-Site Scripting Vulnerability
MODERATECVE-2021-21283 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Flarum/sticky libraries in the Packagist ecosystem. The issue involves xss in flarum sticky extension. Remediation is available by upgrading affected packages to version 0.1.0-beta.15.1.
CVE-2021-21283 at a Glance
How to Fix CVE-2021-21283
To remediate this vulnerability, upgrade all affected Flarum/sticky dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade flarum/sticky to 0.1.0-beta.15.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for flarum/sticky
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-21283, inspect your project dependencies for Flarum/sticky:
inspect dependencies for flarum/sticky
Analyze the terminal output to locate any version of Flarum/sticky in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.0-beta.15.1), 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/sticky, 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
CVE-2021-21283 Affected Flarum/sticky Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
flarum/sticky
|
Packagist |
≥ 0.1.0-beta.14
< 0.1.0-beta.15.1
|
0.1.0-beta.15.1
|
References
Frequently Asked Questions
What is CVE-2021-21283?
Which Flarum/sticky versions are affected?
What version fixes CVE-2021-21283?
Is flarum/sticky affected?
What CWE is associated with CVE-2021-21283?
How can I check Packagist dependencies for CVE-2021-21283?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h3gg-7wx2-cq3h",
"modified" : "2021-01-26T20:41:58Z",
"published" : "2021-01-29T18:13:41Z",
"aliases" : [ "CVE-2021-21283" ],
"summary" : "XSS in Flarum Sticky extension",
"details" : "### Impact\nA 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.\n\nAny HTML would be injected through Mithril's `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.\n\nSince 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.\n\nOn forums where all pinned posts are authored by your staff, you can be relatively certain the vulnerability has not been exploited.\n\nForums 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.\n\n### Patches\nThe 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.\n\n### Workarounds\nForum administrators can disable the Sticky extension until they are able to apply the update. The vulnerability cannot be exploited while the extension is disabled.\n\n### References\n\n- [Release announcement](https://discuss.flarum.org/d/26042-security-update-to-flarum-sticky-010-beta151)\n- [Pull Request](https://github.com/flarum/sticky/pull/24)\n\n### For more information\nIf you have any questions or comments about this advisory, please start a new discussion on our [support forum](https://discuss.flarum.org/t/support).\n\nIf you discover a security vulnerability within Flarum, please send an e-mail to [security@flarum.org](mailto:security@flarum.org). All security vulnerabilities will be promptly addressed. More details can be found in our [security policy](https://github.com/flarum/core/security/policy).",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "flarum/sticky"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.1.0-beta.14"
}, {
"fixed" : "0.1.0-beta.15.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.1.0-beta.15"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/flarum/sticky/security/advisories/GHSA-h3gg-7wx2-cq3h"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21283"
}, {
"type" : "WEB",
"url" : "https://github.com/flarum/sticky/pull/24"
}, {
"type" : "WEB",
"url" : "https://github.com/flarum/sticky/commit/7ebd30462bd405c4c0570b93a6d48710e6c3db19"
}, {
"type" : "WEB",
"url" : "https://discuss.flarum.org/d/26042-security-update-to-flarum-sticky-010-beta151)"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-01-26T20:41:58Z",
"nvd_published_at" : "2021-01-26T21:15:00Z"
}
}