News for hackers. Stuff that matters.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @03:43PM (#3663912)
You've apparently also suspended his account...?

(http://homakov.blogspot.com/2012/03/im-disappoint-github.htm...)

If this is true, would you please consider unsuspending him? This doesn't seem like a good way to reward this sort of behavior (i.e., helping through hacking).

Re:Hacked: commit to rails master on GitHub by krobertson on Sunday March 04, 2012 @04:05PM (#3663988)
He clearly violated their Terms Of Service:

5. You agree not to reproduce, duplicate, copy, sell, resell or exploit any portion of the Service, use of the Service, or access to the Service without the express written permission by GitHub.

You do something dumb like this, you should live with the consequences. In legal terms, if they don't enforce their TOS, it can be a legal issue later.

I love how he punts on the terms with "but lets get real".

Analogy: You break into a house and get caught. "Oh yeah, laws. But lets get real, I was pointing out they didn't lock their door."

Re:Hacked: commit to rails master on GitHub by tylermenezes on Sunday March 04, 2012 @04:57PM (#3664206)
First he submitted a bug, and they closed it.

Then, he reopened the bug to prove it was a bug, and they closed it again.

Then, he submitted a new bug, 1001 years in the future, and they closed it, saying "Good one ;)"

Then, he committed a text document to master, and they got all upset about it and got Github staff involved.

How about this Ruby devs: actually consider what you're saying. Isn't the point of Ruby to make things simple? Yet, somehow, making rational default choices only applies to everything but this. I know that you love to feel better than everyone else (see: http://37signals.com/svn/posts/3124-give-it-five-minutes), but seriously, you shouldn't get all upset about it later when it turns out you're wrong.

This is why I refuse to learn Ruby. I don't want to be associated with that community. "Learn Ruby if you want to be associated with a bunch of people who call themselves Rockstar Programmers."

Re:Hacked: commit to rails master on GitHub by krobertson on Sunday March 04, 2012 @05:16PM (#3664291)
The "they" in this case being the Rails team and not Github?

A common thread here seems to be grouping Github and Rails.

Its interesting how bring up their Terms Of Service gets discounted and the holy war just takes over. No where did I mention Rails, Ruby, community, or anything else.

Me: He broke the rules. Retort: I like plant.

Disclaimer: The actions of individuals are representative of individuals. Drawing dramatic generalizations accomplishes nothing. Yes, there are more vocal asses in every community. For every asshat there is likely 100 quiet people. Right now, I'm being an asshat.

Gee, homakov is Russian. All Russians must want to hack your site. Really? No, its a dumb generalization.

Re:Hacked: commit to rails master on GitHub by collypops on Sunday March 04, 2012 @06:18PM (#3664531)
"Go looking for serious security holes in Rails? Change defaults so Rails users don't unsuspectingly open themselves up to attack? Fuck that! Let's add CoffeeScript instead. That's how I roll" - DHH*

* Not actually DHH.

Re:Hacked: commit to rails master on GitHub by nwmcsween on Sunday March 04, 2012 @05:15PM (#3664288)
"This is why I refuse to learn Ruby. I don't want to be associated with that community. "Learn Ruby if you want to be associated with a bunch of people who call themselves Rockstar Programmers.""

You refuse to learn a language due to how a project acts? Have you ever read the {open,free,net}BSD or Linux mailing lists? You're not going to make it far in software development with an attitude like that.

Re:Hacked: commit to rails master on GitHub by pp19dd on Monday March 05, 2012 @02:49PM (#3668041)
It's a fairly rational argument to have a preference/affinity for programming languages based on communities surrounding them. He stated his preferences, and that's perfectly fine. You might have been too quick in passing that judgement.

Unless a quantum computing breakthrough alters the way we control computers, there will never be a one-language to rule them all. We'll continue having a wide diaspora and will take evolutionary steps to bind ideas together. Preemptive and comprehensive security model might be just one of those ideas.

Re:Hacked: commit to rails master on GitHub by nwmcsween on Thursday March 08, 2012 @12:23AM (#3678697)
No it's not rational to assume a language isn't worth learning due to how some people act in fact it's ignorant. You use a tool due to it's merit not due to presumption of how everyone acts.
Re:Hacked: commit to rails master on GitHub by Joeboy on Monday March 05, 2012 @07:32AM (#3666293)
I'm not intimate with the Ruby community, but the quality / quantity / culture of the community surrounding a programming language seems like a reasonable consideration to me.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @05:07PM (#3664241)
whoa whoa whoa

Ruby is a really cool language with some fascinating features--don't limit yourself by assuming that you also have to learn the Rails stuff.

Seriously, give it a shot in one of its more palatable forms.

Re:Hacked: commit to rails master on GitHub by masklinn on Sunday March 04, 2012 @05:42PM (#3664394)
> with some fascinating features

If you come from PHP or Java anyway.

Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @05:52PM (#3664437)
yes yes yes

no new genuinely new programming ideas have happened since the 70s and 80s.

Don't be obtuse.

Re:Hacked: commit to rails master on GitHub by masklinn on Sunday March 04, 2012 @06:01PM (#3664476)
There's nothing obtuse about it, new programming ideas have happened since the 70s and 80s but as far as I know none of them is in Ruby, and you're basically assuming tylermenezes does not know about any of the (much older) features which did get into Ruby.
Re:Hacked: commit to rails master on GitHub by lclarkmichalek on Sunday March 04, 2012 @06:12PM (#3664514)
Tell that to STM. Sure most new programming languages are amalgamations of existing concepts, but new stuff does turn up from time to time.
Re:Hacked: commit to rails master on GitHub by Robin_Message on Monday March 05, 2012 @02:54PM (#3668057)
But STM is from the 80s -- 1986 to be precise.
Re:Hacked: commit to rails master on GitHub by chrisumbel on Sunday March 04, 2012 @05:23PM (#3664320)
Indeed, github, Ruby and Rails are all different things. I do recommend approaching language/platform/tool choices form an engineering rather than a social point of view.

Don't get me wrong, though. I can see being turned off by rockstars, but you've found a language unencumbered by them?

Re:Hacked: commit to rails master on GitHub by drogus on Sunday March 04, 2012 @05:32PM (#3664360)
tylermenezes: the first "closed/open" thing was done by accident, @homakove didn't reopen it. I closed the second bug as this was just kind of trolling to get attention, there was no point on keeping it open.
Re:Hacked: commit to rails master on GitHub by wycats on Sunday March 04, 2012 @05:26PM (#3664334)
Not all security vulnerabilities can be protected automatically by a web framework. In many cases, frameworks provide features that developers can use themselves to secure their applications.

Example:

XSS is a common web security problem. In short, it means that putting user-originated data back on the page unescaped is unacceptable. Before Rails 3.0, the Rails approach to this problem was to provide a helper (h), which you could use to escape content that you knew to be vulnerable.

Unfortunately, many Rails users did not use this feature in all places they should have used it. As a result, many applications (Twitter included) suffered from whack-a-mole XSS vulnerabilities.

We were unable to solve this problem in the 2.x branch, because automatically escaping all text being put onto the page would be a massive breaking change and would break every app in existence.

Further, simply escaping all text would not really solve the problem. For example, the "<form>" tag generated by Rails itself should not be escaped, while any of its contents or attributes provided by the application should. Asking the user to take on the responsibility to mark Rails-generated content as not needing escaping would reintroduce the same problem we had before: people would "unescape" things too eagerly, and apps would tend to have vulnerabilities.

The solution was to release a plugin for Rails 2.3 users (rails_xss) and change the default in Rails 3. It isn't perfect: there are still cases where applications have to mark strings as "safe", and applications that have to do so often might have the same problem, but I think we did a good job, all things considered.

This case is quite similar. Rails provides all the tools necessary to have a secure application (attr_accessible is the equivalent of h), but many apps don't use it correctly (or at all). In short, a Rails security default seems to be wrong, insofar as "wrong" means that many people fail to use the security feature, causing their applications to be vulnerable.

As with the XSS feature, fixing this problem requires some thought. Simply changing the default would break a lot of applications in the wild. Like XSS, it's probably correct to do so anyway here. However, like XSS, we should make sure that we have done everything we possibly can to mitigate the additional cost associated with complying with the new default. If it's too painful, many people will overeagerly bypass the feature, reintroducing the very issue we were trying to protect them from.

In this case, I have proposed a solution that I think will mitigate a lot of the problem (https://gist.github.com/1974187), and we will likely ship it as a Rails 3.2 plugin. This will allow us to gather feedback about unexpected consequences and ensure that when we change the default for Rails 4 (which has not even shipped a prerelease yet), it actually mitigates the security problem in the vast majority of Rails applications.

Re:Hacked: commit to rails master on GitHub by DrPizza on Sunday March 04, 2012 @06:07PM (#3664497)
Every C programmer has the tools they need to not create buffer overflows _and yet buffer overflows are abundant_.

Saying "we'll provide the tools and insist that developers use them safely and securely" is a bullshit answer, and always has been.

You're either secure by default, or not at all. In this case, not at all.

Re:Hacked: commit to rails master on GitHub by teyc on Sunday March 04, 2012 @08:50PM (#3665018)
These issues need to be nipped very early on before they get too big to handle. Microsoft was stuck in this situation for many years because they had decided to favour compatibility over security. Rails now has a wide footprint on the web, and it all makes it even more important to enable it to be properly locked down.

I hope this marks a turning point in the way the Rails team think about security.

ps At least Rails no longer allows web crawlers to delete resources by issuing GET requests.

Re:Hacked: commit to rails master on GitHub by patrickaljord on Sunday March 04, 2012 @05:41PM (#3664389)
Re:Hacked: commit to rails master on GitHub by wycats on Sunday March 04, 2012 @05:50PM (#3664426)
I don't necessarily like having to have every ORM/data library have to know about this concern...
Re:Hacked: commit to rails master on GitHub by docwhat on Monday March 05, 2012 @12:34AM (#3665564)
I don't like the suggestion. It enforces a 1:1 relationship between controller and model.

I'd rather have the model and the ORM be pulled apart and the model make this distinction.

Or create another class that knows how to safely pull values out of a params list and use it to create a model.

But it's bad enough that the controllers "look" like they belong to a model in default Rails generators. This creates a certain amount of laxity in programmer's thinking. It boxes their thinking in instead of letting their thinking go free.

Re:Hacked: commit to rails master on GitHub by wasabideveloper on Monday March 05, 2012 @12:52AM (#3665589)
@wycats any chance of you creating a screencast of how to tackle Rails security from your experience with Merb/Rails?

Thanks again for your hard work and being a public voice on the issue.

Re:Hacked: commit to rails master on GitHub by subdigital on Sunday March 04, 2012 @05:13PM (#3664274)
I think you're confusing Ruby with Rails. Flat out refusing to learn a wonderful programming language because you don't agree with it's dominant web framework is silly.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @04:08PM (#3663996)
He didn't exploit anything, technically--that's all in the service API. (thanks Rails!)

More seriously, just because he violated the ToS doesn't mean that they have to be dicks.

Re:Hacked: commit to rails master on GitHub by krobertson on Sunday March 04, 2012 @04:22PM (#3664056)
Where have they been dicks? Please elaborate.

From all appearances, GH is taking it quite seriously. Because it is a serious matter. Egor on the other hand wasn't taking it seriously.

Re:Hacked: commit to rails master on GitHub by cmelbye on Sunday March 04, 2012 @03:58PM (#3663965)
This sort of behavior shouldn't be rewarded, though. He publicly exploited a 0-day vulnerability. He should've responsibly disclosed it to GitHub, and instead he revealed it to the public.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @04:22PM (#3664057)
See here: https://github.com/rails/rails/issues/5228#issuecomment-4290...

This isn't a 0-day vulnerability--this is an issue known to the rails devs, and one which they decided wrongly on. Sometimes you've got to take things to the next level of visibility.

Re:Hacked: commit to rails master on GitHub by cdcarter on Sunday March 04, 2012 @04:43PM (#3664143)
It was a 0-day in github allowing malicious code being committed to any project. Egor never (seemingly) took the appropriate steps to inform anyone of this vulnerability in github.

Whether or not rails' defaults are sane is a completely separate question. Egor acted out against GH when he was ignored by rails dev. Two entirely different parties.

Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @04:54PM (#3664190)
He'd already been ignored by the rails devs.

For a normal project, sure, whatever, but when the security hole is in a framework--especially one as widely deployed as rails--you eventually must cede that, yeah, the fastest way to get something serious fixed is to do a public exploit.

What if he'd submitted the fix to github and they'd quietly patched it and said nothing? What if they'd said something but nobody cared because hey, it's fixed now? What if they'd flat-out ignored it as the rails devs did (perhaps even citing that as their reason)?

No, security only reliably gets addressed when it hurts and hurts publicly.

The combination of hitting the exploit on perhaps the most visible site for the target audience and doing so in a way that didn't harm anything is impressive.

Re:Hacked: commit to rails master on GitHub by elithrar on Sunday March 04, 2012 @04:55PM (#3664192)
> Whether or not rails' defaults are sane is a completely separate question. Egor acted out against GH when he was ignored by rails dev. Two entirely different parties.

100% agree here. The Rails devs may have ignored his issue, but GitHub are the victims here. Why not email GitHub and inform them, on the provision they communicate the fix they just made?

Doing this and saying "P.S. GH sorry, I was bored" is not acceptable.

Re:Hacked: commit to rails master on GitHub by cmelbye on Sunday March 04, 2012 @05:14PM (#3664285)
This is NOT a vulnerability in Rails. If you've ever used Rails, you'll probably be aware that it has several features for preventing things like this from happening (attr_accessible, attr_protected, etc). GitHub failed to use those methods, so it's a vulnerability in GitHub. All sites powered by Rails are not necessarily vulnerable to this, only ones that have not been properly coded using the aforementioned security features.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @05:33PM (#3664362)
"Buffer overflows are not a vulnerability in C. If you've ever used C, you'll probably be aware that has several features for preventing things like this from happening (strlen_s, memmove, etc.). Microsoft failed to use those methods, so it's a vulnerability in Microsoft. All apps powered by C are not necessarily vulnerable to this, only ones that have not been properly coded using the aforementioned security features."

And yet, people have stopped using C for a lot of things because of the security implications...

Look, when Rails is pushed as an out-of-the-box magic web stack--and it is--, and the out-of-the-box config has these problems available--which seems to be the case--maybe there is something to be said for the framework needing fixing.

Just because I can write code that prevents various exploits does not mean I expect the rest of the world to--and I sure as hell don't do so while brandishing about how even beginners can use my tools.

Re:Hacked: commit to rails master on GitHub by grabastic on Sunday March 04, 2012 @03:55PM (#3663953)
His behavior should not be rewarded.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @04:00PM (#3663971)
Why? He didn't cause any harm, disclosed quickly, and only acted after being ignored by the framework community (multiple times, it would seem).

It's not even being "rewarded"--it's being "not punished".

Wouldn't you like to have people spot vulnerabilities on your site and report them promptly without also breaking things? Seems a little ungrateful, yeah?

If we are all going to migrate to the cloud and assume our services (no longer under our control) are handled competently, we must place a higher premium on vetting that competency.

Re:Hacked: commit to rails master on GitHub by grabastic on Sunday March 04, 2012 @04:33PM (#3664092)
So if you had a vulnerable product and this gentleman altered one of your customer's pages without permission you would be grateful? That is strange to me.
Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @04:43PM (#3664145)
Provided that the he did so and made the change public, and the modification was not malicious?

Yes. I'd even send him a thank-you email, and add him to our list of contributors.

I'd then of course contact the customer (probably over phone, as quickly as possible), explain the vulnerability, explain what happened, and explain how we were fixing it. Then I'd write a post about it, and put it on the front of the site.

That's how you do business.

Re:Hacked: commit to rails master on GitHub by grabastic on Sunday March 04, 2012 @04:57PM (#3664204)
"Hey customer, someone hacked your page thanks to a vulnerability in my service, but don't worry... I've added him as a contributor to my project and sent him a thank you email."

Like that?

Re:Hacked: commit to rails master on GitHub by angersock on Sunday March 04, 2012 @05:24PM (#3664326)
More like:

"Dear Grabastic,

Today we had a demonstration by a user (xxx) of a security vulnerability on our site.

${VULNERABILITY_EXPLANATION}

We believe that it is possible that your application or records are covered in the scope of the exploit, because of the fact that ${VULNERABILITY_APPLICATION}.

In order to fix this issue, we have ${VULNERABILITY_PATCH}.

We have thanked this user for their vigilance in spotting bugs and security weaknesses in our site, and they have been added to our contributors-security page here (link).

We have a stance that security is something that can only be improved by lots of inquisitive eyes, and so if you have seen any issues that concern you, please do not hesitate to inform us and/or demonstrate the vulnerability--provided, of course, you do so without breaking anything permanently. :)

Our service is better today than it was yesterday, and we hope that with the patience and openness of our users it will be still better tommorrow!

Sincerely, angersock "

See, not so hard!

Re:Hacked: commit to rails master on GitHub by grabastic on Sunday March 04, 2012 @05:35PM (#3664369)
Not bad. You won me over. :)
Re:Hacked: commit to rails master on GitHub by nailer on Monday March 05, 2012 @05:02AM (#3666050)
What if the customer is panicing, because the message looked like:

+another showcase of rails apps vunlerability. 2 +Github pwned. again :( 3 +will you pay me for security audit?

It kinda sounds like you've succumbed to an extortion demand.

Re:Hacked: commit to rails master on GitHub by Mikushi on Sunday March 04, 2012 @05:00PM (#3664214)
Well, if like in this case, he warned me and I told him to "fuck off", I kinda would be grateful, even more like "Should've seen that one coming...".
Re:Hacked: commit to rails master on GitHub by sanderjd on Sunday March 04, 2012 @06:21PM (#3664546)
I've yet to see any of the people conflating the Rails repository with the Github team reply to any of the (many) people in this thread pointing out that creating a ticket in the Rails repository is in no way the same as warning the Github team, so I'm really curious - is there general confusion about where the lines are between Github and Rails, or are you just being obstinate?