diff --git a/CHANGELOG.md b/CHANGELOG.md index 20e5af9fb..80bea673a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## next release +## v5.4.15 2022 August 1 + +- Improved security: adds redis-session-store to store session +- Improved security: makes rmagick, minimagick and mime types less explicit +- Improved security: add complexity check of the user password +- Improved security: prevents users enumeration attacks by not giving any info about the validity of the email + ## v5.4.14 2022 August 1 - Added a test for multiple reservations on the same space slot diff --git a/Gemfile b/Gemfile index 272c0fd78..fa5abd22d 100644 --- a/Gemfile +++ b/Gemfile @@ -144,3 +144,5 @@ gem 'tzinfo-data' # compilation of dynamic stylesheets (home page & theme) gem 'sassc', '= 2.1.0' + +gem 'redis-session-store' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index d3b3a069e..dfb8000e3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -351,6 +351,9 @@ GEM activesupport i18n redis (4.6.0) + redis-session-store (0.11.4) + actionpack (>= 3, < 8) + redis (>= 3, < 5) regexp_parser (2.5.0) repost (0.3.2) responders (2.4.1) @@ -542,6 +545,7 @@ DEPENDENCIES rails_12factor rb-readline recurrence + redis-session-store repost responders (~> 2.0) rolify diff --git a/app/controllers/confirmations_controller.rb b/app/controllers/confirmations_controller.rb index af20152b6..0531b60de 100644 --- a/app/controllers/confirmations_controller.rb +++ b/app/controllers/confirmations_controller.rb @@ -2,6 +2,17 @@ # Devise controller to handle validation of email addresses class ConfirmationsController < Devise::ConfirmationsController + + # POST /resource/confirmation + def create + self.resource = resource_class.send_confirmation_instructions(resource_params) + yield resource if block_given? + + if successfully_sent?(resource) + respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name)) + end + end + # The path used after confirmation. def after_confirmation_path_for(_resource_name, resource) signed_in_root_path(resource) diff --git a/app/controllers/passwords_controller.rb b/app/controllers/passwords_controller.rb index 1bdd0e19e..285e87e3c 100644 --- a/app/controllers/passwords_controller.rb +++ b/app/controllers/passwords_controller.rb @@ -9,8 +9,6 @@ class PasswordsController < Devise::PasswordsController if successfully_sent?(resource) respond_with({}, location: after_sending_reset_password_instructions_path_for(resource_name)) - else - head 404 end end diff --git a/app/frontend/src/javascript/controllers/application.js b/app/frontend/src/javascript/controllers/application.js index 723c4dcbb..93d9e6c1e 100644 --- a/app/frontend/src/javascript/controllers/application.js +++ b/app/frontend/src/javascript/controllers/application.js @@ -504,14 +504,8 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { $scope.user = { email: '' }; $scope.sendReset = function () { - $scope.alerts = []; return $http.post('/users/password.json', { user: $scope.user }).then(function () { $uibModalInstance.close(); - }).catch(function () { - $scope.alerts.push({ - msg: _t('app.public.common.your_email_address_is_unknown'), - type: 'danger' - }); }); }; }] @@ -526,14 +520,8 @@ Application.Controllers.controller('ApplicationController', ['$rootScope', '$sco controller: ['$scope', '$uibModalInstance', '$http', function ($scope, $uibModalInstance, $http) { $scope.user = { email: '' }; $scope.submitConfirmationNewForm = function () { - $scope.alerts = []; return $http.post('/users/confirmation.json', { user: $scope.user }).then(function () { $uibModalInstance.close(); - }).catch(function (res) { - $scope.alerts.push({ - msg: res.data.errors.email[0], - type: 'danger' - }); }); }; }] diff --git a/app/frontend/templates/shared/ConfirmationNewModal.html b/app/frontend/templates/shared/ConfirmationNewModal.html index ae131353f..e183e6928 100644 --- a/app/frontend/templates/shared/ConfirmationNewModal.html +++ b/app/frontend/templates/shared/ConfirmationNewModal.html @@ -4,7 +4,6 @@
{{ 'app.public.common.you_will_receive_confirmation_instructions_by_email' }}
diff --git a/app/frontend/templates/shared/_member_form.html b/app/frontend/templates/shared/_member_form.html index 0dc2e53fe..0b0690626 100644 --- a/app/frontend/templates/shared/_member_form.html +++ b/app/frontend/templates/shared/_member_form.html @@ -142,7 +142,7 @@ class="form-control" id="user_password" placeholder="{{ 'app.shared.user.new_password' | translate }}" - ng-minlength="8" + ng-minlength="12" required/>