We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 701cd88 commit c81bb88Copy full SHA for c81bb88
.changeset/hungry-steaks-clean.md
@@ -0,0 +1,5 @@
1
+---
2
+"@thirdweb-dev/sdk": patch
3
4
+
5
+fix CWE-1333
legacy_packages/sdk/src/evm/common/error.ts
@@ -404,6 +404,12 @@ export function parseRevertReason(error: any): string {
404
errorString = error.toString();
405
}
406
407
+ // if the error is just too long, just return the message to limit Regexp processing time
408
+ // see: https://cwe.mitre.org/data/definitions/1333.html
409
+ if (errorString.length > 5000) {
410
+ return error.message || "";
411
+ }
412
413
return (
414
parseMessageParts(/.*?"message":"([^"\\]*).*?/, errorString) ||
415
parseMessageParts(/.*?"reason":"([^"\\]*).*?/, errorString) ||
0 commit comments