activeresource 2.0.5

2 security vulnerabilities found in version 2.0.5

activeresource Gem for Ruby lib/active_resource/connection.rb request Function Multiple Variable Format String

high severity OSVDB-95749
high severity OSVDB-95749
Patched versions: >= 2.2.0

activeresource contains a format string flaw in the request function of lib/active_resource/connection.rb. The issue is triggered as format string specifiers (e.g. %s and %x) are not properly sanitized in user-supplied input when passed via the 'result.code' and 'result.message' variables. This may allow a remote attacker to cause a denial of service or potentially execute arbitrary code.

activeresource Gem for Ruby lib/active_resource/base.rb element_path Lack of Encoding

high severity CVE-2020-8151
high severity CVE-2020-8151
Patched versions: >= 5.1.1

activeresource contains a lack of encoding flaw in the element_path function of lib/active_resource/base.rb.

There is an issue with the way Active Resource encodes data before querying the back end server. This encoding mechanism can allow specially crafted requests to possibly access data that may not be expected.

Impacted code will look something like this:

require 'activeresource'

class Test < ActiveResource::Base
  self.site = 'http://127.0.0.1:3000'
end

Test.exists?(untrusted_user_input)

Where untrusted user input is passed to an Active Resource model. Specially crafted untrusted input can cause Active Resource to access data in an unexpected way and possibly leak information.

Workarounds

For those that can't upgrade, the following monkey patch can be applied:

module ActiveResource
 class Base
   class << self
     def element_path(id, prefix_options = {}, query_options = nil)
       check_prefix_options(prefix_options)

       prefix_options, query_options = split_options(prefix_options) if query_options.nil?
       "#{prefix(prefix_options)}#{collection_name}/#{URI.encode_www_form_component(id.to_s)}#{format_extension}#{query_string(query_options)}"
     end
   end
 end
end

No officially reported memory leakage issues detected.


This gem version does not have any officially reported memory leaked issues.

Gem version without a license.


Unless a license that specifies otherwise is included, nobody can use, copy, distribute, or modify this library without being at risk of take-downs, shake-downs, or litigation.

This gem version is available.


This gem version has not been yanked and is still available for usage.