ghsa-52vf-hvv3-98h7
Vulnerability from github
Impact
Users with write rights can insert well-formed content that is not handled well by the parser. For instance, with xwiki/2.1
, inserting a deeply nested group blocks (((( ((( ((( ((( .... ))) ))) ))) )))
(see the generator below to produce a large payload) can lead to the parser throwing a StackOverflowError
.
As a consequence, some pages becomes unusable, including:
- the user index (if the page containing the faulty content is a user page)
- the page index
Note that on the page, the normal UI is completely missing and it is not possible to open the editor directly to revert the change as the stack overflow is already triggered while getting the title of the document. This means that it is quite difficult to remove this content once inserted.
Patches
This has been patched on XWiki 13.10.10, 14.4.6, and 14.9-rc-1.
Workarounds
A temporary solution to avoid Stack Overflow errors is to increase the memory allocated to the stack by using the -Xss
JVM parameter (e.g., -Xss32m
). This should allow the parser to pass and to fix the faulty content.
Note that we did not evaluated the consequence on other aspects of the system (e.g., performances), and should be only be used as a temporary solution.
Also, this does not prevent the issue to occur again with another content.
Consequently, it is strongly advised to upgrade to a version where the issue has been patched.
References
- https://jira.xwiki.org/browse/XWIKI-19838
For more information
If you have any questions or comments about this advisory: - Open an issue in Jira - Email us at Security ML
Payload Generator
The Javascript code below produces 32768 nested group blocks, around the Hello
text.
javascript
let result = "(((\nHello\n)))";
for (let i = 0; i < 15; ++i) {
result = result.replace("Hello", result);
}
console.log(result);
{ "affected": [ { "package": { "ecosystem": "Maven", "name": "org.xwiki.platform:xwiki-platform-rendering-parser" }, "ranges": [ { "events": [ { "introduced": "6.0" }, { "fixed": "13.10.10" } ], "type": "ECOSYSTEM" } ] }, { "package": { "ecosystem": "Maven", "name": "org.xwiki.platform:xwiki-platform-rendering-parser" }, "ranges": [ { "events": [ { "introduced": "14.0" }, { "fixed": "14.4.6" } ], "type": "ECOSYSTEM" } ] }, { "package": { "ecosystem": "Maven", "name": "org.xwiki.platform:xwiki-platform-rendering-parser" }, "ranges": [ { "events": [ { "introduced": "14.5" }, { "fixed": "14.9-rc-1" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2023-26479" ], "database_specific": { "cwe_ids": [ "CWE-755" ], "github_reviewed": true, "github_reviewed_at": "2023-03-03T22:53:35Z", "nvd_published_at": "2023-03-02T18:15:00Z", "severity": "MODERATE" }, "details": "### Impact\nUsers with write rights can insert well-formed content that is not handled well by the parser. For instance, with `xwiki/2.1`, inserting a deeply nested group blocks (`((( ((( ((( ((( .... ))) ))) ))) )))` (see the generator below to produce a large payload) can lead to the parser throwing a `StackOverflowError`.\nAs a consequence, some pages becomes unusable, including:\n- the user index (if the page containing the faulty content is a user page)\n- the page index\n\nNote that on the page, the normal UI is completely missing and it is not possible to open the editor directly to revert the change as the stack overflow is already triggered while getting the title of the document. This means that it is quite difficult to remove this content once inserted.\n\n### Patches\nThis has been patched on XWiki 13.10.10, 14.4.6, and 14.9-rc-1.\n\n### Workarounds\nA temporary solution to avoid Stack Overflow errors is to increase the memory allocated to the stack by using the `-Xss` JVM parameter (e.g., `-Xss32m`). This should allow the parser to pass and to fix the faulty content.\nNote that we did not evaluated the consequence on other aspects of the system (e.g., performances), and should be only be used as a temporary solution.\nAlso, this does not prevent the issue to occur again with another content.\nConsequently, it is strongly advised to upgrade to a version where the issue has been patched.\n\n### References\n- https://jira.xwiki.org/browse/XWIKI-19838\n\n### For more information\nIf you have any questions or comments about this advisory:\n- Open an issue in [Jira](http://jira.xwiki.org/)\n- Email us at [Security ML](mailto:security@xwiki.org)\n\n### Payload Generator\n\nThe Javascript code below produces 32768 nested group blocks, around the `Hello` text.\n\n```javascript\nlet result = \"(((\\nHello\\n)))\";\nfor (let i = 0; i \u003c 15; ++i) {\n result = result.replace(\"Hello\", result);\n}\nconsole.log(result);\n```\n", "id": "GHSA-52vf-hvv3-98h7", "modified": "2023-03-03T22:53:35Z", "published": "2023-03-03T22:53:35Z", "references": [ { "type": "WEB", "url": "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-52vf-hvv3-98h7" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-26479" }, { "type": "WEB", "url": "https://github.com/xwiki/xwiki-platform/commit/e5b82cd98072464196a468b8f7fe6396dce142a7" }, { "type": "PACKAGE", "url": "https://github.com/xwiki/xwiki-platform" }, { "type": "WEB", "url": "https://jira.xwiki.org/browse/XWIKI-19838" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "type": "CVSS_V3" } ], "summary": "xwiki vulnerable to Improper Handling of Exceptional Conditions" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.