SQL Injection Vulnerability in quote_table_name

658 views
Skip to first unread message

Aaron Patterson

unread,
Aug 16, 2011, 5:02:30 PM8/16/11
to rubyonrail...@googlegroups.com
SQL Injection Vulnerability in quote_table_name

There is a vulnerability in the quote_table_name method which could allow malicious users to inject arbitrary SQL into a query. This vulnerability has been assigned the CVE identifier CVE-YYYY-XXXX.

Versions Affected: All.
Fixed Versions: 3.0.10, 2.3.13, 3.1.0.rc5

Impact
------

The quote_table_name method in the ActiveRecord adapaters for Ruby on Rails were initially created solely for the purpose of escaping reserved words encountered in table names. However over time 3rd party libraries, and rails itself, grew to rely on those functions as a way to sanitize potentially malicious user input. As a result these functions need to be hardened to manage malicious input rather than assuming they're being passed benign values generated by rails itself.

All users running an affected release should upgrade immediately.

Releases
--------

The 3.0.10, 2.3.13 and v3.1.0.rc5 releases are available at the normal locations.

Workarounds
-----------

There are no feasible workarounds for this issue.

Patches
-------
To aid users who aren't able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset.

* 2-3-sql_injection.patch - Patch for 2.3 series
* 3-0-sql_injection.patch - Patch for 3.0 series
* 3-1-sql_injection.patch - Patch for 3.1 series

Please note that only the 2.3.x and 3.0.x series are supported at present. Users of earlier unsupported releases are advised to upgrade as soon as possible.

--
Aaron Patterson
http://tenderlovemaking.com/

2-3-stable-fix-sql-injection.patch
3-0-stable-fix-sql-injection.patch
3-1-stable-fix-sql-injection.patch
Reply all
Reply to author
Forward
0 new messages