unstale

npm / fast-xml-parser

fast-xml-parser

What changed in fast-xml-parser 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

25 breaking16 security2 deprecations13 new APIs and options6 performance7 behavior and defaults1 tooling18 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

fast-xml-parser 556 changes

Breaking changes 8

  • Uint8Array XML input is decoded as UTF-8.

    5.11.2release notes

  • DOCTYPE entity names and notation names are validated using qname for backward compatibility; validation also considers xml-version, which defaults to '1.0'.

    5.8.0release notes

  • Entity values can no longer be used to form another entity name; entity scanning is single-pass.

    5.7.1release notes

  • Adding a numeric external entity is no longer allowed.

    5.7.1release notes

  • Error messages for entities might have changed.

    5.6.0release notes

  • Callbacks receive a readonly matcher instance, preventing accidental push or pop calls.

    5.5.9release notes

  • XMLBuilder is split into the fast-xml-builder package; import it from that package instead of fast-xml-parser.

    5.4.0release notes

  • X2jOptions is no longer exported at its declaration site, so developers can no longer import it from that export.

    5.3.7release notes

Security 16

  • fast-xml-parser: Quadratic CPU consumption scanning unterminated stop-node tags

    5.12.0security advisory

  • fast-xml-parser: Repeated DOCTYPE declarations reset entity expansion limits

    5.10.1security advisory

  • Unsafe HTML or XML data in doctype entities is validated using the is-unsafe library; users can override the rules by overriding EntityDecoder.

    5.9.0release notes

  • Malicious CDATA and comment content is sanitized by fast-xml-builder.

    5.7.1release notes

  • Fixes entity expansion limits.

    5.5.7release notessecurity advisory

  • fast-xml-parser affected by numeric entity expansion bypassing all entity expansion limits (incomplete fix for CVE-2026-26278)

    5.5.6security advisory

  • fast-xml-parser has stack overflow in XMLBuilder with preserveOrder

    5.3.8security advisory

  • Adds an option for allowed tags as part of improved entity processing security and performance.

    5.3.6release notes

  • fast-xml-parser affected by DoS through entity expansion in DOCTYPE (no expansion limit)

    5.3.6security advisory

  • Adds an option to limit entity size, improving security and performance of entity processing.

    5.3.6release notes

  • Adds an option to limit expanded length, improving security and performance of entity processing.

    5.3.6release notes

  • Adds an option to limit entity expansion depth, improving security and performance of entity processing.

    5.3.6release notes

  • Adds an option to limit total entity expansions, improving security and performance of entity processing.

    5.3.6release notes

  • Adds a tag filter option as part of improved entity processing security and performance.

    5.3.6release notes

  • Regex characters in entity names are escaped.

    5.3.5release notessecurity advisory

  • fast-xml-parser has RangeError DoS Numeric Entities Bug

    5.3.4security advisory

Deprecations 2

  • The addEntity API is deprecated.

    5.7.3release notes

  • XMLBuilder will be removed from fast-xml-parser in a future major version; migrate to fast-xml-builder.

    5.4.0release notes

New APIs and options 5

  • Node metadata now supports endIndex, allowing developers to access the end index.

    5.11.0release notes

  • Number parsing options can now be set for hex, binary, enotation, infinity, and unicode.

    5.9.0release notes

  • Octal and binary parsing can be enabled; both are off by default.

    5.8.0release notes

  • Adds support for path-expression-matcher.

    5.5.1release notes

  • Adds support for maxNestedTags.

    5.3.8release notes

Performance 6

  • Quoted attribute values are skipped in one step, making long SVG path data 4–5x faster.

    5.12.1release notes

  • When processEntities is true, performance may degrade by approximately 8–10% without a separately passed entity decoder; with one, performance is unchanged when there are no entities and improved when there are.

    5.7.1release notes

  • Improves performance of stopNode checking.

    5.5.1release notes

  • The release notes mention saving use of js properties, without further detail.

    5.3.8release notes

  • Entity processing returns quickly when no entity is present.

    5.3.6release notes

  • Performance improvement for stopNodes.

    5.3.3release notes

Behavior and default changes 4

  • The builder can sanitize tag names when it finds them invalid.

    5.8.0release notes

  • Numerical external entities are allowed for backward compatibility.

    5.7.2release notes

  • The error message when the entity expansion limit is crossed might change.

    5.7.1release notes

  • The default entity size limit is increased to 10000.

    5.5.10release notes

Tooling 1

  • The typings file is combined to avoid requiring configuration changes.

    5.5.9release notes

Fixes and other changes 14

  • Adds endIndex to the CommonJS XMLMetaData declaration so the declaration includes this metadata field.

    5.12.0release notes

  • Preserves original metadata offsets when parsing CRLF input.

    5.12.0release notes

  • The version parameter is typed as a number.

    5.11.2release notes

  • The parser no longer crashes when it encounters a closing tag with no matching opening tag.

    5.11.0release notes

  • The builder's output formatting is fixed.

    5.8.0release notes

  • Creates a text node when attributes are present on a self-closing node.

    5.7.3release notes

  • Fixes the stop node expression when the namespace prefix is removed.

    5.7.3release notes

  • Fixes attributesGroupName when used with preserveOrder.

    5.7.2release notes

  • Fixes a stack overflow when a tag expression is very long.

    5.7.2release notes

  • Setting ignoreAttributes is no longer required to set the XML version for an NCR entity value.

    5.7.1release notes

  • Fixes parsing so stopNode is not parsed.

    5.5.1release notes

  • The XML builder handles non-array input when preserveOrder is true.

    5.3.8release notes

  • Missing exports were added to the CommonJS types, making them available to developers using the package's CommonJS typings.

    5.3.5release notes

  • Fixed an issue where transformTagName with allowBooleanAttributes adds an unnecessary attribute.

    5.3.3release notes

fast-xml-parser 432 changes

Breaking changes 17

  • In parser output with preserveOrder:true, attrMap is renamed to attibutes.

    4.0.0release notes

  • The configuration property attrNodeName is renamed to attributesGroupName.

    4.0.0release notes

  • The configuration property attrValueProcessor is renamed to attributeValueProcessor.

    4.0.0release notes

  • CDATA is no longer parsed.

    4.0.0release notes

  • The configuration property cdataTagName is renamed to cdataPropName.

    4.0.0release notes

  • The CLI and browser bundle are renamed to fxparser.

    4.0.0release notes

  • The configuration property numParseOptions is renamed to numberParseOptions.

    4.0.0release notes

  • Parser results are now returned as an array to provide a common structure and root-level detail.

    4.0.0release notes

  • The configuration property parseNodeValue is renamed to parseTagValue.

    4.0.0release notes

  • The configuration property ignoreNameSpace is renamed to removeNSPrefix.

    4.0.0release notes

  • Stop nodes are skipped when building XML from a JS object.

    4.0.0release notes

  • The processor is now called for stop nodes.

    4.0.0release notes

  • Processing behavior changes to include extra input parameters.

    4.0.0release notes

  • XML Builder suppresses unpaired tags by default.

    4.0.0release notes

  • An error is thrown when extra text follows XML content.

    4.0.0release notes

  • An XML parser instance must be built for the chosen options before parsing XML.

    4.0.0release notes

  • j2xparser is renamed to XMLBuilder.

    4.0.0release notes

New APIs and options 8

  • A commentPropName configuration property is added.

    4.0.0release notes

  • HTML document parsing is supported.

    4.0.0release notes

  • The isArray option parses a tag into an array.

    4.0.0release notes

  • Processing of PI Tags is supported.

    4.0.0release notes

  • The option renders XML so the resulting JS object maintains the order of properties from the XML.

    4.0.0release notes

  • XML Builder supports suppressBooleanAttributes for attributes with value true.

    4.0.0release notes

  • Unpaired tags are supported.

    4.0.0release notes

  • XML entities, HTML entities, and DOCTYPE entities are supported.

    4.0.0release notes

Behavior and default changes 3

  • External entities are supported without a DOCTYPE.

    4.0.0release notes

  • A global stopNodes expression such as "*.stop" is supported.

    4.0.0release notes

  • Attributes can be separated from a tag name by a newline.

    4.0.0release notes

Fixes and other changes 4

  • Attribute values can contain newlines.

    4.0.0release notes

  • Fixed an issue involving a tag with the name attributes.

    4.0.0release notes

  • The spelling of suppressEmptyNode is corrected.

    4.0.0release notes

  • Fixed a bug when an attribute has no value but contains only '='.

    4.0.0release notes