Closed Bug 88552 Opened 25 years ago Closed 25 years ago

possible to enter chars and negative numbers in master password timeout

Categories

(Core Graveyard :: Security: UI, defect, P2)

1.0 Branch
defect

Tracking

(Not tracked)

VERIFIED FIXED
psm2.1

People

(Reporter: bugzilla, Assigned: inactive-mailbox)

Details

(Keywords: verifyme)

Attachments

(3 files)

In the Master Password Timout value in the prefs -> Privacy -> Master Password it's possible to enter both "-100" and "a" There should be a simple a javscritpt check that check that the text is a number and is >= 0 build 20010629 on win2k
-> kai
Assignee: ssaux → kai.engert
Priority: -- → P2
Target Milestone: --- → 2.1
I created two attachments. The first one is a simple fix, which makes sure invalid values will not be stored, but a zero will be stored instead. However, the user still can enter wrong characters. Originially I wanted to have additional magic within the dialog, that automatically and immediately removes invalid characters, but keeps the good input obtained so far. However, I couldn't get it to work. It works the first time a wrong character is entered, but it doesn't work for additional chars. It seems, using the setAttribute("value", ...) method is not reliable if used multiple times. There might be some additional magic needed which I'm not aware of. I'm attaching a patch that contains my test code, including some debugging output. Unless someone with more JavaScript knowledge jumps in, I suggest to check in the simple fix patch (id 41052).
Keywords: helpwanted, patch, review
David, please review the simple fix. Or do you have ideas regarding my second patch?
r=ddrinan on the first patch. I do not understand the prevent_recursion variable in the second patch. Please explain what you're trying to do here.
The prevent_recursion was kind of safety measurement, not sure if it's really required. If the user modifies passwordTimeout, the function changePasswordSettings is called. From within this function, I immediately change the contents if wrong input is produced by the user. I feared that this could cause a loop, as function changePasswordSettings might be immediately called again. I try to prevent the loop by setting the prevent_recursion flag during modification. However, when I now think about it, I guess there is an event queue and only one event is handled at a time, so the next call to changePasswordSettings might be delayed until we return from it. But during testing this didn't seem to have any influence on my reported problems.
sr=blizzard
Status: NEW → ASSIGNED
Kai: could you also fix http://bugzilla.mozilla.org/show_bug.cgi?id=25473 which has the same problem?
adding nsenterprise to all P1, P2 PSM bugs with target milestone of 2.1
Keywords: nsenterprise
needs checkin...
This bug could also be fixed using the new spinbutton widget! See http://bugzilla.mozilla.org/show_bug.cgi?id=90314
needs an a= from drivers. Addting approval keyword.
Keywords: approval
Henrik, Spinbuttons might be used to assist an implementation. However, even if using Spinbuttons, the user is still able to edit the text field manually, so a fix to this bug is still required. If you want to fix this with spinbuttons only, it would be necessary to set the edit field to read-only for the user, and allow modifications only by clicking the buttons. Don't know if that is what is wanted.
Mass assigning QA to ckritzer.
QA Contact: junruh → ckritzer
Checked in first patch for Kai.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
keywords->verifyme
Reopening. This line: "timeout = "0";" causes the master password to be asked for repeatedly - three times in a row. How about setting this value to 1?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
In my humble opinion, this could be a separate bug. The reporter asked to correct input that is invalid, and that's what we are doing. Zero is a correct input, and is the safest setting we could chose. If the user didn't make a correct input, we shouldn't go to an unsafe setting. And maybe he wanted zero, to force reasking, but mistyped. We shouldn't go the 1 in that case. But I agree there is still a need for something that protects the user from bad input and gives immediate feedback. To my knowledge, we just don't have a proper widget to do this yet. My opinion is: If we want to keep this bug open, we should make it dependent on some other bug that describes the need for implementing such a widget.
junruh argued that if the user wanted to be reasked constantly, he would have selected the "ask every time" option. That convinces me that the minimal setting for the "ask again" interval should indeed be one minute, not zero. I'll add a patch that changes the default to "1".
Status: REOPENED → ASSIGNED
David, can you please review?
r=ddrinan.
Checked in patch for Kai.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Okay, so if a bogus value ("MSIE" or -27) is entered into the field, then when the pref window is closed via the [OK] button, the value is defaulted to 1. And maybe I'm picking nits here, but shouldn't the text displayed in the field also default to 1 when the focus is lost from the input field? The summary of this bug hasn't been fixed, but the problem that stems from it has. Again, I'm probably just picking nits... Kai? Comments?
ckritzer: I absolutely agree with you. I just don't know yet how this could be done. In the debug patch that I attached I tried to do it, without success.
WFM. Verified fixed.
Status: RESOLVED → VERIFIED
QA Contact: ckritzer → junruh
Product: PSM → Core
Version: psm1.01 → 1.0 Branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: