News for hackers. Stuff that matters.
Re:CVE-2019-5418 – File Content Disclosure on Rails by aboutruby on Thursday March 21, 2019 @05:28PM (#19457527)
This was fixed in 6.0.0.beta3, 5.2.2.1, 5.1.6.2, 5.0.7.2, 4.2.11.1 one week ago.

https://weblog.rubyonrails.org/2019/3/13/Rails-4-2-5-1-5-1-6...

The two HN posts didn't get many upvotes though: https://hn.algolia.com/?query=https:%2F%2Fweblog.rubyonrails...

Admittedly there is probably a lot of applications out there running outdated versions.

edit: Kind of surprising this gets upvoted while we rarely see things from exploit-db / fulldisclosure

Re:CVE-2019-5418 – File Content Disclosure on Rails by anitil on Thursday March 21, 2019 @06:33PM (#19458020)
I'm a bit confused here, perhaps because I don't really understand Rails (possibly also the HTML spec).

I was under the impression the 'Accept:' header is a list of media types, so why would that be making filesystem calls? Or does Rails implicitly organize assets in a filesystem structure (something like ~/assets/audio or ~/assets/text)?

Re:CVE-2019-5418 – File Content Disclosure on Rails by archgoon on Thursday March 21, 2019 @06:45PM (#19458107)
The technical analysis (from the article), complete with a step by step trace walkthrough, is here:

https://chybeta.github.io/2019/03/16/Analysis-for%E3%80%90CV...

Also, if interested, direct link to patch fix:

https://github.com/rails/rails/commit/f4c70c2222180b8d9d924f...

Re:CVE-2019-5418 – File Content Disclosure on Rails by anitil on Thursday March 21, 2019 @07:31PM (#19458373)
Thanks for that, I was missing the step that assets are named $filename.$mime-type.erb in Rails. I was missing the high-level view
Re:CVE-2019-5418 – File Content Disclosure on Rails by tptacek on Thursday March 21, 2019 @06:35PM (#19458032)
Because the media types are parsed and used to select layout templates (layout.html.erb vs layout.xml.erb, etc).
Re:CVE-2019-5418 – File Content Disclosure on Rails by Something1234 on Thursday March 21, 2019 @06:45PM (#19458101)
So why wouldn't we just have a mapping between mime-types and extensions for look ups? Why bother examining the accept header beyond splitting and searching within the list? Like in such a way that we're opening arbitrary files with it?
Re:CVE-2019-5418 – File Content Disclosure on Rails by tptacek on Thursday March 21, 2019 @06:48PM (#19458125)
That's essentially what the patch does; the "symbol" call only resolves for known-good mime types.
Re:CVE-2019-5418 – File Content Disclosure on Rails by Something1234 on Thursday March 21, 2019 @06:56PM (#19458188)
Where would this code be in the rails code base? I usually don't touch ruby. I'm mildly curious what was there originally.
Re:CVE-2019-5418 – File Content Disclosure on Rails by tptacek on Thursday March 21, 2019 @06:59PM (#19458211)
In the template resolver in ActionView. It's spread over multiple files and a bit hard to follow, which no doubt contributed to the problem.
Re:CVE-2019-5418 – File Content Disclosure on Rails by lostapathy on Thursday March 21, 2019 @09:47PM (#19459010)
Unfortunately a lot of rails internals are like this :(.
Re:CVE-2019-5418 – File Content Disclosure on Rails by anitil on Thursday March 21, 2019 @06:42PM (#19458082)
Aaaah Thankyou!
Re:CVE-2019-5418 – File Content Disclosure on Rails by xtagon on Friday March 22, 2019 @02:24AM (#19460048)
So it's a problem in ActionView, and fixed in 5.1.6.2...then why does the changelog for ActionView for 5.1.6.2 say "No changes"?

https://github.com/rails/rails/blob/5-1-stable/actionview/CH...

Re:CVE-2019-5418 – File Content Disclosure on Rails by aboutruby on Friday March 22, 2019 @06:48AM (#19461222)
It's actually in ActionPack / Railties but I've raised the issue:

https://github.com/rails/rails/issues/35702

Re:CVE-2019-5418 – File Content Disclosure on Rails by xtagon on Friday March 22, 2019 @12:22PM (#19464071)
Great, thank you! Do most people just follow the blog instead of checking the changelog?
Re:CVE-2019-5418 – File Content Disclosure on Rails by aboutruby on Friday March 22, 2019 @03:53PM (#19466256)
It's kind of all other the place but there is: blog, twitter, mailling list, github, brakeman, and all the little rails communities informing each others.