cbcvebase.
CVE-2019-5420
published 2019-03-27

CVE-2019-5420: A remote code execution vulnerability in development mode Rails <5.2.2.1, <6.0.0.beta3 can allow an attacker to guess the automatically generated development…

PriorityP181critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
89.33%
99.8th percentile
A remote code execution vulnerability in development mode Rails <5.2.2.1, <6.0.0.beta3 can allow an attacker to guess the automatically generated development mode secret token. This secret token can be used in combination with other Rails internals to escalate to a remote code execution exploit.

Affected

11 ranges
VendorProductVersion rangeFixed in
debiandebian_linux——
debianrails< rails 2:5.2.2.1+dfsg-1 (bookworm)rails 2:5.2.2.1+dfsg-1 (bookworm)
fedoraprojectfedora——
railshttps_github.com_rails_rails——
railshttps_github.com_rails_rails——
rubyonrailsrails< 5.2.2.15.2.2.1
rubyonrailsrails——
rubyonrailsrails>= 0 < 2:5.2.2.1+dfsg-12:5.2.2.1+dfsg-1
rubyonrailsrails>= 0 < 2:5.2.2.1+dfsg-12:5.2.2.1+dfsg-1
rubyonrailsrails>= 0 < 2:5.2.2.1+dfsg-12:5.2.2.1+dfsg-1
rubyonrailsrails>= 0 < 2:5.2.2.1+dfsg-12:5.2.2.1+dfsg-1

Detection & IOCsextracted from sources · hover to see the quote

port3000↗
url/rails/active_storage/disk/{rails_payload}/test↗
  • →Attacker probes an invalid/random path under /rails/ to leak Rails.root and derive the application name, which is used as the secret_key_base in development mode. ↗
  • →Exploit delivers a signed, serialized (Marshal) payload via a GET request to /rails/active_storage/disk/<payload>/test — monitor for unusually long or base64-like path segments on this route. ↗
  • →Exploit drops base64-encoded and binary payload files in /tmp with random .bin names; monitor for unexpected .bin file creation in /tmp by the Rails process. ↗
  • →The exploit targets Rails applications running on the default development port 3000; restrict or monitor external access to port 3000. ↗
  • →In development mode, Rails uses the application name as the secret_key_base; an attacker can extract the app name from the Rails.root error page and forge signed serialized payloads. ↗
  • →The exploit is logged in application logs (IOC_IN_LOGS); review Rails logs for GET requests to /rails/active_storage/disk/ with anomalously large path segments. ↗
  • ·Vulnerability only affects Rails applications running in development mode; production deployments with a properly set secret_key_base are not affected. ↗
  • ·Red Hat Software Collections versions rh-ror42-rubygem-rails and rh-ror50-rubygem-rails were confirmed not affected as they did not include the vulnerable commit. ↗
  • ·The vulnerable behavior was introduced by a specific Rails commit; verify whether the commit is present before treating an installation as affected. ↗

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.5HIGHAV:N/AC:L/Au:N/C:P/I:P/A:P
osv9.8CRITICAL
vendor_debian9.8CRITICAL
vendor_redhat9.8CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.