Critical

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

  • Disclosed: 24.09.2026
  • Updated: 11.10.2026 13:20

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.

scala
  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._

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) org.http4s:http4s-scala-xml_2.12 < 0.24.1 0.24.1
Java / Kotlin (Maven) org.http4s:http4s-scala-xml_2.13 < 0.24.1, >= 1.0.0-M1, < 1.0.0-M39 0.24.1, 1.0.0-M39
Java / Kotlin (Maven) org.http4s:http4s-scala-xml_3 < 0.24.1, >= 1.0.0-M1, < 1.0.0-M39 0.24.1, 1.0.0-M39

References

CVSS score 9.3/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L
Weakness (CWE)
CWE-611
Platform
Java / Kotlin (Maven)
Package
org.http4s:http4s-scala-xml_2.12, org.http4s:http4s-scala-xml_2.13, org.http4s:http4s-scala-xml_3
Disclosed
24.09.2026
Updated
11.10.2026 13:20

Sources and licenses

OSV / GitHub Advisory Database - GHSA-cjx3-73hr-rpw7 - CC BY 4.0

Vulnerability history: org.http4s:http4s-scala-xml_3

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.