CVE-2007-3227: Rails Moderate Severity Vulnerability That Affects Vulnerability

MODERATE
Advisory Identifier: GHSA-gm25-fpmr-43fj
CWE-79
Published
Advisory Summary

CVE-2007-3227 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 1.2.5.

CVE-2007-3227 at a Glance

CVE Identifier CVE-2007-3227
GHSA Identifier GHSA-gm25-fpmr-43fj
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-2007-3227

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: 1.2.5
Upgrade rails to 1.2.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-2007-3227, 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 1.2.5), 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 to_json (ActiveRecord::Base#to_json) function in Ruby on Rails before edge 9606 allows remote attackers to inject arbitrary web script via the input values.

CVE-2007-3227 Affected Rails Versions

1 component(s)
Fixed Versions:
1.2.5
Product / Package Ecosystem Affected Versions Fixed Version
rails
RubyGems
< 1.2.5
1.2.5

References

Frequently Asked Questions

What is CVE-2007-3227?
CVE-2007-3227 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 1.2.5 across affected packages: rails.
What version fixes CVE-2007-3227?
Upgrading to 1.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rails affected?
Yes, rails is affected in releases prior to 1.2.5. Upgrade your dependency to 1.2.5 or later.
What CWE is associated with CVE-2007-3227?
CVE-2007-3227 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-2007-3227?
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-gm25-fpmr-43fj",
  "modified" : "2025-04-09T15:18:55Z",
  "published" : "2017-10-24T18:33:38Z",
  "aliases" : [ "CVE-2007-3227" ],
  "summary" : "Moderate severity vulnerability that affects rails",
  "details" : "Cross-site scripting (XSS) vulnerability in the to_json (ActiveRecord::Base#to_json) function in Ruby on Rails before edge 9606 allows remote attackers to inject arbitrary web script via the input values.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rails"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2007-3227"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-gm25-fpmr-43fj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails/CVE-2007-3227.yml"
  }, {
    "type" : "WEB",
    "url" : "http://bugs.gentoo.org/show_bug.cgi?id=195315"
  }, {
    "type" : "WEB",
    "url" : "http://dev.rubyonrails.org/ticket/8371"
  }, {
    "type" : "WEB",
    "url" : "http://osvdb.org/36378"
  }, {
    "type" : "WEB",
    "url" : "http://pastie.caboo.se/65550.txt"
  }, {
    "type" : "WEB",
    "url" : "http://secunia.com/advisories/25699"
  }, {
    "type" : "WEB",
    "url" : "http://secunia.com/advisories/27657"
  }, {
    "type" : "WEB",
    "url" : "http://secunia.com/advisories/27756"
  }, {
    "type" : "WEB",
    "url" : "http://security.gentoo.org/glsa/glsa-200711-17.xml"
  }, {
    "type" : "WEB",
    "url" : "http://weblog.rubyonrails.org/2007/10/12/rails-1-2-5-maintenance-release"
  }, {
    "type" : "WEB",
    "url" : "http://weblog.rubyonrails.org/2007/10/5/rails-1-2-4-maintenance-release"
  }, {
    "type" : "WEB",
    "url" : "http://www.novell.com/linux/security/advisories/2007_24_sr.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/24161"
  }, {
    "type" : "WEB",
    "url" : "http://www.vupen.com/english/advisories/2007/2216"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:37:37Z",
    "nvd_published_at" : "2007-06-14T23:30:00Z"
  }
}