python-flask-restx/CVE-2021-32838.patch
programmer12 b501c1e0e4 CVE-2021-32838
(cherry picked from commit 6d68a785eb55698b63470423c3a1e8ee4611bd76)
2021-10-09 17:03:31 +08:00

23 lines
705 B
Diff

From bab31e085f355dd73858fd3715f7ed71849656da Mon Sep 17 00:00:00 2001
From: ziirish <ziirish@ziirish.info>
Date: Wed, 1 Sep 2021 21:53:02 +0200
Subject: [PATCH] optimize email regex (credits: @kevinbackhouse, fix: #372)
---
flask_restx/inputs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flask_restx/inputs.py b/flask_restx/inputs.py
index b05532f3..9c76d8a0 100644
--- a/flask_restx/inputs.py
+++ b/flask_restx/inputs.py
@@ -48,7 +48,7 @@ def my_type(value):
email_regex = re.compile(
- r"^" "(?P<local>[^@]*[^@.])" r"@" r"(?P<server>[^@]+(?:\.[^@]+)*)" r"$",
+ r"^" "(?P<local>[^@]*[^@.])" r"@" r"(?P<server>[^@\.]+(?:\.[^@\.]+)*)" r"$",
re.IGNORECASE,
)