Add Socket patch for CVE-2026-25896 in pkg:npm/fast-xml-parser@4.3.2 - #3
Add Socket patch for CVE-2026-25896 in pkg:npm/fast-xml-parser@4.3.2#3socket-security[bot] wants to merge 2 commits into
Conversation
Updates: - 2 blob(s) added - 0 blob(s) removed - Manifest updated
Configures package.json postinstall scripts to automatically apply Socket security patches.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1af9a5f. Configure here.
| else if( hasBody && isElement(xmlData, i)) i += 8;//Not supported | ||
| else if( hasBody && isAttlist(xmlData, i)) i += 8;//Not supported | ||
| else if( hasBody && isNotation(xmlData, i)) i += 9;//Not supported | ||
| else if( isComment) comment = true; |
There was a problem hiding this comment.
Missing function call makes isComment always truthy
High Severity
On line 41, isComment references the function object (defined at line 102) rather than calling it as isComment(xmlData, i). Since a function reference is always truthy in JavaScript, this condition always evaluates to true. Every other check in the chain (isEntity, isElement, isAttlist, isNotation) properly calls the function with (xmlData, i), but isComment is missing the arguments. This makes the throw new Error("Invalid DOCTYPE") on line 42 completely unreachable, and any unrecognized < tag inside a DOCTYPE body is silently treated as a comment instead of being rejected.
Reviewed by Cursor Bugbot for commit 1af9a5f. Configure here.
| const entKeys = Object.keys(externalEntities); | ||
| for (let i = 0; i < entKeys.length; i++) { | ||
| const ent = entKeys[i]; | ||
| const escaped = ent.replace(/[.\-+*:]/g, '\\.'); |
There was a problem hiding this comment.
Wrong regex replacement turns metacharacters into wildcards
Medium Severity
In addExternalEntities, the replacement string '\\.' replaces every matched metacharacter (-, +, *, :, .) with the literal string \., instead of escaping each character properly. The corresponding fix in DocTypeReader.js line 32 correctly uses '\\$&' (backslash + matched character). For example, an entity name containing - would produce \. in the regex instead of \-, turning that position into a wildcard that matches any character — reintroducing the regex injection vulnerability this patch is supposed to fix.
Reviewed by Cursor Bugbot for commit 1af9a5f. Configure here.


Summary
This PR updates Socket security patches for your dependencies.
Changes
pkg:npm/fast-xml-parser@4.3.2(Socket Patch)📦 Package.json Updates
This PR automatically configures your postinstall script to apply Socket patches:
package.jsonAfter merging, patches will automatically apply on
npm install.Testing
Review the patches and test your application to ensure compatibility.
🔒 Powered by Socket Security
Note
Medium Risk
Introduces an install-time patching step and changes XML entity handling in a third-party parser, which could affect XML parsing edge cases or build/install reliability.
Overview
Applies a Socket community patch for
fast-xml-parser@4.3.2to mitigate CVE-2026-25896, preventing DOCTYPE/external entity names from being used for regex-based entity shadowing (entity-encoding bypass).Adds the patch artifacts under
.socket/(includingDocTypeReader.js/OrderedObjParser.jsreplacements and a.socket/manifest.jsondescribing the vulnerability) and updatespackage.jsonto run@socketsecurity/socket-patch applyduringpostinstall(and via adependenciesscript) so the patch is automatically applied on install.Reviewed by Cursor Bugbot for commit 1af9a5f. Bugbot is set up for automated code reviews on this repo. Configure here.