CVE-2019-15160: Sweet xml Inline DTD Allows XML Bomb Vulnerability

HIGH
Advisory Identifier: GHSA-qpmc-wprv-x746
CVSS 7.5
CWE-776 CWE-611
Published
Advisory Summary

CVE-2019-15160 is a HIGH (CVSS 7.5) inline dtd allows xml bomb vulnerability (CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')) affecting Sweet xml libraries in the Hex ecosystem. The issue involves inline dtd allows xml bomb attack. Remediation is available by upgrading affected packages to version 0.7.0.

CVE-2019-15160 at a Glance

CVE Identifier CVE-2019-15160
GHSA Identifier GHSA-qpmc-wprv-x746
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion')
Affected Product Sweet xml
Package Ecosystem Hex
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2019-15160

To remediate this vulnerability, upgrade all affected Sweet xml dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sweet_xml fixed: 0.7.0
Upgrade sweet_xml to 0.7.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for sweet_xml

How to Check if You Are Affected

To determine whether your application is affected by CVE-2019-15160, inspect your project dependencies for Sweet xml:

inspect dependencies for sweet_xml

Analyze the terminal output to locate any version of Sweet xml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.7.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

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 Sweet xml, 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

The SweetXml (aka sweet_xml) package through 0.6.6 for Erlang and Elixir allows attackers to cause a denial of service (resource consumption) via an XML entity expansion attack with an inline DTD.

CVE-2019-15160 Affected Sweet xml Versions

1 component(s)
Fixed Versions:
0.7.0
Product / Package Ecosystem Affected Versions Fixed Version
sweet_xml
Hex
< 0.7.0
0.7.0

References

Frequently Asked Questions

What is CVE-2019-15160?
CVE-2019-15160 is a security vulnerability in Sweet xml involving Inline DTD allows XML bomb attack under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion').
Which Sweet xml versions are affected?
Affected versions include releases prior to 0.7.0 across affected packages: sweet_xml.
What version fixes CVE-2019-15160?
Upgrading to 0.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sweet_xml affected?
Yes, sweet_xml is affected in releases prior to 0.7.0. Upgrade your dependency to 0.7.0 or later.
What is the CVSS score of CVE-2019-15160?
CVE-2019-15160 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2019-15160?
CVE-2019-15160 is classified under CWE-776: Improper Restriction of Recursive Entity References in DTDs ('XML Entity Expansion') (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.).
How can I check Hex dependencies for CVE-2019-15160?
Run the dependency tree command: 'inspect dependencies for sweet_xml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qpmc-wprv-x746",
  "modified" : "2022-04-12T21:31:26Z",
  "published" : "2022-04-12T21:31:26Z",
  "aliases" : [ "CVE-2019-15160" ],
  "summary" : "Inline DTD allows XML bomb attack",
  "details" : "The SweetXml (aka sweet_xml) package through 0.6.6 for Erlang and Elixir allows attackers to cause a denial of service (resource consumption) via an XML entity expansion attack with an inline DTD.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Hex",
      "name" : "sweet_xml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.7.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-15160"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kbrw/sweet_xml/issues/71"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kbrw/sweet_xml"
  }, {
    "type" : "WEB",
    "url" : "https://hex.pm/packages/sweet_xml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611", "CWE-776" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-12T21:31:26Z",
    "nvd_published_at" : null
  }
}