{"id":"CVE-2020-8165","aliases":["CVE-2020-8165","GHSA-2p68-f74v-9wc6"],"related":[],"kind":"vulnerability","state":"published","title":"ActiveSupport potentially unintended unmarshalling of user-provided objects in MemCacheStore and RedisCacheStore","summary":"A deserialization of untrusted data vulnernerability exists in rails < 5.2.4.3, rails < 6.0.3.1 that can allow an attacker to unmarshal user-provided objects in MemCacheStore and RedisCacheStore potentially resulting in an RCE.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"A deserialization of untrusted data vulnernerability exists in rails < 5.2.4.3, rails < 6.0.3.1 that can allow an attacker to unmarshal user-provided objects in MemCacheStore and RedisCacheStore potentially resulting in an RCE.","source":"cvelist"},{"lang":"en","text":"In ActiveSupport, there is potentially unexpected behaviour in the MemCacheStore and RedisCacheStore where, when\nuntrusted user input is written to the cache store using the `raw: true` parameter, re-reading the result\nfrom the cache can evaluate the user input as a Marshalled object instead of plain text. Vulnerable code looks like:\n\n```\ndata = cache.fetch(\"demo\", raw: true) { untrusted_string }\n```\nVersions Affected:  rails < 5.2.5, rails < 6.0.4\nNot affected:       Applications not using MemCacheStore or RedisCacheStore. Applications that do not use the `raw` option when storing untrusted user input.\nFixed Versions:     rails >= 5.2.4.3, rails >= 6.0.3.1\n  \nImpact\n------\nUnmarshalling of untrusted user input can have impact up to and including RCE. At a minimum,\nthis vulnerability allows an attacker to inject untrusted Ruby objects into a web application.\nIn addition to upgrading to the latest versions of Rails, developers should ensure that whenever\nthey are calling `Rails.cache.fetch` they are using consistent values of the `raw` parameter for both\nreading and writing, especially in the case of the RedisCacheStore which does not, prior to these changes,\ndetect if data was serialized using the raw option upon deserialization.\n\nWorkarounds\n-----------\nIt is recommended that application developers apply the suggested patch or upgrade to the latest release as\nsoon as possible. If this is not possible, we recommend ensuring that all user-provided strings cached using\nthe `raw` argument should be double-checked to ensure that they conform to the expected format.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se presenta una vulnerabilidad de deserialización de datos no confiables en rails versiones anteriores a 5.2.4.3, rails versiones anteriores a 6.0.3.1, que puede permitir a un atacante desarmar los objetos proporcionados por el usuario en MemCacheStore y RedisCacheStore, lo que podría generar un RCE","source":"nvd"}],"published":"2020-05-26T14:49:24.000Z","modified":"2026-06-17T03:25:58.407Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"version":"Fixed in 5.2.4.3, 6.0.3.1","status":"affected"}],"product":"https://github.com/rails/rails","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"5.0.0","status":"affected","fixed":"5.2.4.3"}],"ecosystem":"RubyGems","package":"activesupport","purl":"pkg:gem/activesupport","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"6.0.3.1"}],"ecosystem":"RubyGems","package":"activesupport","purl":"pkg:gem/activesupport","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"5.2.4.3"},{"status":"affected","introduced":"6.0.0","fixed":"6.0.3.1"}],"vendor":"rubyonrails","product":"rails","cpe":"cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"8.0"},{"status":"affected","version":"9.0"},{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:8.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"15.1"},{"status":"affected","version":"15.2"}],"vendor":"opensuse","product":"leap","cpe":"cpe:2.3:o:opensuse:leap:15.1:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://hackerone.com/reports/413388","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://groups.google.com/g/rubyonrails-security/c/bv6fW4S0Y1c","tags":["mailing-list","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2020/06/msg00022.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://weblog.rubyonrails.org/2020/5/18/Rails-5-2-4-3-and-6-0-3-1-have-been-released/","tags":["vendor-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2020/07/msg00013.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.debian.org/security/2020/dsa-4766","tags":["third-party-advisory","vendor-advisory","web","x-refsource-debian","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2020-10/msg00031.html","tags":["mailing-list","third-party-advisory","vendor-advisory","web","x-refsource-suse","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"http://lists.opensuse.org/opensuse-security-announce/2020-10/msg00034.html","tags":["mailing-list","third-party-advisory","vendor-advisory","web","x-refsource-suse","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.netapp.com/advisory/ntap-20250509-0002/","tags":[],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2020-8165","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2020-8165.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://groups.google.com/forum/#!topic/rubyonrails-security/bv6fW4S0Y1c","tags":["web"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20250509-0002","tags":["web"],"sources":["ghsa"]},{"url":"https://weblog.rubyonrails.org/2020/5/18/Rails-5-2-4-3-and-6-0-3-1-have-been-released","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"hackerone","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2020-8165","url":"https://www.cve.org/CVERecord?id=CVE-2020-8165","licence":"CVE Terms of Use","modified":"2025-05-09T20:03:28.191Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2p68-f74v-9wc6","url":"https://github.com/advisories/GHSA-2p68-f74v-9wc6","licence":"CC-BY-4.0","modified":"2025-05-09T22:03:05.053Z"},{"source":"nvd","name":"NVD","id":"CVE-2020-8165","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-8165","licence":"Public domain","modified":"2026-06-17T03:25:58.407Z"}],"updatedAt":"2026-11-25T22:57:53.049Z","epss":{"score":0.45732,"percentile":0.98823,"date":"2026-12-01T12:00:22.000Z"}}