GHSA-5wm8-gmm8-39j9
fast-xml-builder allows attribute values with unwanted quotes to bypass malicious or unwanted attributes
Packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | fast-xml-builder | < 1.1.7 | 1.1.7 |
Details
As written in the advisory (Markdown source, shown as plain text).
# Summary
When an input data has quotes in attribute values but process entities is not enabled, it breaks the attribute value into multiple attributes. This gives the room for an attacker to insert unwanted attributes to the XML/HTML.
## Detail
Malicious Input
```
{
a: {
"@_attr": '" onClick="alert(1)'
}
}
```
Output
```xml
<a attr="" onClick="alert(1)"></a>
```
### Workarounds
If you're not ignoring attributes then keep processEntities flag true.
References
External links from the advisory. They lead to third-party sites.