GHSA-VCVR-V426-3M3M
Vulnerability from github – Published: 2023-10-25 21:08 – Updated: 2023-10-25 21:08Impact
Triggering the office converter with a specially crafted file name allows writing the attachment's content to an attacker-controlled location on the server as long as the Java process has write access to that location. In particular in the combination with attachment moving, a feature introduced in XWiki 14.0, this is easy to reproduce but it also possible to reproduce in versions as old as XWiki 3.5 by uploading the attachment through the REST API which doesn't remove / or \ from the filename. As the mime type of the attachment doesn't matter for the exploitation, this could e.g., be used to replace the jar-file of an extension which would allow executing arbitrary Java code and thus impact the confidentiality, integrity and availability of the XWiki installation. To reproduce the issue on versions since XWiki 14.0, execute the following steps:
- Activate the office server
- Upload an arbitrary file with the extension .doc, e.g., to your user profile (you can use a regular plain text file, only the extension matters).
- Use the attachment move feature to rename the file to ../../../../../tmp/Hello from XWiki.txt where the latter part is the location of a file you want to write on the server. The number of ../ depends on the directory depth, the provided example should work on Linux with the demo distribution.
- Click the "preview" link to trigger the office converter
For information how to reproduce on older versions, see the Jira issue.
To the best of our knowledge, this attack is not possible when the office conversion process doesn't run as the code fails before the file is written.
Patches
This vulnerability has been patched in XWiki 14.10.8 and 15.3RC1.
Workarounds
There are no known workarounds apart from disabling the office converter.
References
- https://jira.xwiki.org/browse/XWIKI-20715
- https://github.com/xwiki/xwiki-platform/commit/45d182a4141ff22f3ff289cf71e4669bdc714544
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.xwiki.platform:xwiki-platform-office-importer"
},
"ranges": [
{
"events": [
{
"introduced": "3.5-milestone-1"
},
{
"fixed": "14.10.8"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.xwiki.platform:xwiki-platform-office-importer"
},
"ranges": [
{
"events": [
{
"introduced": "15.0-rc-1"
},
{
"fixed": "15.3-rc-1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-37913"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2023-10-25T21:08:32Z",
"nvd_published_at": "2023-10-25T18:17:28Z",
"severity": "CRITICAL"
},
"details": "### Impact\n\nTriggering the office converter with a specially crafted file name allows writing the attachment\u0027s content to an attacker-controlled location on the server as long as the Java process has write access to that location. In particular in the combination with attachment moving, a feature introduced in XWiki 14.0, this is easy to reproduce but it also possible to reproduce in versions as old as XWiki 3.5 by uploading the attachment through the REST API which doesn\u0027t remove `/` or `\\` from the filename. As the mime type of the attachment doesn\u0027t matter for the exploitation, this could e.g., be used to replace the `jar`-file of an extension which would allow executing arbitrary Java code and thus impact the confidentiality, integrity and availability of the XWiki installation. To reproduce the issue on versions since XWiki 14.0, execute the following steps:\n\n1. Activate the office server\n2. Upload an arbitrary file with the extension .doc, e.g., to your user profile (you can use a regular plain text file, only the extension matters).\n3. Use the attachment move feature to rename the file to ../../../../../tmp/Hello from XWiki.txt where the latter part is the location of a file you want to write on the server. The number of ../ depends on the directory depth, the provided example should work on Linux with the demo distribution.\n4. Click the \"preview\" link to trigger the office converter\n\nFor information how to reproduce on older versions, see the [Jira issue](https://jira.xwiki.org/browse/XWIKI-20715).\n\nTo the best of our knowledge, this attack is not possible when the office conversion process doesn\u0027t run as the code fails before the file is written.\n\n### Patches\n\nThis vulnerability has been patched in XWiki 14.10.8 and 15.3RC1.\n\n### Workarounds\n\nThere are no known workarounds apart from disabling the office converter.\n\n### References\n\n* https://jira.xwiki.org/browse/XWIKI-20715\n* https://github.com/xwiki/xwiki-platform/commit/45d182a4141ff22f3ff289cf71e4669bdc714544",
"id": "GHSA-vcvr-v426-3m3m",
"modified": "2023-10-25T21:08:32Z",
"published": "2023-10-25T21:08:32Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-vcvr-v426-3m3m"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-37913"
},
{
"type": "WEB",
"url": "https://github.com/xwiki/xwiki-platform/commit/45d182a4141ff22f3ff289cf71e4669bdc714544"
},
{
"type": "PACKAGE",
"url": "https://github.com/xwiki/xwiki-platform"
},
{
"type": "WEB",
"url": "https://jira.xwiki.org/browse/XWIKI-20715"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "org.xwiki.platform:xwiki-platform-office-importer vulnerable to arbitrary server side file writing from account through office converter"
}
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.