Ruby on Rails contains a vulnerability that could allow an unauthenticated, remote attacker to conduct SQL injection attacks.
The vulnerability exists because the affected framework fails to sanitize SQL queries that are embedded in application requests. An unauthenticated, remote attacker could exploit the vulnerability by transmitting crafted requests to the system. Successful exploitation could allow the attacker to execute arbitrary SQL queries on the underlying database and could disclose sensitive information or modify the database records.
Ruby on Rails has confirmed the vulnerability and released software updates.
Indicators of Compromise
The following versions of Ruby on Rails are vulnerable:
Versions prior to 3.2.6
Versions prior to 3.1.6
Versions prior to 3.0.14
The vulnerability is due to insufficient sanitization of user-supplied input processed by the ActiveRecords query interface. While handling queries, the WHERE method of the interface could be provided with unsanitized request parameters, which could trigger execution of the nested queries in the parameters.
An unauthenticated, remote attacker could exploit the vulnerability by transmitting application requests with a crafted params[:id] parameter. When processed, such queries could perform nested execution of queries on an arbitrary database table to disclose sensitive information or modify the database records.
To exploit this vulnerability, the attacker would need to send crafted SQL queries to the targeted system. Depending on the targeted system, the attacker would need access to trusted, internal networks. This access requirement decreases the likelihood of a successful exploit.
Administrators are advised to apply the appropriate updates.
Administrators may consider using IP-based access control lists (ACLs) to allow only trusted systems to access the affected systems.
Administrators are advised to monitor affected systems.
Ruby on Rails has released a security advisory at the following link: CVE-2012-2695
Red Hat has released updated software for registered subscribers at the following link: Red Hat Network. Red Hat packages can be updated on Red Hat Enterprise Linux versions 5 and later using the yum tool.
THIS DOCUMENT IS PROVIDED ON AN "AS IS" BASIS AND DOES NOT IMPLY ANY KIND OF GUARANTEE OR WARRANTY, INCLUDING THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE. YOUR USE OF THE INFORMATION ON THE DOCUMENT OR MATERIALS LINKED FROM
THE DOCUMENT IS AT YOUR OWN RISK. CISCO RESERVES THE RIGHT TO CHANGE OR UPDATE ALERTS AT ANY TIME.
A standalone copy or paraphrase of the text of this document that omits the distribution URL is an uncontrolled copy and may lack important information or contain factual errors. The information in this document is intended for end users of Cisco products
Cisco Multivendor Vulnerability Alerts respond to vulnerabilities identified in third-party vendors' products. These alerts contain information compiled from diverse sources and provide comprehensive technical descriptions, objective analytical assessments, workarounds and practical safeguards, and links to vendor advisories and patches.