[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oss-security
Subject:    [oss-security] [CVE-2015-7581] Object leak vulnerability for wildcard controller routes in Action Pa
From:       Aaron Patterson <tenderlove () ruby-lang ! org>
Date:       2016-01-25 19:40:08
Message-ID: 20160125194008.GI14069 () TC ! local
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Object leak vulnerability for wildcard controller routes in Action Pack

There is an object leak vulnerability for wildcard controllers in Action Pack.
This vulnerability has been assigned the CVE identifier CVE-2015-7581.

Versions Affected:  >= 4.0.0 and < 5.0.0.beta1
Not affected:       < 4.0.0, 5.0.0.beta1 and newer
Fixed Versions:     4.2.5.1, 4.1.14.1

Impact
------
Users that have a route that contains the string ":controller" are susceptible
to objects being leaked globally which can lead to unbounded memory growth.
To identify if your application is vulnerable, look for routes that contain
":controller".

Internally, Action Pack keeps a map of "url controller name" to "controller
class name".  This map is cached globally, and is populated even if the
controller class doesn't actually exist.

All users running an affected release should either upgrade or use one of the
workarounds immediately.

Releases
--------
The FIXED releases are available at the normal locations.

Workarounds
-----------
There are no feasible workarounds for this issue.

Patches
-------
To aid users who aren't able to upgrade immediately we have provided patches for the two \
supported release series.  They are in git-am format and consist of a single changeset.

* 4-1-wildcard_route.patch - Patch for 4.1 series
* 4-2-wildcard_route.patch - Patch for 4.2 series

Please note that only the 4.1.x and 4.2.x series are supported at present.  Users of earlier \
unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the \
continued availability of security fixes for unsupported releases.

Credits
-------

-- 
Aaron Patterson
http://tenderlovemaking.com/


["4-1-wildcard_route.patch" (text/plain)]

From fb790341d0ea25ad91116c283d49a2c83a8ea299 Mon Sep 17 00:00:00 2001
From: eileencodes <eileencodes@gmail.com>
Date: Fri, 21 Aug 2015 11:26:19 -0400
Subject: [PATCH] Remove unnecessary caching

`ActiveSupport::Dependencies.constantize(const_name)` calls
`Reference.new` which is defined as
`ActiveSupport::Dependencies.constantize(const_name)` meaning this call
is already cached and we're doing caching that isn't necessary.

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

CVE-2015-7581
---
 actionpack/lib/action_dispatch/routing/route_set.rb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb \
b/actionpack/lib/action_dispatch/routing/route_set.rb index 51dd607..5f727fd 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -1,6 +1,5 @@
 require 'action_dispatch/journey'
 require 'forwardable'
-require 'thread_safe'
 require 'active_support/concern'
 require 'active_support/core_ext/object/to_query'
 require 'active_support/core_ext/hash/slice'
@@ -24,7 +23,6 @@ module ActionDispatch
         def initialize(options={})
           @defaults = options[:defaults]
           @glob_param = options.delete(:glob)
-          @controller_class_names = ThreadSafe::Cache.new
         end
 
         def call(env)
@@ -74,7 +72,7 @@ module ActionDispatch
       private
 
         def controller_reference(controller_param)
-          const_name = @controller_class_names[controller_param] ||= \
"#{controller_param.camelize}Controller" +          const_name = \
"#{controller_param.camelize}Controller"  ActiveSupport::Dependencies.constantize(const_name)
         end
 
-- 
2.2.1


["4-2-wildcard_route.patch" (text/plain)]

From a32c6b06f1f4367e541db2f096e1426d80155329 Mon Sep 17 00:00:00 2001
From: eileencodes <eileencodes@gmail.com>
Date: Fri, 21 Aug 2015 11:26:19 -0400
Subject: [PATCH] Remove unnecessary caching

`ActiveSupport::Dependencies.constantize(const_name)` calls
`Reference.new` which is defined as
`ActiveSupport::Dependencies.constantize(const_name)` meaning this call
is already cached and we're doing caching that isn't necessary.

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

CVE-2015-7581
---
 actionpack/lib/action_dispatch/routing/route_set.rb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb \
b/actionpack/lib/action_dispatch/routing/route_set.rb index 7ef9c0a..2834dd4 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -1,6 +1,5 @@
 require 'action_dispatch/journey'
 require 'forwardable'
-require 'thread_safe'
 require 'active_support/concern'
 require 'active_support/core_ext/object/to_query'
 require 'active_support/core_ext/hash/slice'
@@ -26,7 +25,6 @@ module ActionDispatch
       class Dispatcher < Routing::Endpoint
         def initialize(defaults)
           @defaults = defaults
-          @controller_class_names = ThreadSafe::Cache.new
         end
 
         def dispatcher?; true; end
@@ -68,7 +66,7 @@ module ActionDispatch
       private
 
         def controller_reference(controller_param)
-          const_name = @controller_class_names[controller_param] ||= \
"#{controller_param.camelize}Controller" +          const_name = \
"#{controller_param.camelize}Controller"  ActiveSupport::Dependencies.constantize(const_name)
         end
 
-- 
2.2.1


[Attachment #7 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic