Aerosol Posted March 1, 2015 Report Posted March 1, 2015 Title: xaviershay-dm-rails v0.10.3.8 mysql credential exposureAuthor: Larry W. Cashdollar, @_larry0Date: 2015-02-17Download Site: https://rubygems.org/gems/xaviershay-dm-railsVendor: Martin Gamsjaeger, Dan KubbVendor Notified: 2015-02-17Vendor Contact: notreal [at] rhnh.netDescription: This gem provides the railtie that allows datamapper to hook into rails3 and thus behave like a rails framework component. Just like activerecord does in rails, dm-rails uses the railtie API to hook into rails. The two are actually hooked into rails almost identically.Vulnerability:The problem is with the execute function exposing the user credentials to the process table.Lines 169 - 177 in /datamapper/dm-rails/blob/master/lib/dm-rails/storage.rb: def execute(statement) system( 'mysql', (username.blank? ? '' : "--user=#{username}"), (password.blank? ? '' : "--password=#{password}"), '-e', statement ) endOSVDB:118579Exploit Code: • $ while (true) do ps -ef |grep [p]assword; doneAdvisory: http://www.vapid.dhs.org/advisory.php?v=115Source Quote