CVE-2022-30999: Fof/upload Cross-Site Scripting Vulnerability
HIGHCVE-2022-30999 is a HIGH (CVSS 8.7) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Fof/upload libraries in the Packagist ecosystem. The issue involves possible cross-site scripting attack via unsanitized svg files in fof upload. Remediation is available by upgrading affected packages to version 1.2.3.
CVE-2022-30999 at a Glance
Security Impact
CVSS: 8.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:R/S:C/C:H/I:H/A:N).
How to Fix CVE-2022-30999
To remediate this vulnerability, upgrade all affected Fof/upload 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 fof/upload to 1.2.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for fof/upload
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-30999, inspect your project dependencies for Fof/upload:
inspect dependencies for fof/upload
Analyze the terminal output to locate any version of Fof/upload in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.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-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 Fof/upload, 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-2022-30999 Affected Fof/upload Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fof/upload
|
Packagist |
< 1.2.3
|
1.2.3
|
References
Frequently Asked Questions
What is CVE-2022-30999?
Which Fof/upload versions are affected?
What version fixes CVE-2022-30999?
Is fof/upload affected?
What is the CVSS score of CVE-2022-30999?
What CWE is associated with CVE-2022-30999?
How can I check Packagist dependencies for CVE-2022-30999?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fm53-mpmp-7qw2",
"modified" : "2022-05-25T22:55:25Z",
"published" : "2022-05-25T22:55:25Z",
"aliases" : [ "CVE-2022-30999" ],
"summary" : "Possible cross-site scripting attack via unsanitized SVG files in FoF Upload",
"details" : "### Impact\nIf FoF Upload is configured to allow the uploading of SVG files (`image/svg+xml`), navigating directly to an SVG file URI could execute arbitrary Javascript code decided by an attacker.\n\nThis Javascript code could include the execution of HTTP web requests to Flarum, or any other web service. This could allow data to be leaked by an authenticated Flarum user, or, possibly, for data to be modified maliciously.\n\n### Patches\nThis has been patched with v1.2.3, which now sanitizes uploaded SVG files.\n\n### Workarounds\nUpgrade to `1.2.3` (requires Flarum 1.2 or later), or remove the ability for users to upload SVG files through FoF Upload.\n\n### References\nThank you to Safwat Refaat for the responsible disclosure of this vulnerability.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "fof/upload"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/FriendsOfFlarum/upload/security/advisories/GHSA-fm53-mpmp-7qw2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-30999"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfFlarum/upload/issues/68"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfFlarum/upload/pull/318"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/FriendsOfFlarum/upload"
}, {
"type" : "WEB",
"url" : "https://github.com/FriendsOfFlarum/upload/releases/tag/1.2.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-25T22:55:25Z",
"nvd_published_at" : "2022-06-02T14:15:00Z"
}
}