CVE-2026-61741
http4s-scala-xml has an XML External Entity (XXE) processing issue
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
DOCTYPEdeclarations 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._
Affected Maven artifacts (3)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.http4s » http4s-scala-xml_2.12 | < 0.24.1 | 0.24.1 |
| 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 |
| org.http4s » http4s-scala-xml_3 | < 0.24.1>= 1.0.0-M1, < 1.0.0-M39 | 0.24.1, 1.0.0-M39 |
Blast radius
95% of the dependent artifacts (19) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 1,394 |
| 2 hops | 4 |
Most used dependents
- org.quasar-analytics » quasar-s32 usages
- com.meltwater.fawn » auth2 usages
- com.slamdata » quasar-s31 usages
- moe.pizza » eveapi1 usages
- org.quasar-analytics » quasar-azure1 usages
- edu.gemini » observe_server1 usages
- com.ovoenergy.comms » comms-aws-s30 usages
- com.slamdata » quasar-datasource-s30 usages
- edu.gemini » gsp-core-ocs20 usages
- org.aws4s » aws4s0 usages
- org.quasar-analytics » quasar-s3-it0 usages
- io.github.d2a4u » sqs4s-native0 usages
- com.azavea.geotrellis » geotrellis-server-stac-example0 usages
- com.meltwater.fawn » sqs0 usages
- org.quasar-analytics » quasar-azure-it0 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2026-61741 | nvd.nist.gov |
| Package | http4s/http4s-scala-xml | github.com |
| Web | http4s/http4s-scala-xml advisory GHSA-cjx3-73hr-rpw7 | github.com |
| Web | http4s/http4s-scala-xml commit 326f965 | github.com |
| Web | http4s/http4s-scala-xml release v0.24.1 | github.com |
| Web | http4s/http4s-scala-xml release v1.0.0-M39 | github.com |
