Skip to content

http4s-scala-xml has an XML External Entity (XXE) processing issue

Critical severity GitHub Reviewed Published Jun 24, 2026 in http4s/http4s-scala-xml • Updated Sep 24, 2026

Package

maven org.http4s:http4s-scala-xml_2.12 (Maven)

Affected versions

<= 0.24.0

Patched versions

0.24.1
maven org.http4s:http4s-scala-xml_2.13 (Maven)
<= 0.24.0
>= 1.0.0-M1, <= 1.0.0-M38.1
0.24.1
1.0.0-M39
maven org.http4s:http4s-scala-xml_3 (Maven)
<= 0.24.0
>= 1.0.0-M1, <= 1.0.0-M38.1
0.24.1
1.0.0-M39

Description

http4s-scala-xml provides EntityDecoder[F, scala.xml.Elem] instances that parse XML message bodies. These decoders used a javax.xml.parsers.SAXParserFactory obtained from SAXParserFactory.newInstance without any security configuration. With the JDK's default settings, the parser resolves DOCTYPE declarations, external general and parameter entities, and external DTDs.

An application that uses these decoders to parse untrusted XML is vulnerable to XML External Entity (XXE) attacks. An attacker can craft a request that:

  • discloses local files readable by the service process,
  • performs server-side request forgery (SSRF) against internal network resources, and/or
  • causes denial of service through entity expansion.

Impact

Any service that derives an XML EntityDecoder from this library and parses attacker-controlled input is affected.

Patches

The default SAXParserFactory is now hardened:

  • secure processing is enabled
  • DOCTYPE declarations are disallowed
  • external general/parameter entities and external DTD loading are disabled
  • DTD URIs are not resolved
  • XInclude is disabled.

These defaults match scala.xml.XMLLoader's defaults since 2.0.0.

Workarounds

Before upgrading, override ElemInstances#saxFactory with a hardened factory.

  val secured = new ElemInstances {
    override protected val saxFactory = {
      val f = javax.xml.parsers.SAXParserFactory.newInstance
      f.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true)
      // etc.
      f
    }
  }
  import secured._

References

@rossabaker rossabaker published to http4s/http4s-scala-xml Jun 24, 2026
Published by the National Vulnerability Database Sep 24, 2026
Published to the GitHub Advisory Database Sep 24, 2026
Reviewed Sep 24, 2026
Last updated Sep 24, 2026

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(20th percentile)

Weaknesses

Improper Restriction of XML External Entity Reference

The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. Learn more on MITRE.

CVE ID

CVE-2026-61741

GHSA ID

GHSA-cjx3-73hr-rpw7

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.