CVE-2026-119443: XML Scan Untrusted DTD Which May Result in out of Memory Crash

Published Nov 24, 2026
·
Updated

Summary

Improper Restriction of XML External Entity Reference vulnerability in xmerlscan in Erlang OTP xmerl allows an attacker to exhaust the memory of the Erlang VM via an XML document that names an external DTD.

With default options, xmerlscan:string/1,2 and xmerlscan:file/1,2 fetch and parse the external DTD named in a <!DOCTYPE root SYSTEM "..."> declaration. fetchDTD/2 in lib/xmerl/src/xmerlscan.erl passes every system identifier to the default fetch function, which maps file: and absolute URIs to local paths, and intfiledecl/3 then reads the whole file with file:readfile/1. This happens whether or not validation is enabled, and the allowentities option, which is false by default since OTP 27, only governs <!ENTITY> declarations and does not stop the fetch. A document naming file:///dev/zero makes the node read without bound until the operating system kills it for lack of memory, and the parse never returns.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to xmerl from 1.3.7 before 2.1.3.4, 2.1.9.1, and 2.2.1. Whether OTP before OTP 17.0, corresponding to xmerl before 1.3.7, is affected is unknown.

Details

1. DOCTYPE handling. scandoctype2/3 and scandoctype3/3 in lib/xmerl/src/xmerlscan.erl call fetchDTD/2 once the <!DOCTYPE> declaration ends. fetchDTD/2 has no clause that skips the fetch when validation is off (that clause is commented out), so every system identifier reaches fetchandparse/3.

2. Default fetch. fetchandparse/3 calls the scanner's fetchfun, which defaults to fetch/2. Its helper fetchURI/2 treats the identifier as a filename: a file: URI or an absolute path resolves to that local path, and a relative name resolves against xmlbase. Only http: identifiers are left unread.

3. Unbounded read. The returned {file, Path} goes to intfiledecl/3, which calls file:readfile/1 on the path and converts the result to a list. file:readfile/1 reads until end of file, so a device such as /dev/zero never returns and the binary heap grows until the operating system kills the VM. The allowentities default of false does not help: it only rejects <!ENTITY> declarations in scanmarkupdecl/2, which runs after the file has been read.

Proof of concept

1. Build an XML document whose DOCTYPE names an unbounded local resource, for example <?xml version="1.0"?><!DOCTYPE root SYSTEM "file:///dev/zero"><root/>. 2. Parse it with xmerlscan:string/1 with default options on a Unix host. 3. The call never returns. The reporter observed binary memory reaching 8, 16, 32 and 64 GB within five seconds on OTP 29.1.2, after which the node was killed for lack of memory.

Impact

An attacker who can supply an XML document to an application that parses it with xmerlscan using default options makes the node read an unbounded local resource such as /dev/zero. The read exhausts memory and takes the node down for every user of the application.

Workarounds

Pass a fetchfun that refuses external resources in the option list of xmerlscan:string/2 or xmerlscan:file/2, for example {fetchfun, fun(ExtSpec, State) -> {ok, notfetched, State} end}. The scanner then continues without reading or parsing the external DTD.

Other sources

Improper Restriction of XML External Entity Reference vulnerability in xmerlscan in Erlang OTP xmerl allows an attacker to exhaust the memory of the Erlang VM via an XML document that names an external DTD.

With default options, xmerlscan:string/1,2 and xmerlscan:file/1,2 fetch and parse the external DTD named in a <!DOCTYPE root SYSTEM "..."> declaration. fetchDTD/2 in lib/xmerl/src/xmerlscan.erl passes every system identifier to the default fetch function, which maps file: and absolute URIs to local paths, and intfiledecl/3 then reads the whole file with file:readfile/1. This happens whether or not validation is enabled, and the allowentities option, which is false by default since OTP 27, only governs <!ENTITY> declarations and does not stop the fetch. A document naming file:///dev/zero makes the node read without bound until the operating system kills it for lack of memory, and the parse never returns.

This issue affects OTP from OTP 17.0 before OTP 27.3.4.20, OTP 28.5.0.9, and OTP 29.1.3, corresponding to xmerl from 1.3.7 before 2.1.3.4, 2.1.9.1, and 2.2.1. Whether OTP before OTP 17.0, corresponding to xmerl before 1.3.7, is affected is unknown.

— MITRE

Affected Software

1 affected component
Erlang/OTP xmerl>=1.3.7<2.1.3.4, >=1.3.7<2.1.9.1, >=1.3.7<2.2.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/otp to a version that resolves this vulnerability.

    Fixed in 27.3.4.20
  2. Upgrade

    Upgrade erlang/otp to a version that resolves this vulnerability.

    Fixed in 28.5.0.9
  3. Upgrade

    Upgrade erlang/otp to a version that resolves this vulnerability.

    Fixed in 29.1.3
  4. Configuration

    Pass this fetch_fun option to xmerl_scan:string/2 or xmerl_scan:file/2 to refuse external resources.

    xmerl_scan fetch_fun = {fetch_fun, fun(_ExtSpec, State) -> {ok, not_fetched, State} end}

Event History

Nov 24, 2026
CVE Published
via MITRE·03:02 PM
Data Sourced
via MITRE·03:02 PM
DescriptionWeakness
Data Sourced
via OSV·03:02 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications are exposed if they pass attacker-controlled XML to xmerl_scan:string/1,2 or xmerl_scan:file/1,2 on affected OTP releases. The XML need only contain a DOCTYPE declaration naming an external DTD; validation does not need to be enabled.

2

Does the default allow_entities setting prevent exploitation?

No. Although allow_entities is false by default since OTP 27, it controls ENTITY declarations rather than external DTD retrieval. xmerl_scan still fetches and parses the DTD named by the document's system identifier.

3

What does an attacker need to cause the denial of service?

An attacker needs a way to supply XML that reaches the affected xmerl_scan functions. A document that names file:///dev/zero as its external DTD can cause unbounded reads until the operating system terminates the Erlang node for memory exhaustion.

4

Which releases contain fixes?

Fixed OTP releases are 27.3.4.20, 28.5.0.9, and 29.1.3. The corresponding fixed xmerl releases are 2.1.3.4, 2.1.9.1, and 2.2.1; affected versions begin with OTP 17.0 and xmerl 1.3.7.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203