News for hackers. Stuff that matters.
Re:CVE-2019-5418 – File Content Disclosure on Rails by tptacek on Thursday March 21, 2019 @06:34PM (#19458027)
This is a really bad bug. Arbitrary file read on Rails applications can be pretty close to RCE. Worse still, it's present in all the mainstream versions of Rails, so it'll be lurking in commercial Rails applications for years to come. It's pretty amazing that the bug lasted as long as it did.
Re:CVE-2019-5418 – File Content Disclosure on Rails by aboutruby on Thursday March 21, 2019 @07:49PM (#19458466)
Good call, I went through the top results on Google and edited the answers/posted a comment to signal this vulnerability.

Also as others pointed out, this is a pretty rare use of `render` (but any application large enough might have it).

Re:CVE-2019-5418 – File Content Disclosure on Rails by msbarnett on Thursday March 21, 2019 @06:53PM (#19458160)
Notably, though, this only impacts calls which use the `file:` option on render calls, which in my experience is a relatively little-used feature. Not sure how many commercial Rails app this actually impacts in practice.
Re:CVE-2019-5418 – File Content Disclosure on Rails by tptacek on Thursday March 21, 2019 @07:02PM (#19458230)
I'm not sure why people think this feature is so rare. It's like the Stack Overflow answer for "how do I render a static 404 page that doesn't go through Rails layout templating".

You have to do something wrong to have the bug --- render a file without specifying the format --- but you have to do something extra to avoid that mistake, and the feature works just fine if you don't, so I'm not surprised that we've found it in real applications.

Re:CVE-2019-5418 – File Content Disclosure on Rails by tibbon on Thursday March 21, 2019 @07:08PM (#19458271)
Were I evil, I'd be looking at anyone who has upvoted or commented on such SO posts, and then looking at what companies they work for, and trying to run attacks against every site/repo/app they are linked to to see if they use this technique.

Or just, you know, looking in Github for anyone doing this and open sourcing their site.

Re:CVE-2019-5418 – File Content Disclosure on Rails by mbell on Thursday March 21, 2019 @06:54PM (#19458167)
It requires a specific usage of `render` that is extremely rare. I've never seen it in a real application.
Re:CVE-2019-5418 – File Content Disclosure on Rails by tptacek on Thursday March 21, 2019 @06:57PM (#19458198)
All it requires is "render :file" without the optional format argument. We found it immediately in applications, and other people on our Slack found it in theirs as well (though not necessarily exploitable, situationally).
Re:CVE-2019-5418 – File Content Disclosure on Rails by mbell on Thursday March 21, 2019 @07:56PM (#19458502)
I'm aware of the trigger, `render file:` is, in my experience, extremely rare. I can't recall ever wanting to render a template file located outside the application directory.