#880 ✓resolved
umur.ozkul (at gmail)

Hobo Security Hole

Reported by umur.ozkul (at gmail) | December 2nd, 2010 @ 09:54 PM

Using the curl command a hacker can fill up your hobo web site with unwanted data. Create permissions are not working on direct posting in Hobo 1.0.1

I verified the problem using webrat, capybara in selenium mode, functional tests and from command line using curl.

I found a fix

I made a change in the file lib/hobo/model_controller.rb

    def hobo_create(*args, &b)
      options = args.extract_options!
      attributes = options[:attributes] || attribute_parameters || {}
      if self.this ||= args.first
        this.user_update_attributes(current_user, attributes)
      else
        self.this = new_for_create(attributes)
#         this.save  #Original Line
    this.with_acting_user(current_user) {this.save} #SUGGESTED FIX
      end
      create_response(:new, options, &b)
    end

Using "this.with_acting_user(current_user) {this.save}" instead of "this.save" fixes the problem.

Why people are not encountering this problem? Because using the application in the web interface hides the problem. If you are a guest and only admin is allowed to create then you don't see the admin button and you cannot post. However somebody can execute a curl command and fill up your whole database.

I am using Hobo 1.0.1 . I did not verify this condition with newer versions of Hobo.

This problem was referred in the previously invalid ticket #879 claiming that the problem exists only in the functional testing environment.

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 ยป

Pages