#857 ✓resolved
Tomoaki Hayasaka

hobo_update resets @current_user with @this even if update was failed

Reported by Tomoaki Hayasaka | November 17th, 2010 @ 07:18 PM | in Hobo 1.0X

hobo-1.0.2 and hobo-1.3.0.pre17

hobo_update resets @current_user with @this even if update was failed, and it could be a security hole.

Fix for 1.3.0.pre17 (same issue is there in 1.0.2 in lib/hobo/user_controller.rb):

diff --git a/hobo/lib/hobo/controller/model.rb b/hobo/lib/hobo/controller/model.rb
index c791b85..6c19a8a 100644
--- a/hobo/lib/hobo/controller/model.rb
+++ b/hobo/lib/hobo/controller/model.rb
@@ -593,7 +593,7 @@ module Hobo
       this.user_update_attributes(current_user, changes)
 
       # Ensure current_user isn't out of date
-      @current_user = @this if @this == current_user
+      @current_user = @this if @this == current_user && valid?
 
       in_place_edit_field = changes.keys.first if changes.size == 1 && params[:render]
       update_response(in_place_edit_field, options, &b)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Tags

Referenced by

Pages