CVE-2009-4214: Rails Moderate Severity Vulnerability That Affects Vulnerability

MODERATE
Advisory Identifier: GHSA-9p3v-wf2w-v29c
CWE-79
Published
Advisory Summary

CVE-2009-4214 is a MODERATE moderate severity vulnerability that affects vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Rails libraries in the RubyGems ecosystem. The issue involves moderate severity vulnerability that affects rails. Remediation is available by upgrading affected packages to version 2.2.2, 2.3.5.

CVE-2009-4214 at a Glance

CVE Identifier CVE-2009-4214
GHSA Identifier GHSA-9p3v-wf2w-v29c
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Rails
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2009-4214

To remediate this vulnerability, upgrade all affected Rails dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

rails fixed: 2.2.2
Upgrade rails to 2.2.2
rails fixed: 2.3.5
Upgrade rails to 2.3.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for rails

How to Check if You Are Affected

To determine whether your application is affected by CVE-2009-4214, inspect your project dependencies for Rails:

inspect dependencies for rails

Analyze the terminal output to locate any version of Rails in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Rails, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Cross-site scripting (XSS) vulnerability in the strip_tags function in Ruby on Rails before 2.2.s, and 2.3.x before 2.3.5, allows remote attackers to inject arbitrary web script or HTML via vectors involving non-printing ASCII characters, related to HTML::Tokenizer and actionpack/lib/action_controller/vendor/html-scanner/html/node.rb.

CVE-2009-4214 Affected Rails Versions

2 component(s)
Fixed Versions:
2.2.22.3.5
Product / Package Ecosystem Affected Versions Fixed Version
rails
RubyGems
< 2.2.2
2.2.2
rails
RubyGems
≥ 2.3.0
< 2.3.5
2.3.5

References

NVD — CVE-2009-4214 NVD
https://nvd.nist.gov/vuln/detail/CVE-2009-4214
GitHub Advisory / Wiki ADVISORY
https://github.com/advisories/GHSA-9p3v-wf2w-v29c
Rails Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails/CVE-2009-4214.yml
Rails Source Repository REPOSITORY
http://github.com/rails/rails
Security Fix Commit FIX COMMIT
http://github.com/rails/rails/commit/bfe032858077bb2946abe25e95e485ba6da86bd5
Rails Security Information SECURITY
http://groups.google.com/group/rubyonrails-security/browse_thread/thread/4d4f71f2aef4c0ab?pli=1
Rails Security Information SECURITY
http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html
Rails Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2010-03/msg00004.html
secunia.com/advisories/37446 WEB
http://secunia.com/advisories/37446
secunia.com/advisories/38915 WEB
http://secunia.com/advisories/38915
support.apple.com/kb/ht4077 WEB
http://support.apple.com/kb/HT4077
Rails Release RELEASE
http://weblog.rubyonrails.org/2009/11/30/ruby-on-rails-2-3-5-released
Rails Security Information SECURITY
http://www.debian.org/security/2011/dsa-2260
Rails Security Information SECURITY
http://www.debian.org/security/2011/dsa-2301
Rails Security Information SECURITY
http://www.openwall.com/lists/oss-security/2009/11/27/2
Rails Security Information SECURITY
http://www.openwall.com/lists/oss-security/2009/12/08/3
Rails Security Information SECURITY
http://www.securityfocus.com/bid/37142
Rails Security Information SECURITY
http://www.securitytracker.com/id?1023245
www.vupen.com/english/advisories/... WEB
http://www.vupen.com/english/advisories/2009/3352

Frequently Asked Questions

What is CVE-2009-4214?
CVE-2009-4214 is a security vulnerability in Rails involving Moderate severity vulnerability that affects rails under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Rails versions are affected?
Affected versions include releases prior to 2.2.2, 2.3.5 across affected packages: rails.
What version fixes CVE-2009-4214?
Upgrading to 2.2.2, 2.3.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rails affected?
Yes, rails is affected in releases prior to 2.2.2, 2.3.5. Upgrade your dependency to 2.2.2, 2.3.5 or later.
What CWE is associated with CVE-2009-4214?
CVE-2009-4214 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for CVE-2009-4214?
Run the dependency tree command: 'inspect dependencies for rails'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9p3v-wf2w-v29c",
  "modified" : "2025-04-09T19:53:05Z",
  "published" : "2017-10-24T18:33:38Z",
  "aliases" : [ "CVE-2009-4214" ],
  "summary" : "Moderate severity vulnerability that affects rails",
  "details" : "Cross-site scripting (XSS) vulnerability in the strip_tags function in Ruby on Rails before 2.2.s, and 2.3.x before 2.3.5, allows remote attackers to inject arbitrary web script or HTML via vectors involving non-printing ASCII characters, related to HTML::Tokenizer and actionpack/lib/action_controller/vendor/html-scanner/html/node.rb.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "fixed" : "2.3.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2009-4214"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-9p3v-wf2w-v29c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails/CVE-2009-4214.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "http://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "http://github.com/rails/rails/commit/bfe032858077bb2946abe25e95e485ba6da86bd5"
  }, {
    "type" : "WEB",
    "url" : "http://groups.google.com/group/rubyonrails-security/browse_thread/thread/4d4f71f2aef4c0ab?pli=1"
  }, {
    "type" : "WEB",
    "url" : "http://lists.apple.com/archives/security-announce/2010//Mar/msg00001.html"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2010-03/msg00004.html"
  }, {
    "type" : "WEB",
    "url" : "http://secunia.com/advisories/37446"
  }, {
    "type" : "WEB",
    "url" : "http://secunia.com/advisories/38915"
  }, {
    "type" : "WEB",
    "url" : "http://support.apple.com/kb/HT4077"
  }, {
    "type" : "WEB",
    "url" : "http://weblog.rubyonrails.org/2009/11/30/ruby-on-rails-2-3-5-released"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2011/dsa-2260"
  }, {
    "type" : "WEB",
    "url" : "http://www.debian.org/security/2011/dsa-2301"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2009/11/27/2"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2009/12/08/3"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/37142"
  }, {
    "type" : "WEB",
    "url" : "http://www.securitytracker.com/id?1023245"
  }, {
    "type" : "WEB",
    "url" : "http://www.vupen.com/english/advisories/2009/3352"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:29:07Z",
    "nvd_published_at" : "2009-12-07T17:30:00Z"
  }
}