fixup! TF-4224 Reduce ReDoS vulnerability

This commit is contained in:
Dang Dat
2026-01-05 16:42:23 +07:00
committed by Dat H. Pham
parent 9f1373c7e5
commit 7b8e95de9a
2 changed files with 8 additions and 13 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ class StringConvert {
input = Uri.decodeComponent(input);
}
if (input.length % 4 == 0 && _base64ValidationRegex.hasMatch(input)) {
if (input.length % 4 == 0 && !input.contains(' ') && _base64ValidationRegex.hasMatch(input)) {
try {
input = utf8.decode(base64.decode(input));
} catch (_) {}