CVE-2024-38364: Dspace server webapp Cross-Site Scripting Vulnerability
LOWCVE-2024-38364 is a LOW (CVSS 2.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Dspace server webapp libraries in the Maven ecosystem. The issue involves dspace cross site scripting (xss) via a deposited html/xml document. Remediation is available by upgrading affected packages to version 7.6.2.
CVE-2024-38364 at a Glance
Security Impact
CVSS: 2.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L).
How to Fix CVE-2024-38364
To remediate this vulnerability, upgrade all affected Dspace server webapp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.dspace</groupId>
<artifactId>dspace-server-webapp</artifactId>
<version>7.6.2</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.dspace
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-38364, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.dspace
Analyze the terminal output to locate any version of Dspace server webapp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.6.2), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.dspace command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
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 Dspace server webapp, 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-2024-38364 Affected Dspace server webapp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.dspace:dspace-server-webapp
|
Maven |
≥ 7.0
< 7.6.2
|
7.6.2
|
References
Frequently Asked Questions
What is CVE-2024-38364?
Which Dspace server webapp versions are affected?
What version fixes CVE-2024-38364?
Is dspace-server-webapp affected?
What is the CVSS score of CVE-2024-38364?
What CWE is associated with CVE-2024-38364?
How can I check Maven dependencies for CVE-2024-38364?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-94cc-xjxr-pwvf",
"modified" : "2024-06-28T20:00:56Z",
"published" : "2024-06-25T17:07:32Z",
"aliases" : [ "CVE-2024-38364" ],
"summary" : "DSpace Cross Site Scripting (XSS) via a deposited HTML/XML document",
"details" : "### Impact\nIn 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.\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 & JavaScript files to always be downloaded to a user's 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 `<VirtualHost>`:\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)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.dspace:dspace-server-webapp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0"
}, {
"fixed" : "7.6.2"
} ]
} ]
} ],
"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"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2024-06-25T17:07:32Z",
"nvd_published_at" : "2024-06-26T00:15:10Z"
}
}