xml2json Default Settings Allow External Entities
The xml2json library uses libxmljs as its XML parser which defaults to processing external entities and DTD declarations unless explicitly disabled. Applications use xml2json.toJson(xmlString) or xml2json.toJson(xmlString, {}) without security-specific options, inheriting vulnerable defaults. When parsing untrusted XML containing entity declarations like <!ENTITY xxe SYSTEM "file:///etc/passwd">, the parser resolves these entities, enabling file disclosure, SSRF, or denial of service through entity expansion attacks (billion laughs attack).