NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Maven

CVE-2026-61741: http4s-scala-xml has an XML External Entity (XXE) processing issue

criticalCVSS 3.1 9.3GHSA-cjx3-73hr-rpw7

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.

Published Sep 24, 2026

Affected packages

org.http4s:http4s-scala-xml_2.12

Ecosystem
Maven
Affected
<= 0.24.0
Fixed in
0.24.1
Check
mvn dependency:tree -Dincludes=org.http4s:http4s-scala-xml_2.12

org.http4s:http4s-scala-xml_2.13

Ecosystem
Maven
Affected
<= 0.24.0
Fixed in
0.24.1
Check
mvn dependency:tree -Dincludes=org.http4s:http4s-scala-xml_2.13

org.http4s:http4s-scala-xml_2.13

Ecosystem
Maven
Affected
>= 1.0.0-M1, <= 1.0.0-M38.1
Fixed in
1.0.0-M39
Check
mvn dependency:tree -Dincludes=org.http4s:http4s-scala-xml_2.13

org.http4s:http4s-scala-xml_3

Ecosystem
Maven
Affected
<= 0.24.0
Fixed in
0.24.1
Check
mvn dependency:tree -Dincludes=org.http4s:http4s-scala-xml_3

org.http4s:http4s-scala-xml_3

Ecosystem
Maven
Affected
>= 1.0.0-M1, <= 1.0.0-M38.1
Fixed in
1.0.0-M39
Check
mvn dependency:tree -Dincludes=org.http4s:http4s-scala-xml_3

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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

Credited to rossabaker, samspills.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology