security: fix self-xss inside the email add functionality.

This commit is contained in:
Marcin Lulek 2017-06-20 20:59:58 +02:00
parent 3aa700c435
commit a9ea42785b
2 changed files with 2 additions and 4 deletions

View file

@ -291,8 +291,7 @@ class AdminUsersView(BaseAppView, DataGridAppView):
h.flash(_("Added new email address `%s` for user account") % email,
category='success')
except formencode.Invalid as error:
msg = error.error_dict['email']
h.flash(msg, category='error')
h.flash(h.escape(error.error_dict['email']), category='error')
except Exception:
log.exception("Exception during email saving")
h.flash(_('An error occurred during email saving'),

View file

@ -253,8 +253,7 @@ class MyAccountView(BaseAppView):
h.flash(_("Added new email address `%s` for user account") % email,
category='success')
except formencode.Invalid as error:
msg = error.error_dict['email']
h.flash(msg, category='error')
h.flash(h.escape(error.error_dict['email']), category='error')
except Exception:
log.exception("Exception in my_account_emails")
h.flash(_('An error occurred during email saving'),