Skip to content

Commit 21851ba

Browse files
seven332claude
andcommitted
fix(deps): patch aws-sdk xml-builder for fast-xml-parser 5.7 compat
fast-xml-parser 5.7.0 made parser.addEntity("#...") a hard error (CHANGELOG: "you cant add numeric external entity"). @aws-sdk/xml-builder@3.972.18 still calls parser.addEntity("#xD", "\r") and addEntity("#10", "\n") as a legacy fallback for S3/STS XML responses containing &#xD; / &#10; character refs. Our fast-xml-parser override to >=5.7.0 (for GHSA-gh4j-gqv2-49f6) therefore caused every S3 ListObjectsV2 / STS GetCallerIdentity call to throw "Invalid character '#' in entity name: '#xD'" during XML deserialization, surfacing as 500s from agent delete in e2e ser-t05-zero-agent.bats. Patch drops both addEntity lines. fast-xml-parser 5.7.x decodes &#xD; and &#10; internally (CHANGELOG 5.6.0: "fix: entity replacement for numeric entities"), so the fallback is functionally redundant. Refs: - aws/aws-sdk-js-v3#7949 - aws-amplify/amplify-backend#3172 - Upstream replacement PR aws/aws-sdk-js-v3#7863 (still open) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 670c9f7 commit 21851ba

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

turbo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
"smol-toml": ">=1.6.1",
7070
"@opentelemetry/instrumentation": ">=0.213.0",
7171
"zod": "4.3.6"
72+
},
73+
"patchedDependencies": {
74+
"@aws-sdk/xml-builder@3.972.18": "patches/@aws-sdk__xml-builder@3.972.18.patch"
7275
}
7376
},
7477
"packageManager": "pnpm@10.15.0",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/dist-cjs/xml-parser.js b/dist-cjs/xml-parser.js
2+
index 31499ae6d0d8319b58891fa870744493503c805b..d21356d4b862b461c6d82c9e154161974c23d56c 100644
3+
--- a/dist-cjs/xml-parser.js
4+
+++ b/dist-cjs/xml-parser.js
5+
@@ -16,8 +16,6 @@ const parser = new fast_xml_parser_1.XMLParser({
6+
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
7+
maxNestedTags: Infinity,
8+
});
9+
-parser.addEntity("#xD", "\r");
10+
-parser.addEntity("#10", "\n");
11+
function parseXML(xmlString) {
12+
return parser.parse(xmlString, true);
13+
}
14+
diff --git a/dist-es/xml-parser.js b/dist-es/xml-parser.js
15+
index 9bd0f4ba572f221544c4c692092bd128bb57f9f0..9bb8d52f29bc921a05174561e861044218bf8ec1 100644
16+
--- a/dist-es/xml-parser.js
17+
+++ b/dist-es/xml-parser.js
18+
@@ -13,8 +13,6 @@ const parser = new XMLParser({
19+
tagValueProcessor: (_, val) => (val.trim() === "" && val.includes("\n") ? "" : undefined),
20+
maxNestedTags: Infinity,
21+
});
22+
-parser.addEntity("#xD", "\r");
23+
-parser.addEntity("#10", "\n");
24+
export function parseXML(xmlString) {
25+
return parser.parse(xmlString, true);
26+
}

turbo/pnpm-lock.yaml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)