/

CVE-2026-56817

Severity:

CRITICAL RISK

(9.8)

XXE (CWE-611) via XmlDecoder in Netty XML pipeline

CVE-2026-56817

Analyzed

Vulnerability type

Category:

XML External Entity (XXE)

CWE:

CWE-611

Impact:

Information Disclosure and Server-Side Request Forgery

Severity:

CRITICAL RISK

(9.8)

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

Netty's XmlDecoder can expose an XML External Entity (XXE) risk when it uses AsyncXMLInputFactory without hardened security settings, leaving DTD and entity handling enabled.

Any component that can feed XML into such a pipeline and include a DOCTYPE declaration may cause the Aalto XML parser to resolve external entities, potentially leaking data or interacting with internal services.

Netty's XmlDecoder can expose an XML External Entity (XXE) risk when it uses AsyncXMLInputFactory without hardened security settings, leaving DTD and entity handling enabled.

Any component that can feed XML into such a pipeline and include a DOCTYPE declaration may cause the Aalto XML parser to resolve external entities, potentially leaking data or interacting with internal services.

Affected context

This vulnerability arises in Netty-based applications that:

  • Use XmlDecoder in their channel pipeline
  • Instantiate AsyncXMLInputFactory (via Aalto XML) without disabling DTDs or external entities
  • Accept XML input from callers that are not fully trusted or are only partially validated

It is most relevant in server-side pipelines where XML payloads are processed asynchronously and the underlying parser behavior is not explicitly locked down.

This vulnerability arises in Netty-based applications that:

  • Use XmlDecoder in their channel pipeline
  • Instantiate AsyncXMLInputFactory (via Aalto XML) without disabling DTDs or external entities
  • Accept XML input from callers that are not fully trusted or are only partially validated

It is most relevant in server-side pipelines where XML payloads are processed asynchronously and the underlying parser behavior is not explicitly locked down.

Exploit preconditions

  • Attack surface: Any Netty channel pipeline that includes XmlDecoder and processes XML from external or semi-trusted sources.
  • Required access: Ability to send arbitrary XML bytes into the affected pipeline (e.g., over TCP, HTTP, WebSocket, or other protocols using Netty).
  • Trigger point: Submission of XML containing a DOCTYPE declaration with external or parameter entities, which the AsyncXMLInputFactory passes to Aalto with entity resolution active.
  • Why exploitation is possible: The XML factory is instantiated without a security configuration that disables DTDs, external entities, or restricts resolution, allowing the parser to fetch external resources or expose internal data based on entity expansion.
  • Attack surface: Any Netty channel pipeline that includes XmlDecoder and processes XML from external or semi-trusted sources.
  • Required access: Ability to send arbitrary XML bytes into the affected pipeline (e.g., over TCP, HTTP, WebSocket, or other protocols using Netty).
  • Trigger point: Submission of XML containing a DOCTYPE declaration with external or parameter entities, which the AsyncXMLInputFactory passes to Aalto with entity resolution active.
  • Why exploitation is possible: The XML factory is instantiated without a security configuration that disables DTDs, external entities, or restricts resolution, allowing the parser to fetch external resources or expose internal data based on entity expansion.

Why this happens

The root cause is insecure default handling of XML entity resolution when wiring Netty's XmlDecoder to an AsyncXMLInputFactory that does not enforce secure parsing rules.

This maps to CWE-611: Improper Restriction of XML External Entity Reference, because the parser is allowed to process DOCTYPE declarations and external entities from potentially untrusted XML input.

At a design level, the XML processing pipeline implicitly trusts parser defaults instead of explicitly disabling external entities, restricting DTD usage, or enforcing a safe configuration profile for all XML sources.

The root cause is insecure default handling of XML entity resolution when wiring Netty's XmlDecoder to an AsyncXMLInputFactory that does not enforce secure parsing rules.

This maps to CWE-611: Improper Restriction of XML External Entity Reference, because the parser is allowed to process DOCTYPE declarations and external entities from potentially untrusted XML input.

At a design level, the XML processing pipeline implicitly trusts parser defaults instead of explicitly disabling external entities, restricting DTD usage, or enforcing a safe configuration profile for all XML sources.

Potential impact

  • Attackers may exfiltrate sensitive files that the Netty process can read by referencing them in XML entities.
  • Attackers can perform server-side request forgery (SSRF) by forcing the parser to fetch resources from internal network services.
  • Attackers could probe internal infrastructure topology by observing timing or error behavior from entity resolution.
  • Attackers may cause performance degradation or resource exhaustion if large or recursive entities are processed.
  • Attackers may exfiltrate sensitive files that the Netty process can read by referencing them in XML entities.
  • Attackers can perform server-side request forgery (SSRF) by forcing the parser to fetch resources from internal network services.
  • Attackers could probe internal infrastructure topology by observing timing or error behavior from entity resolution.
  • Attackers may cause performance degradation or resource exhaustion if large or recursive entities are processed.

General mitigation guidance

Effective mitigation focuses on hardening XML parsing behavior and reducing trust in incoming XML data:

  • Configure XML factories and parsers to disable DTDs, external entities, and any non-essential entity resolution features by default.
  • Apply strict parser features and limits (e.g., maximum entity expansion, request timeouts, and resource limits) to reduce attack surface.
  • Design Netty pipelines so that components handling XML are only exposed to input that has been validated against a known schema or format.
  • Isolate XML processing from high-privilege contexts and avoid running parsers with access to sensitive file systems or unrestricted internal network connectivity.
  • Favor data formats and parsing libraries that provide secure-by-default configurations when XML features are not required.

Effective mitigation focuses on hardening XML parsing behavior and reducing trust in incoming XML data:

  • Configure XML factories and parsers to disable DTDs, external entities, and any non-essential entity resolution features by default.
  • Apply strict parser features and limits (e.g., maximum entity expansion, request timeouts, and resource limits) to reduce attack surface.
  • Design Netty pipelines so that components handling XML are only exposed to input that has been validated against a known schema or format.
  • Isolate XML processing from high-privilege contexts and avoid running parsers with access to sensitive file systems or unrestricted internal network connectivity.
  • Favor data formats and parsing libraries that provide secure-by-default configurations when XML features are not required.

How teams detect issues like this

XXE-related weaknesses can be surfaced through a combination of code analysis and runtime monitoring:

  • Static analysis rules can flag use of XML parsers, XmlDecoder, or AsyncXMLInputFactory where DTDs and external entities are not explicitly disabled.
  • Manual code review should look for XML factory instantiation with default settings, as well as any use of DOCTYPE handling in Netty pipelines that process untrusted input.
  • Security policy checks in CI/CD can enforce that all XML parsing utilities must follow a central hardened configuration profile.
  • Runtime application security monitoring and penetration tests can attempt XXE payloads to confirm whether external entities are resolved or blocked.
  • Automated dependency and configuration scanners may help identify high-risk XML parsing patterns or insecure defaults within Netty-based services.

XXE-related weaknesses can be surfaced through a combination of code analysis and runtime monitoring:

  • Static analysis rules can flag use of XML parsers, XmlDecoder, or AsyncXMLInputFactory where DTDs and external entities are not explicitly disabled.
  • Manual code review should look for XML factory instantiation with default settings, as well as any use of DOCTYPE handling in Netty pipelines that process untrusted input.
  • Security policy checks in CI/CD can enforce that all XML parsing utilities must follow a central hardened configuration profile.
  • Runtime application security monitoring and penetration tests can attempt XXE payloads to confirm whether external entities are resolved or blocked.
  • Automated dependency and configuration scanners may help identify high-risk XML parsing patterns or insecure defaults within Netty-based services.

Sources

SourceLink
github.comgithub.com/netty/netty/commit/5b68c61f37aa4a3045cba624cbea239655c9003b
github.comgithub.com/netty/netty/commit/bb2ff68a1fb71cb4b0eb9a9e17b66c52aff680c6
github.comgithub.com/netty/netty/releases/tag/netty-4.1.136.Final
github.comgithub.com/netty/netty/releases/tag/netty-4.2.16.Final
github.comgithub.com/netty/netty/security/advisories/GHSA-4qhr-g3c6-fcfx

Frequently asked

questions

Yes. If a remote client can send XML into a Netty pipeline that uses XmlDecoder with an insecurely configured AsyncXMLInputFactory, they may craft DOCTYPE-based XXE payloads that the parser will attempt to resolve.

An attacker only needs the ability to deliver XML bytes to the affected Netty channel pipeline—typically via a network endpoint or protocol handler that passes messages through XmlDecoder without sufficient validation.

The safest pattern is to explicitly configure all XML parsers and factories to disable DTDs and external entity resolution, adopt a standard hardened XML configuration across services, and ensure that Netty pipelines never process untrusted XML with default parser behavior.

Establish secure parsing guidelines for XML and other complex data formats, require use of secure-by-default libraries or configuration wrappers, enforce these standards through code review and automated checks, and minimize exposure of high-privilege runtime environments to untrusted XML content.

Yes. If a remote client can send XML into a Netty pipeline that uses XmlDecoder with an insecurely configured AsyncXMLInputFactory, they may craft DOCTYPE-based XXE payloads that the parser will attempt to resolve.

An attacker only needs the ability to deliver XML bytes to the affected Netty channel pipeline—typically via a network endpoint or protocol handler that passes messages through XmlDecoder without sufficient validation.

The safest pattern is to explicitly configure all XML parsers and factories to disable DTDs and external entity resolution, adopt a standard hardened XML configuration across services, and ensure that Netty pipelines never process untrusted XML with default parser behavior.

Establish secure parsing guidelines for XML and other complex data formats, require use of secure-by-default libraries or configuration wrappers, enforce these standards through code review and automated checks, and minimize exposure of high-privilege runtime environments to untrusted XML content.

Find out what's already
exploitable in your codebase.