Skip to content

Commit

Permalink
Fixed: denial of service loop if setForgetTime set to 0.
Browse files Browse the repository at this point in the history
A small issue with setForgetTime input field would allow users to
manually enter 0 value in the input and save it causing the timed forget
loop to rapidly refresh causing a denial of service.
  • Loading branch information
InternalError503 committed Oct 11, 2015
1 parent cbc240c commit adf0c7f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@
text: ""
});
});


//Important: setForgetTime can't be less then 1 minute (denial of service loop)
$('#setForgetTime').change(function() {
if(document.getElementById('setForgetTime').value > 0){
forgetitoptions.forget_save_options();
}else{
document.getElementById('setForgetTime').value = 1;
}
});

//Save settings as they are changed.
$("#enableConfirmData, \
#clearDataFrom, \
Expand All @@ -98,8 +107,7 @@
#dataLocalStorage, #dataPluginData, \
#dataPasswords, #dataWebSQL, \
#enableTimedForget, #timedForgetHour, \
#timedForgetMinute, #timedForgetTime, \
#setForgetTime").change(function() {
#timedForgetMinute, #timedForgetTime").change(function() {
forgetitoptions.forget_save_options();
});

Expand Down

0 comments on commit adf0c7f

Please # to comment.