-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3.2.x] Fixed CVE-2023-36053 -- Prevented potential ReDoS in EmailVal…
…idator and URLValidator. Thanks Seokchan Yoon for reports.
- Loading branch information
Showing
8 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -422,11 +422,18 @@ class SignupForm(Form): | |
get_spam = BooleanField() | ||
|
||
f = SignupForm(auto_id=False) | ||
self.assertHTMLEqual(str(f['email']), '<input type="email" name="email" required>') | ||
self.assertHTMLEqual( | ||
str(f["email"]), | ||
'<input type="email" name="email" maxlength="320" required>', | ||
) | ||
self.assertHTMLEqual(str(f['get_spam']), '<input type="checkbox" name="get_spam" required>') | ||
|
||
f = SignupForm({'email': '[email protected]', 'get_spam': True}, auto_id=False) | ||
self.assertHTMLEqual(str(f['email']), '<input type="email" name="email" value="[email protected]" required>') | ||
self.assertHTMLEqual( | ||
str(f["email"]), | ||
'<input type="email" name="email" maxlength="320" value="[email protected]" ' | ||
"required>", | ||
) | ||
self.assertHTMLEqual( | ||
str(f['get_spam']), | ||
'<input checked type="checkbox" name="get_spam" required>', | ||
|
@@ -2824,7 +2831,7 @@ class Person(Form): | |
<option value="true">Yes</option> | ||
<option value="false">No</option> | ||
</select></li> | ||
<li><label for="id_email">Email:</label> <input type="email" name="email" id="id_email"></li> | ||
<li><label for="id_email">Email:</label> <input type="email" name="email" id="id_email" maxlength="320"></li> | ||
<li class="required error"><ul class="errorlist"><li>This field is required.</li></ul> | ||
<label class="required" for="id_age">Age:</label> <input type="number" name="age" id="id_age" required></li>""" | ||
) | ||
|
@@ -2840,7 +2847,7 @@ class Person(Form): | |
<option value="true">Yes</option> | ||
<option value="false">No</option> | ||
</select></p> | ||
<p><label for="id_email">Email:</label> <input type="email" name="email" id="id_email"></p> | ||
<p><label for="id_email">Email:</label> <input type="email" name="email" id="id_email" maxlength="320"></p> | ||
<ul class="errorlist"><li>This field is required.</li></ul> | ||
<p class="required error"><label class="required" for="id_age">Age:</label> | ||
<input type="number" name="age" id="id_age" required></p>""" | ||
|
@@ -2859,7 +2866,7 @@ class Person(Form): | |
<option value="false">No</option> | ||
</select></td></tr> | ||
<tr><th><label for="id_email">Email:</label></th><td> | ||
<input type="email" name="email" id="id_email"></td></tr> | ||
<input type="email" name="email" id="id_email" maxlength="320"></td></tr> | ||
<tr class="required error"><th><label class="required" for="id_age">Age:</label></th> | ||
<td><ul class="errorlist"><li>This field is required.</li></ul> | ||
<input type="number" name="age" id="id_age" required></td></tr>""" | ||
|
@@ -3489,7 +3496,7 @@ class CommentForm(Form): | |
f = CommentForm(data, auto_id=False, error_class=DivErrorList) | ||
self.assertHTMLEqual(f.as_p(), """<p>Name: <input type="text" name="name" maxlength="50"></p> | ||
<div class="errorlist"><div class="error">Enter a valid email address.</div></div> | ||
<p>Email: <input type="email" name="email" value="invalid" required></p> | ||
<p>Email: <input type="email" name="email" value="invalid" maxlength="320" required></p> | ||
<div class="errorlist"><div class="error">This field is required.</div></div> | ||
<p>Comment: <input type="text" name="comment" required></p>""") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters