3 ms·
Hello everyone! I am MEGA EXCITED for this release, as it's the first version in which I'm a committer. Wooo! In addition, 954 other intrepid Rubyists in total
by steveklabnik 14y ago
Hello everyone! I am MEGA EXCITED for this release, as it's the first version in which I'm a committer. Wooo! In addition, 954 other intrepid Rubyists in total contributed to this release: http://contributors.rubyonrails.org/edge/contributors http://contributors.rubyonrails.org/edge/contributors
Please note that this is a beta, not an rc, so some things may be a bit wonky. Please file an issue on GitHub and I will do everything I can to help you help us iron out all the kinks.
❤❤❤
(Also, I am on a plane and my battery is almost dead, so I may drop out of this thread soon. Ill read it when I'm home.)
- grey-area 14y agoI'm curious to know if these examples of potential SQL injection tested against 3.2.11 have been dealt with in 4.0? Would be great to see these possible problems tidied up. http://rails-sqli.org/ http://rails-sqli.org/
- steveklabnik 14y agoI am not a member of the security team, but it's my understanding that all security patches were also applied against master where appropriate. (The security team is a subset of the core team, in accordance with least privilege and all that.)
- grey-area 14y agoOK. I've checked against 3.2.12, and at least one isn't fixed, so it might be worth passing the link on to the security team. They'll all be easy fixes, and it'd be great to see them fixed (if not already) in 4.0. Thanks for contributing Rails 4.0 - I'm excited to try it out, in particular the new caching looks great.
- stiff 14y agoThe examples here do not include SQL injection from known CVEs and are not vulnerabilites themselves, only potential misuses of the methods. What would you like to have changed here? The methods work fine as long as you do not explicitly embed a user-supplied string in a larger SQL fragment.
- grey-area 14y agoI don't think all of these examples involve embedding strings. Many people assume that they can use any ActiveRecord method, and as long as they don't embed strings, they'll be safe from sqli. Take this first example: Order.calculate(:sum, params[:column]) I've just checked in Rails 3.2.12 and this is still possible, haven't checked against Rails 4.0. If I pass in: http://localhost:3000/adverts/1?column=id http://localhost:3000/adverts/1?column=id) FROM users WHERE name = 'Bob' SUM(id; And do a simple sum in the controller: sum = Advert.calculate(:sum, params[:column]) # or sum = Advert.sum(params[:column]) I get: SELECT SUM(id) FROM users WHERE name = 'Bob' SUM(id) FROM "adverts" Which is not good as it is injecting sql - with judicious use of sql comments etc it could probably be made to execute any sql statement (apparently it does on sqlite with this particular test, but it fails in postgresql which I tested with). Other queries work with psql though [deleted example and reported]. I've reported this with a working example of sqli just in case it is an unreported problem. Now the intended use of sum, count etc is to deal with symbols chosen by the programmer, but a naive implementation of say an admin form for summing some record attributes might use a param from a form, and pass that in to the sum method for column name, just as they might use params[:id] with find. I think Rails should deal with that. Also the example given of User.exists? params[:id] is probably commonly used, but vulnerable to manipulation of results at the very least. I'm not the original author of this page (which is already public and probably has been for some time), and am aware this is not an appropriate place to report bugs, but it would be reassuring if the Rails team looked at this link and fixed anything which is dangerous like the usage above. IMHO all rails ActiveRecord methods should guard against sqli as much as possible, not just the commonly used ones, and if they don't currently it needs to be fixed.
- stiff 14y agoOk, this one is a genuine problem in that the method is expected to only deal with column names and is not supposed to accept full SQL, but you made it sound like the page was a list of security issues that Rails should deal with but isn't, which on top of the recent discussions about Rails security sounds a lot like FUD (maybe unintentionally); this is actually a page listing Rails anti-patterns. If you actually learn Rails and aren't just piecing things together until it works, it isn't a secret that most methods accept raw SQL as the first argument, with optional placeholders for expected values, so if you want escaping you either pass an array ["col1 = ?", params[:val1]] and the values will be quoted or you have to quote explicitly. Methods like .where(), .joins(), .having(), .order() etc. would be crippled if they escaped this first string argument so I am not sure how a "fix" should like here, you have to demarcate somehow which input is trusted and which is untrusted and those methods are 95% of the time used to deal with trusted input.
- batiste 14y agoRather dangerous stuff. I didn't know ActiveRecord would allow to shot yourself in the foot.
- jaggederest 14y agoProud to be on the contributor list for this one - any of you considering contributing, it's not hard at all, the team makes it really easy.
- habosa 14y agoAny pointers for getting started?
- steveklabnik 14y agoWe have a guide here: http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html http://edgeguides.rubyonrails.org/contributing_to_ruby_on_ra... If there is anything I can do to make this more clear, please let me know. Documentation is something I enjoy.
- jaggederest 14y agoIn my opinion the easy way is to look through the github issues and pull requests and understand what's going on. From there, try reading docs and seeing what does / doesn't make sense and editing it. You pretty much always get feedback if you send a decently put together pull request. Look for places the code might not currently be clear, and try to improve clarity without changing behavior. Once you've done that kind of thing, sky's the limit as far as I am concerned. I'm working on understanding and improving the parameter parsing behavior at the moment.
- timdorr 14y agoIs there any sort of prioritized TODO list, either by difficultly or importance? And that's not so I can knock out some big feature and be the hero, but so I can whittle away at some of the more nagging edge cases and make some random developers day when things just work.
- jaggederest 14y agoThe issues page is the best you have for that, sort by popularity or something like that. That's one of the only things I'm frustrated about - I wish there were a clearer list so that I didn't have to troll for tasks that need doing, or ask a core member on IRC/campfire
- george12 14y agoAs a rails user, thanks for your contributions! All you guys and gals rock!
- abcbaby 14y agoAs usual, you barely do anything but minor docfixes or merge other people's pull requests. Do you ever actually do substantial coding at all? or would that take too much time away from babbling on twitter and acting outraged over gender issues? Biggest fraud ever.