Giter Site home page Giter Site logo

Comments (11)

daveworth avatar daveworth commented on May 23, 2024

@presidentbeef and @oreoshake, just as a note, I am not creating patches/pull requests for this (or my previous issue) because I am not positive my report is actually correct. If you think that I'm right and that I should submit a patch I will happily do so!

from brakeman.

presidentbeef avatar presidentbeef commented on May 23, 2024

Yeah, I'm pretty sure this was just me being overzealous.

from brakeman.

daveworth avatar daveworth commented on May 23, 2024

Cool. I can remove the checks for #update_attribute (singular ;-)) and create a pull request if you'd like.

from brakeman.

presidentbeef avatar presidentbeef commented on May 23, 2024

Sure...with a test? :D

from brakeman.

daveworth avatar daveworth commented on May 23, 2024

Sure... I guess I was kinda sloppy on my annotations branch eh? Hard to test doesn't mean it shouldn't be. 💣

from brakeman.

presidentbeef avatar presidentbeef commented on May 23, 2024

Haha, I wasn't implying anything - I was only thinking we should add a test so in the future it looks deliberate.

from brakeman.

presidentbeef avatar presidentbeef commented on May 23, 2024

If you have any questions about how to go about writing the tests for this, please let me know.

from brakeman.

oreoshake avatar oreoshake commented on May 23, 2024

I heard my name so I should say something. Yes, removing update_attribute sounds like the right thing and I'm not sure that the bypassing of validations is something brakeman should be concerned with only because I can't come up with a reasonable scenario to warn on without a crazy high FP rate or a lot of configuration. Or maybe I'm misunderstanding the concern. I just assumed you were thinking along the lines of

class Donkey < ActiveRecord::Base
  validates_security_of :secure_stuffs  #made up validator
end

def some_action
   donkey = Donkey.find(params[:id])
   donkey.update_attribute(:secure_stuffs, params[:secure_stuffs]) # DANGER, WILL ROBINSON!
end

from brakeman.

oreoshake avatar oreoshake commented on May 23, 2024

And the winner for run-on comment of the year goes to...

from brakeman.

daveworth avatar daveworth commented on May 23, 2024

I caused commotion without meaning to... by "biggest worry regarding #update_attribute" I meant in general, not in a security context. I recently had to make a decision between querying object.valid? after an update_attribute or changing the call to update_attributes with a hash I entirely controlled (which I chose) because of the unclear semantics of the singular version not using validators... it's just weird.

from brakeman.

presidentbeef avatar presidentbeef commented on May 23, 2024

Closed by #83 - thanks Dave!

from brakeman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.