VDB
Sign up
MEDIUM6.1

GHSA-5wm8-gmm8-39j9

fast-xml-builder allows attribute values with unwanted quotes to bypass malicious or unwanted attributes

Quick fix

GHSA-5wm8-gmm8-39j9 — fast-xml-builder: upgrade to the fixed version with the command below.

npm install fast-xml-builder@1.1.7

Details

# 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.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm/fast-xml-builder
Introduced in: 0Fixed in: 1.1.7
Fixnpm install fast-xml-builder@1.1.7

References