Packages / fast-xml-parser / Security
fast-xml-parser has stack overflow in XMLBuilder with preserveOrder
Affected releases · fast-xml-parser
- 5.x5.0.0 – 5.3.7Fixed in 5.3.8
- 4.x4.0.0 – 4.5.3Fixed in 4.5.4
On 5.x, the newest line:
npm install fast-xml-parser@5.3.8Every release on a timeline
Affected
5.0.0 – 5.3.7
25 releases
Fixed
5.3.8 – 5.12.1
35 releases, latest
Affected
4.0.0 – 4.5.3
42 releases
Fixed
4.5.4 – 4.5.7
4 releases
What happens
Impact
Application crashes with stack overflow when user use XML builder with prserveOrder:true for following or similar input
[{
'foo': [
{ 'bar': [{ '@_V': 'baz' }] }
]
}]Cause: arrToStr was not validating if the input is an array or a string and treating all non-array values as text content.
What kind of vulnerability is it? Who is impacted?
Patches
Yes in 5.3.8
Workarounds
Use XML builder with preserveOrder:false or check the input data before passing to builder.
References
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.