[CVE-2020-8151] Possible information disclosure issue in Active Resource

1,190 views
Skip to first unread message

Aaron Patterson

unread,
May 5, 2020, 7:17:47 PM5/5/20
to rubyonrail...@googlegroups.com, ruby-sec...@googlegroups.com
There is a possible information disclosure issue in Active Resource. This vulnerability has been assigned the CVE identifier CVE-2020-8151.

Versions Affected: All.
Not affected: None.
Fixed Versions: 5.1.1

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
```

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.

* 5-1-encode-id-param.patch

Credits
-------

Thanks to Jobert Abma from HackerOne for reporting this!
5-1-encode-id-param.patch
Reply all
Reply to author
Forward
0 new messages