by stwe on 3/4/12, 5:26 PM with 225 comments
by wycats on 3/4/12, 6:10 PM
Merb's approach was to have mass assignment protection in the controller, and I personally think it's self-evident that it belongs there. Moving it into the controller will also make it easier to solve the tension between reducing the friction of getting up and running quickly and having good security defaults.
In general, Rails' convention over configuration make a stock Rails app more secure by default (CSRF protections, XSS protection, timing attacks, session fixation, etc.). This is a case where there's a real tension, but I think that we can solve it by applying some brainpower to the question.
by teej on 3/4/12, 7:53 PM
I disclosed a vulnerability to GitHub before. I dropped it into their Issues system marked private with the heading "URGENT". It was a Sunday and I got a response + a fix from Tom Preston-Wener himself within a few hours. That, in my mind, would have been a more responsible approach.
by danmaz74 on 3/4/12, 9:29 PM
Understandably, Github would have liked much more to be one of those companies that will be able to quietly fix this vulnerability without anybody knowing, but now that the damage to their image is done I really hope they'll not add to that damage by persisting in their banning of a 18 year old that acted irresponsibly yes, but maliciously - definitely not.
From a PR perspective, I guess that having titles like "Silicon Valley company rewards Russian teenager who helps them eliminating a security risk" could even spin the episode in their favor.
by shearn89 on 3/4/12, 6:39 PM
If by adding a line or 2 to the code for generators can stop this, even if it includes a comment saying "Removing this line will do x y z", then I think the rails team could've treated the bug with a little more respect.
As @ericb said, if strong devs make this mistake, there's something wrong with the code.
I think it should also be noted that he didn't do anything malicious like trash repos, and even says on his blog:
"Then I could wipe any post in any project. That wasn't that funny but pretty
dangereous[sic]. It got more curious."
All he did was add a 3 line file to the master repo of a project that he was frustrated with. It generated all this attention, and will probably make them rethink the approach...Finally: big props to the GitHub team for patching their vulnerability in <1hr on a Sunday...
by holman on 3/4/12, 6:04 PM
by bretthopper on 3/4/12, 6:26 PM
Models: find app/models -type f -name \*.rb | wc -l
Models with attr_accessible: grep -r -m1 "attr_accessible" app/models | wc -l
If those numbers aren't the same, and the missing model files inherit from ActiveRecord::Base, then look into adding attr_accessible.
by mojombo on 3/4/12, 8:33 PM
by sad_panda on 3/4/12, 9:03 PM
Contrast this with the enormous hue and cry against FB, MS, et al. when they have comparatively minor holes in their systems.
I'm not saying that we need to tar and feather GH, but we should at least be equal-opportunity in our condemnations and realize that everybody is capable of mistakes. So, if you're OUTRAGED about Apple making a minor boo-boo, you should be equally outraged about this.
by teyc on 3/4/12, 11:41 PM
by patrickaljord on 3/4/12, 6:25 PM
by hundredwatt on 3/4/12, 10:38 PM
Here's the file: https://gist.github.com/1975167, just add to lib/generators in your Rails 3 app, then do rails g mass_assignment_security -h
Hopefully others find this helpful
by wandernotlost on 3/4/12, 11:49 PM
It should be obvious that you can't anticipate every potential attack vector at design time. Therefore, a well-designed system is one for which, when expected or normal conditions are not met, the resulting action is nothing or error, not an unexpected action.
This principle is also known as fail-safe: http://en.wikipedia.org/wiki/Fail-safe
by arturadib on 3/4/12, 5:45 PM
by codesuela on 3/4/12, 9:59 PM
by Estragon on 3/4/12, 9:36 PM
by nate on 3/4/12, 6:21 PM
by raggi on 3/4/12, 10:47 PM
by bbeausej on 3/4/12, 11:05 PM
by tlogan on 3/5/12, 12:48 AM
Meaning using mass assignment is very similar to SQL injection: you pass variables from user input directly to model without even verifying them. Duh?
Now regarding GitHub: yes there is a security hole and they fixed it.
However, hacking a site after finding its vulnerability is definitely illegal and hope there will be consequences. And he did not even report a problem to GitHub.
by tvon on 3/4/12, 8:13 PM
by deanpcmad on 3/4/12, 10:25 PM
by comechao on 3/4/12, 7:06 PM
by orblivion on 3/4/12, 8:34 PM
I like it, this would be a great way to be snarky and semi-responsible at the same time.
by mvasilkov on 3/4/12, 9:03 PM
No, I mean really, "malicious attack". I can't help but laugh, he committed 3 lines of text grand total, this is what you call malicious? Seriously, WTF.
The guy is a proper white-hat hacker, even if somewhat childish, Y U ban him.
by zyfo on 3/4/12, 5:49 PM
"Today I can pull/commit/push in any repository on github. Jack pot."
by javascriptlol on 3/4/12, 8:50 PM
by shearn89 on 3/4/12, 6:44 PM
"<s>Discount for girls</s>"
by apl on 3/4/12, 5:57 PM
by klodolph on 3/4/12, 5:49 PM