GHSA-C2J7-66M3-R4FF
Vulnerability from github – Published: 2022-08-06 05:39 – Updated: 2022-08-06 05:39Impact
When an "Internal System Error" occurs in the JSPUI, then entire exception (including stack trace) is available. Information in this stacktrace may be useful to an attacker in launching a more sophisticated attack. This vulnerability only impacts the JSPUI.
This vulnerability does NOT impact the XMLUI or 7.x.
Patches
DSpace 6.x: * Fixed in 6.4 via commit: https://github.com/DSpace/DSpace/commit/afcc6c3389729b85d5c7b0230cbf9aaf7452f31a * 6.x patch file: https://github.com/DSpace/DSpace/commit/afcc6c3389729b85d5c7b0230cbf9aaf7452f31a.patch (may be applied manually if an immediate upgrade to 6.4 or above is not possible)
DSpace 5.x:
* The 6.x patch file can also be applied to an older 5.x installation.
* Alternatively, you can simply apply the workaround documented below. The detailed error information embedded in internal.jsp is not necessary for the JSPUI to function.
Apply the patch to your DSpace
If at all possible, we recommend upgrading your DSpace site based on the upgrade instructions. However, if you are unable to do so, you can manually apply the above patches as follows:
1. Download the appropriate patch file to the machine where DSpace is running
2. From the [dspace-src] folder, apply the patch, e.g. git apply [name-of-file].patch
3. Now, update your DSpace site (based loosely on the Upgrade instructions). This generally involves three steps:
1. Rebuild DSpace, e.g. mvn -U clean package (This will recompile all DSpace code)
2. Redeploy DSpace, e.g. ant update (This will copy all updated WARs / configs to your installation directory). Depending on your setup you also may need to copy the updated WARs over to your Tomcat webapps folder.
3. Restart Tomcat
Workarounds
The detailed error information embedded in internal.jsp is not necessary for the JSPUI to function. Because this error information is also available in the dspace.log files, it does not need to be displayed in internal.jsp.
Modify your internal.jsp, and disable the display of the error message. This is most easily done by setting the returned exception to "null" at all times. For example, add a new line between line number 43 and 44
// This line should exist around line number 43
Throwable ex = (Throwable) request.getAttribute("javax.servlet.error.exception");
// Add workaround for security issue. Ensure exception is always set to null.
ex = null;
// This line should exist around line number 44
if(ex == null) out.println("No stack trace available<br/>");
References
Discovered & reported by Ozkan Erdogan (Brunel University London)
For more information
If you have any questions or comments about this advisory: * Email us at security@dspace.org
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 6.3"
},
"package": {
"ecosystem": "Maven",
"name": "org.dspace:dspace-jspui"
},
"ranges": [
{
"events": [
{
"introduced": "4.0"
},
{
"fixed": "6.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-31189"
],
"database_specific": {
"cwe_ids": [
"CWE-209"
],
"github_reviewed": true,
"github_reviewed_at": "2022-08-06T05:39:46Z",
"nvd_published_at": "2022-08-01T21:15:00Z",
"severity": "MODERATE"
},
"details": "### Impact\nWhen an \"Internal System Error\" occurs in the JSPUI, then entire exception (including stack trace) is available. Information in this stacktrace may be useful to an attacker in launching a more sophisticated attack. This vulnerability only impacts the JSPUI.\n\n_This vulnerability does NOT impact the XMLUI or 7.x._\n\n### Patches\n\n_DSpace 6.x:_\n* Fixed in 6.4 via commit: https://github.com/DSpace/DSpace/commit/afcc6c3389729b85d5c7b0230cbf9aaf7452f31a\n* 6.x patch file: https://github.com/DSpace/DSpace/commit/afcc6c3389729b85d5c7b0230cbf9aaf7452f31a.patch (may be applied manually if an immediate upgrade to 6.4 or above is not possible)\n\n_DSpace 5.x:_\n* The 6.x patch file can also be applied to an older 5.x installation.\n* Alternatively, you can simply apply the workaround documented below. The detailed error information embedded in `internal.jsp` is not necessary for the JSPUI to function.\n\n#### Apply the patch to your DSpace\nIf at all possible, we recommend upgrading your DSpace site based on the upgrade instructions. However, if you are unable to do so, you can manually apply the above patches as follows:\n1. Download the appropriate patch file to the machine where DSpace is running\n2. From the `[dspace-src]` folder, apply the patch, e.g. `git apply [name-of-file].patch`\n3. Now, update your DSpace site (based loosely on the Upgrade instructions). This generally involves three steps:\n 1. Rebuild DSpace, e.g. `mvn -U clean package` (This will recompile all DSpace code)\n 2. Redeploy DSpace, e.g. `ant update` (This will copy all updated WARs / configs to your installation directory). Depending on your setup you also may need to copy the updated WARs over to your Tomcat webapps folder.\n 3. Restart Tomcat\n\n### Workarounds\n\nThe detailed error information embedded in `internal.jsp` is not necessary for the JSPUI to function. Because this error information is also available in the `dspace.log` files, it does not need to be displayed in `internal.jsp`.\n\nModify your `internal.jsp`, and disable the display of the error message. This is most easily done by setting the returned exception to \"null\" at all times. For example, add a new line between line number 43 and 44\n\n```\n// This line should exist around line number 43\nThrowable ex = (Throwable) request.getAttribute(\"javax.servlet.error.exception\");\n// Add workaround for security issue. Ensure exception is always set to null.\nex = null;\n// This line should exist around line number 44\nif(ex == null) out.println(\"No stack trace available\u003cbr/\u003e\");\n```\n\n### References\nDiscovered \u0026 reported by Ozkan Erdogan (Brunel University London)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at security@dspace.org",
"id": "GHSA-c2j7-66m3-r4ff",
"modified": "2022-08-06T05:39:46Z",
"published": "2022-08-06T05:39:46Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/DSpace/DSpace/security/advisories/GHSA-c2j7-66m3-r4ff"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-31189"
},
{
"type": "WEB",
"url": "https://github.com/DSpace/DSpace/commit/afcc6c3389729b85d5c7b0230cbf9aaf7452f31a"
},
{
"type": "PACKAGE",
"url": "https://github.com/DSpace/DSpace"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "JSPUI\u0027s \"Internal System Error\" page prints exceptions and stack traces without sanitization"
}
Sightings
| Author | Source | Type | Date |
|---|
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.