Description
Ruby on Rails 2.1 before 2.1.3 and 2.2.x before 2.2.2 does not verify tokens for requests with certain content types, which allows remote attackers to bypass cross-site request forgery (CSRF) protection for requests to applications that rely on this protection, as demonstrated using text/plain.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | rails | 2.2.3-1 | — |
| Debian 13 | rails | 2.2.3-1 | — |
| Debian 12 | rails | 2.2.3-1 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- Ruby on Rails 2.3.5 - 'protect_from_forgery' Cross-Site Request Forgery EDB-33402 · remote · Dec 14, 2009 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| RubyGems | actionpack | >= 2.1.0, < 2.1.3 | 2.1.3 | GHSA-8fqx-7pv4-3jwm |
| RubyGems | actionpack | >= 2.2.0, < 2.2.2 | 2.2.2 | GHSA-8fqx-7pv4-3jwm |
References
- [oss-security] 20091128 CVE request: Ruby on Rails: CSRF circumvention (from 2008) mailing-list
- http://www.rorsecurity.info/journal/2008/11/19/circumvent-rails-csrf-protection.html
- 36600 third-party-advisory
- http://pseudo-flaw.net/content/web-browsers/form-data-encoding-roundup/
- http://weblog.rubyonrails.org/2008/11/18/potential-circumvention-of-csrf-protection-in-rails-2-1
- ADV-2009-2544 vdb-entry
- http://groups.google.com/group/rubyonrails-security/browse_thread/thread/d741ee286e36e301?hl=en
- SUSE-SR:2010:006 vendor-advisory
- [oss-security] 20091202 Re: CVE request: Ruby on Rails: CSRF circumvention (from 2008) mailing-list
- 38915 third-party-advisory