GHSA-94CC-XJXR-PWVF
Vulnerability from github – Published: 2024-06-25 17:07 – Updated: 2024-06-28 20:00Impact
In DSpace 7.0 through 7.6.1, when an HTML, XML or JavaScript Bitstream is downloaded, the user's browser may execute any embedded JavaScript. If that embedded JavaScript is malicious, there is a risk of an XSS attack.
This attack may only be initialized by a user who already has Submitter privileges in the repository. The submitter must upload the malicious HTML/XML/JavaScript file themselves. The attack itself would not occur until a visitor or logged-in user downloads the file or clicks on a download link shared by the attacker.
If your site is running the frontend and backend from separate domains, CORS and CSRF protection built into DSpace help to limit the impact of the attack.
If the repository is configured to only download HTML / XML / JavaScript Bitstreams using the Content-Disposition: attachment header, then the attack is no longer possible. See "Workarounds" below.
Patches
The fix is included in both 8.0 and 7.6.2. Please upgrade to one of these versions, or manually apply one of the "Workarounds" below.
If you are already running 7.6 or 7.6.1, then this vulnerability can be fixed via a configuration update in your dspace.cfg configuration file. See details in below.
Workarounds
DSpace sites running 7.6 or 7.6.1 can fix this issue by adding the following webui.content_disposition_format settings to their dspace.cfg (or local.cfg). These settings force all HTML, XML, RDF & JavaScript files to always be downloaded to a user's machine, blocking the attack. For more details see PR #9638
webui.content_disposition_format = text/html
webui.content_disposition_format = text/javascript
webui.content_disposition_format = text/xml
webui.content_disposition_format = rdf
These settings will take effect immediately. There is no need to restart Tomcat.
To verify the settings are working: upload an HTML or XML file to an in-progress submission. Attempt to download the file. The file should not open in your browser window. Instead, it should download to your local computer.
DSpace sites running 7.0 through 7.5 will need to either (CHOOSE ONE):
* Upgrade to 7.6.2 or 8.0
* Or, upgrade to 7.6 or 7.6.1 and then apply the configuration change mentioned above
* Or, manually add the webui.content_disposition_format setting (which was first released in 7.6), and then apply the configuration changes mentioned above.
* The webui.content_disposition_format setting can be added by applying the changes in PR #8891. A patch file is also available.
* Please be aware this patch may not apply cleanly to all prior versions of 7.x. In that scenario, you would need to find a way to manually apply the changes or consider a different workaround.
* Or, find a way in your Apache or NGinx proxy to force the Content-Disposition: attachment header to be sent for all files downloaded via /server/api/core/bitstreams/[uuid]/content in the REST API.
* NOTE: This workaround will patch the vulnerability. However, it does so by no longer allowing users to open any downloaded files in their browser window. (This behavior may or may not be desirable in the long term, so you may wish to remove it in the future, once you have upgraded.)
* For example, in Apache, using "mod_headers", you may add a configuration similar to this in your <VirtualHost>:
# Set "Content-Disposition: attachment" whenever path is /server/api/core/bitstreams/[uuid]/content
Header set Content-Disposition attachment "expr=%{REQUEST_URI} =~ m#^/server/api/core/bitstreams/.*/content$#"
References
Discovered and reported by Muhammad Zeeshan (Xib3rR4dAr)
For more information
If you have any questions or comments about this advisory:
- Email us at security@dspace.org
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.dspace:dspace-server-webapp"
},
"ranges": [
{
"events": [
{
"introduced": "7.0"
},
{
"fixed": "7.6.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-38364"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2024-06-25T17:07:32Z",
"nvd_published_at": "2024-06-26T00:15:10Z",
"severity": "LOW"
},
"details": "### Impact\nIn DSpace 7.0 through 7.6.1, when an HTML, XML or JavaScript Bitstream is downloaded, the user\u0027s browser _may_ execute any embedded JavaScript. If that embedded JavaScript is malicious, there is a risk of an XSS attack.\n\nThis attack may only be initialized by a user who already has Submitter privileges in the repository. The submitter must upload the malicious HTML/XML/JavaScript file themselves. The attack itself would not occur until a visitor or logged-in user downloads the file or clicks on a download link shared by the attacker. \n\nIf your site is running the frontend and backend from separate domains, CORS and CSRF protection built into DSpace help to limit the impact of the attack.\n\nIf the repository is configured to only download HTML / XML / JavaScript Bitstreams using the [`Content-Disposition: attachment`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition) header, then the attack is no longer possible. See \"Workarounds\" below.\n\n### Patches\nThe fix is included in both 8.0 and 7.6.2. Please upgrade to one of these versions, or manually apply one of the \"Workarounds\" below.\n\nIf you are already running 7.6 or 7.6.1, then this vulnerability can be fixed via a configuration update in your `dspace.cfg` configuration file. See details in below.\n\n### Workarounds\n\n**DSpace sites running 7.6 or 7.6.1** can fix this issue by adding the following `webui.content_disposition_format` settings to their `dspace.cfg` (or `local.cfg`). These settings force all HTML, XML, RDF \u0026 JavaScript files to always be downloaded to a user\u0027s machine, blocking the attack. For more details see [PR #9638](https://github.com/DSpace/DSpace/pull/9638)\n```\nwebui.content_disposition_format = text/html\nwebui.content_disposition_format = text/javascript\nwebui.content_disposition_format = text/xml\nwebui.content_disposition_format = rdf\n```\nThese settings will take effect immediately. There is no need to restart Tomcat.\n\nTo verify the settings are working: upload an HTML or XML file to an in-progress submission. Attempt to download the file. The file should *not* open in your browser window. Instead, it should download to your local computer.\n\n**DSpace sites running 7.0 through 7.5** will need to **either** (CHOOSE ONE):\n* Upgrade to 7.6.2 or 8.0\n* Or, upgrade to 7.6 or 7.6.1 and then apply the configuration change mentioned above\n* Or, manually add the `webui.content_disposition_format` setting (which was first released in 7.6), and then apply the configuration changes mentioned above.\n * The `webui.content_disposition_format` setting can be added by applying the changes in [PR #8891](https://github.com/DSpace/DSpace/pull/8891). A [`patch` file](https://github.com/DSpace/DSpace/pull/8891.patch) is also available.\n * Please be aware this patch may not apply cleanly to all prior versions of 7.x. In that scenario, you would need to find a way to manually apply the changes or consider a different workaround.\n* Or, find a way in your Apache or NGinx proxy to force the `Content-Disposition: attachment` header to be sent for **all files** downloaded via `/server/api/core/bitstreams/[uuid]/content` in the REST API. \n * NOTE: This workaround will patch the vulnerability. However, it does so by no longer allowing users to open _any_ downloaded files in their browser window. (This behavior may or may not be desirable in the long term, so you may wish to remove it in the future, once you have upgraded.)\n * For example, in Apache, using \"mod_headers\", you may add a configuration similar to this in your `\u003cVirtualHost\u003e`:\n ```\n # Set \"Content-Disposition: attachment\" whenever path is /server/api/core/bitstreams/[uuid]/content\n Header set Content-Disposition attachment \"expr=%{REQUEST_URI} =~ m#^/server/api/core/bitstreams/.*/content$#\"\n ```\n\n### References\n\nDiscovered and reported by Muhammad Zeeshan ([Xib3rR4dAr](https://github.com/Xib3rR4dAr))\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Email us at [security@dspace.org](mailto:security@dspace.org)",
"id": "GHSA-94cc-xjxr-pwvf",
"modified": "2024-06-28T20:00:56Z",
"published": "2024-06-25T17:07:32Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/DSpace/DSpace/security/advisories/GHSA-94cc-xjxr-pwvf"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-38364"
},
{
"type": "WEB",
"url": "https://github.com/DSpace/DSpace/pull/8891"
},
{
"type": "WEB",
"url": "https://github.com/DSpace/DSpace/pull/9638"
},
{
"type": "WEB",
"url": "https://github.com/DSpace/DSpace/commit/f1059b4340857cca3dc4c45b1ebbadce6bb61c0b"
},
{
"type": "PACKAGE",
"url": "https://github.com/DSpace/DSpace"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "DSpace Cross Site Scripting (XSS) via a deposited HTML/XML document"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.