Ticket #11054 (closed Bug: fixed)
Unauthorized Exception when reseting password for non-existing user
| Reported by: | lzdych | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 4.0.1 |
| Component: | Infrastructure | Keywords: | TuneUp36 |
| Cc: | naro |
Description
User gets unauthorized exception if does typo when entering email address in the password reset page, so he has no change to get information about that he entered email address for non-existing user.
Attachments
Change History
Changed 16 months ago by lzdych
-
attachment
mail_password.py
added
Quick workaround is to customize mail_password.py script like this.
comment:6 Changed 16 months ago by do3cc
This is a more generic problem. The error handling can trigger Exceptions in various ways. I personally stepped over this issue with a user that does not have a valid email address.
The RestrictedPython code is funny and lies to you when you go through it with a debugger, so I gave that one up. My first error was the same as described here: #9743 . But this is related to a Zope bug which has been fixed today, and will hopefully be in zope 2.12.13. Here is the Launchpad URL: https://bugs.launchpad.net/zope2/+bug/659968
The workaround by lzdych would tell my people that they don't exist if they did not provide a valid mail adress
comment:9 Changed 12 months ago by datakurre
I'm sorry for commenting old ticket, but I don't understand, why the line 15/25 in [40657]:
context.plone_utils.addPortalMessage(pmf(e.message))
doesn't use the carefully generated msg, e.g.
context.plone_utils.addPortalMessage(msg)
but is still allowed to raise the same exception.
comment:10 Changed 12 months ago by do3cc
There is no good reason. I changed it. Thanks for noticing!

This happens because exception's error string isn't accessible in the python script due to security checks.
Traceback (innermost last):
Unauthorized: The container has no security assertions. Access to 'message' of ValueError('The username you entered could not be found',) denied.