/

CVE-2026-61741

Severity:

CRITICAL RISK

(9.3)

XXE (CWE-611) in http4s-scala-xml XML Message Decoders

CVE-2026-61741

Deferred

Vulnerability type

Category:

XML External Entity (XXE)

CWE:

CWE-611

Impact:

Sensitive Data Exposure, Server-Side Request Forgery, and Denial of Service

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

http4s-scala-xml XML entity decoders use a SAX parser without disabling external entities, DTD processing, or related XML features. When an application parses untrusted XML requests, an attacker may read local files, access internal services through SSRF, or trigger denial of service through entity expansion.

Affected context

The vulnerability occurs in applications that use http4s-scala-xml EntityDecoder[F, scala.xml.Elem] instances to process XML message bodies. Risk is present when request content can be influenced by untrusted clients and the underlying SAX parser retains default behavior that permits DOCTYPE declarations, external general entities, parameter entities, or external DTD resolution.

Exploit preconditions

  • Attack surface: HTTP or other application endpoints that accept XML request bodies
  • Required access: The ability to send or influence an XML message parsed by the affected decoder
  • Trigger point: SAX-based XML parsing of the request body
  • Why exploitation is possible: Parser security features are not explicitly configured, allowing attacker-controlled XML declarations and external entity references to be resolved

Why this happens

The underlying bug is insecure XML parser configuration. A SAX parser factory is created without explicitly disabling external entity resolution, DTD loading, and related features, causing parser behavior to depend on permissive platform defaults.

This maps to CWE-611: Improper Restriction of XML External Entity Reference, where XML input can cause the parser to retrieve or expand attacker-specified external resources. The insecure pattern is applying a general-purpose XML parser to untrusted input without a deny-by-default security configuration.

Potential impact

  • Local files readable by the service process may be disclosed
  • The service may be used to make requests to internal or otherwise restricted network resources
  • Entity expansion may consume excessive memory or CPU and cause denial of service
  • Sensitive credentials, metadata, or service responses may be exposed
  • Downstream systems could be affected by forged or replayed parser-generated requests

General mitigation guidance

Mitigation generally focuses on making XML parsing secure by default and reducing trust in request content.

Common defensive patterns include:

  • Disable external general entities, parameter entities, external DTD loading, and DOCTYPE processing
  • Use a hardened, allowlisted XML parser configuration for untrusted input
  • Apply strict XML size, nesting, and processing limits
  • Validate parsed content against an appropriate schema without treating validation as a substitute for parser hardening
  • Restrict outbound network access from services that process XML
  • Run the service with least-privilege filesystem and network permissions
  • Prefer simpler data formats or constrained XML parsers where XML features are not required

How teams detect issues like this

Organizations can identify this issue through:

  • Static analysis rules that flag default SAXParserFactory creation for untrusted XML
  • Code review checks for missing settings that disable external entities, DTDs, and external schema access
  • Dependency and configuration reviews of XML decoder implementations
  • Dynamic tests that submit XML containing external entity and DTD constructs in isolated environments
  • Runtime monitoring for unexpected outbound requests or access to sensitive local paths during XML parsing
  • Policy enforcement requiring hardened XML parser factories and bounded parser resource usage

Automated security review tools may help detect unsafe XML parser configuration when supported by language- and framework-aware rules.

Sources

SourceLink
github.comgithub.com/http4s/http4s-scala-xml/security/advisories/GHSA-cjx3-73hr-rpw7

Frequently asked

questions

It can be remotely exploitable when an application exposes an endpoint that accepts attacker-controlled XML and passes it to the affected decoder. Exploitability depends on the endpoint's exposure and the parser's network and filesystem permissions.

The attacker generally needs the ability to submit an XML message that reaches the vulnerable decoding path. No local operating-system access is inherently required.

Use a deny-by-default XML parser configuration that rejects or disables DOCTYPE declarations, external entities, external DTDs, and external resource retrieval, while enforcing resource limits.

Treat all XML received from outside the trust boundary as hostile, standardize hardened parser settings, restrict service privileges and egress, and include XXE-focused tests and policy checks in the development pipeline.

Find out what's already
exploitable in your codebase.