Skip to content

Commit fdcbab3

Browse files
authored
@W-21670876 fix: xml-fast-parser entity (#1714)
* fix: xml-fast-parser * fix: bump maxTotalExpansions limit * fix: bump maxTotalExpansions limit
1 parent 39c8a83 commit fdcbab3

3 files changed

Lines changed: 34 additions & 15 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"node": ">=18.0.0"
2626
},
2727
"dependencies": {
28-
"@salesforce/core": "^8.27.0",
28+
"@salesforce/core": "^8.27.1",
2929
"@salesforce/kit": "^3.2.4",
3030
"@salesforce/ts-types": "^2.0.12",
3131
"@salesforce/types": "^1.6.0",
3232
"fast-levenshtein": "^3.0.0",
33-
"fast-xml-parser": "^5.3.6",
33+
"fast-xml-parser": "^5.5.7",
3434
"got": "^11.8.6",
3535
"graceful-fs": "^4.2.11",
3636
"ignore": "^5.3.2",

src/utils/metadata.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export const parser = new XMLParser({
2525
parseTagValue: false,
2626
parseAttributeValue: false,
2727
cdataPropName: '__cdata',
28+
// Max entity expansion limit (1000) was enforced in fast-xml-parser 5.5.6. This was too low for our existing tests
29+
processEntities: {
30+
enabled: true,
31+
maxTotalExpansions: 50_000,
32+
},
2833
ignoreDeclaration: true,
2934
numberParseOptions: { leadingZeros: false, hex: false },
3035
commentPropName: XML_COMMENT_PROP_NAME,

yarn.lock

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,10 @@
778778
semver "^7.6.3"
779779
ts-retry-promise "^0.8.1"
780780

781-
"@salesforce/core@^8.27.0":
782-
version "8.27.0"
783-
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.27.0.tgz#171660a3d98770d3dd09b2ac16e49d139dff7578"
784-
integrity sha512-Je//0ySHRJRTD16dFxdm6J624i+oufKNq+o8O1AoUNYlT/k4SJi/YGt+iGlKesZGxPf7X1zzUPY1S6C99c/UBA==
781+
"@salesforce/core@^8.27.1":
782+
version "8.27.1"
783+
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.27.1.tgz#26b08b0d68dd1fc210d1dd7a7e3770e3b9f27e74"
784+
integrity sha512-1WpVt9tQAEINGzsQsSiVRmcmYUpKeK4P54624f9HvLIv7o7jTjdARwirJpOqivIihbDE8OJnYOdsr0vV5Dz93A==
785785
dependencies:
786786
"@jsforce/jsforce-node" "^3.10.13"
787787
"@salesforce/kit" "^3.2.4"
@@ -2739,12 +2739,21 @@ fast-uri@^3.0.1:
27392739
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.1.tgz#cddd2eecfc83a71c1be2cc2ef2061331be8a7134"
27402740
integrity sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==
27412741

2742-
fast-xml-parser@^5.3.6:
2743-
version "5.3.6"
2744-
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.3.6.tgz#85a69117ca156b1b3c52e426495b6de266cb6a4b"
2745-
integrity sha512-QNI3sAvSvaOiaMl8FYU4trnEzCwiRr8XMWgAHzlrWpTSj+QaCSvOf1h82OEP1s4hiAXhnbXSyFWCf4ldZzZRVA==
2742+
fast-xml-builder@^1.1.4:
2743+
version "1.1.4"
2744+
resolved "https://registry.yarnpkg.com/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz#0c407a1d9d5996336c0cd76f7ff785cac6413017"
2745+
integrity sha512-f2jhpN4Eccy0/Uz9csxh3Nu6q4ErKxf0XIsasomfOihuSUa3/xw6w8dnOtCDgEItQFJG8KyXPzQXzcODDrrbOg==
2746+
dependencies:
2747+
path-expression-matcher "^1.1.3"
2748+
2749+
fast-xml-parser@^5.5.7:
2750+
version "5.5.7"
2751+
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.5.7.tgz#e1ddc86662d808450a19cf2fb6ccc9c3c9933c5d"
2752+
integrity sha512-LteOsISQ2GEiDHZch6L9hB0+MLoYVLToR7xotrzU0opCICBkxOPgHAy1HxAvtxfJNXDJpgAsQN30mkrfpO2Prg==
27462753
dependencies:
2747-
strnum "^2.1.2"
2754+
fast-xml-builder "^1.1.4"
2755+
path-expression-matcher "^1.1.3"
2756+
strnum "^2.2.0"
27482757

27492758
fastest-levenshtein@^1.0.7:
27502759
version "1.0.16"
@@ -4795,6 +4804,11 @@ path-exists@^4.0.0:
47954804
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
47964805
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
47974806

4807+
path-expression-matcher@^1.1.3:
4808+
version "1.1.3"
4809+
resolved "https://registry.yarnpkg.com/path-expression-matcher/-/path-expression-matcher-1.1.3.tgz#8bf7c629dc1b114e42b633c071f06d14625b4e0d"
4810+
integrity sha512-qdVgY8KXmVdJZRSS1JdEPOKPdTiEK/pi0RkcT2sw1RhXxohdujUlJFPuS1TSkevZ9vzd3ZlL7ULl1MHGTApKzQ==
4811+
47984812
path-is-absolute@^1.0.0:
47994813
version "1.0.1"
48004814
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
@@ -5700,10 +5714,10 @@ strip-json-comments@^3.1.1:
57005714
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
57015715
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
57025716

5703-
strnum@^2.1.2:
5704-
version "2.1.2"
5705-
resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.1.2.tgz#a5e00ba66ab25f9cafa3726b567ce7a49170937a"
5706-
integrity sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==
5717+
strnum@^2.2.0:
5718+
version "2.2.1"
5719+
resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.2.1.tgz#d28f896b4ef9985212494ce8bcf7ca304fad8368"
5720+
integrity sha512-BwRvNd5/QoAtyW1na1y1LsJGQNvRlkde6Q/ipqqEaivoMdV+B1OMOTVdwR+N/cwVUcIt9PYyHmV8HyexCZSupg==
57075721

57085722
supports-color@^5.3.0:
57095723
version "5.5.0"

0 commit comments

Comments
 (0)