GHSA-GC95-3VW8-VG43
Vulnerability from github – Published: 2026-08-17 21:55 – Updated: 2026-08-17 21:55Summary
docx4j's PropertyResolver and several adjacent helpers recursively walk the OpenXML style inheritance chain (w:basedOn) without cycle detection.
A WordprocessingML document containing a cyclic style chain (for example, Style A based on B and Style B based on A) causes unbounded recursion and a java.lang.StackOverflowError within the property-resolution code path.
These helpers are used by operations that require effective style resolution, including common conversion and TOC-related paths. As a result, most server-side pipelines that accept a user-supplied docx and process it through docx4j can likely be crashed by a file containing a cyclic style reference.
Details
Representative snippet: PropertyResolver.fillPPrStack
private void fillPPrStack(String styleId, Stack<PPr> pPrStack) {
Style style = liveStyles.get(styleId);
...
// if it is based on, recurse
if (style.getBasedOn() == null) {
log.debug("Style " + styleId + " is a root style.");
} else if (style.getBasedOn().getVal() != null) {
String basedOnStyleName = style.getBasedOn().getVal();
fillPPrStack(basedOnStyleName, pPrStack); // ← unbounded recursion
...
Impact
This is a denial of service against a server-side application that processes untrusted docx files via docx4j.
An upload causes the processing thread to be terminated with StackOverflowError which may crash the worker thread, degrade the thread pool, or evade normal per-request CPU and heap-memory safeguards in containers and serverless functions (because the failure mode is thread-stack exhaustion rather than gradual resource consumption).
The attack depends on the host application's access controls and requires no user interaction beyond submitting the file. Detection is difficult because the file is a well-formed OOXML package containing ordinary style elements, and passes standard antivirus and content-inspection rules.
Severity: High for server-side applications that process untrusted DOCX files using docx4j style/property resolution (unless the application catches StackOverflowError, isolates conversion in disposable worker processes, restarts workers cleanly, and the practical impact is only failure of one request). Severity may be Medium where document upload requires authentication, processing is isolated, or the failure is limited to a single request/worker.
Credits
Thanks to Koh You Liang (@Isopach) for responsibly disclosing this issue.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 11.5.13"
},
"package": {
"ecosystem": "Maven",
"name": "org.docx4j:docx4j-core"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "11.5.14"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-53752"
],
"database_specific": {
"cwe_ids": [
"CWE-674",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-17T21:55:49Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\ndocx4j\u0027s `PropertyResolver` and several adjacent helpers recursively walk the OpenXML style inheritance chain (`w:basedOn`) without cycle detection. \n\nA WordprocessingML document containing a cyclic style chain (for example, Style A based on B and Style B based on A) causes unbounded recursion and a `java.lang.StackOverflowError` within the property-resolution code path.\n\nThese helpers are used by operations that require effective style resolution, including common conversion and TOC-related paths. As a result, most server-side pipelines that accept a user-supplied docx and process it through docx4j can likely be crashed by a file containing a cyclic style reference.\n\n### Details\n\nRepresentative snippet: `PropertyResolver.fillPPrStack`\n\n```java\nprivate void fillPPrStack(String styleId, Stack\u003cPPr\u003e pPrStack) {\n Style style = liveStyles.get(styleId);\n ...\n // if it is based on, recurse\n if (style.getBasedOn() == null) {\n log.debug(\"Style \" + styleId + \" is a root style.\");\n } else if (style.getBasedOn().getVal() != null) {\n String basedOnStyleName = style.getBasedOn().getVal();\n fillPPrStack(basedOnStyleName, pPrStack); // \u2190 unbounded recursion\n ...\n```\n\n### Impact\nThis is a denial of service against a server-side application that processes untrusted docx files via docx4j. \n\nAn upload causes the processing thread to be terminated with `StackOverflowError` which may crash the worker thread, degrade the thread pool, or evade normal per-request CPU and heap-memory safeguards in containers and serverless functions (because the failure mode is thread-stack exhaustion rather than gradual resource consumption).\n\nThe attack depends on the host application\u0027s access controls and requires no user interaction beyond submitting the file. Detection is difficult because the file is a well-formed OOXML package containing ordinary style elements, and passes standard antivirus and content-inspection rules.\n\nSeverity: High for server-side applications that process untrusted DOCX files using docx4j style/property resolution (unless the application catches StackOverflowError, isolates conversion in disposable worker processes, restarts workers cleanly, and the practical impact is only failure of one request). Severity may be Medium where document upload requires authentication, processing is isolated, or the failure is limited to a single request/worker.\n\n### Credits\nThanks to Koh You Liang ([@Isopach](https://github.com/Isopach)) for responsibly disclosing this issue.",
"id": "GHSA-gc95-3vw8-vg43",
"modified": "2026-08-17T21:55:49Z",
"published": "2026-08-17T21:55:49Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/plutext/docx4j/security/advisories/GHSA-gc95-3vw8-vg43"
},
{
"type": "PACKAGE",
"url": "https://github.com/plutext/docx4j"
},
{
"type": "WEB",
"url": "https://github.com/plutext/docx4j/releases/tag/docx4j-11.5.14"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "docx4j: Stack Overflow via Cyclic `w:basedOn` Style Chain leads to Denial of Service"
}
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.
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.