Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bump WTForms and Flask-WTF to latest versions #4083

Merged
merged 1 commit into from
Nov 30, 2021
Merged

Bump WTForms and Flask-WTF to latest versions #4083

merged 1 commit into from
Nov 30, 2021

Conversation

quis
Copy link
Member

@quis quis commented Nov 30, 2021

WTForms versions less than 3.0.0 have a security vulnerability where arbitrary HTML can be inserted into the label of a form, allowing the possibility of a cross-site scripting attack.

See pallets-eco/wtforms@8529b95 for details.

I don’t know if there’s anywhere we put user-generated content into form labels but it’s possible we are vulnerable somewhere.

This require moving some imports because as of pallets-eco/wtforms#614 there is no longer a separate module for HTML 5 fields, they are now considered core fields.

As of pallets-eco/wtforms#445 custom implementations of pre_validate or post_validate must raise ValidationError to trigger a validation message, where we were raising ValueError this was no longer being caught.

As of pallets-eco/wtforms#355 StringField returns None for empty data, not '' but our
validate_email_address function only accepts strings.

WTForms versions less than 3.0.0 have a security vulnerability where
arbitrary HTML can be inserted into the label of a form, allowing the
possibility of a cross-site scripting attack.

I don’t know if there’s anywhere we put user-generated content into form
labels but it’s possible we are vulnerable somewhere.

This require moving some imports because as of
https://github.com/wtforms/wtforms/pull/614/files
there is no longer a separate module for HTML 5 fields, they are now
considered core fields.

As of https://github.com/wtforms/wtforms/issues/445/files custom
implementations of `pre_validate` or `post_validate` must raise
`ValidationError` to trigger a validation message, where we were raising
`ValueError` this was no longer being caught.

As of https://github.com/wtforms/wtforms/pull/355/files `StringField`
returns `None` for empty data, not `''` but our `validate_email_address`
function only accepts strings.
@quis quis merged commit 80b645e into master Nov 30, 2021
@quis quis deleted the bump-wtforms branch November 30, 2021 18:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants