Commit
Fix CVE-2014-3482.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -442,8 +442,8 @@ def quote(value, column = nil) #:nodoc: | |
| when 'xml' then "xml '#{quote_string(value)}'" | ||
| when /^bit/ | ||
| case value | ||
| when /^[01]*$/ then "B'#{value}'" # Bit-string notation | ||
| when /^[0-9A-F]*$/i then "X'#{value}'" # Hexadecimal notation | ||
| when /\A[01]*\Z/ then "B'#{value}'" # Bit-string notation | ||
| when /\A[0-9A-F]*\Z/i then "X'#{value}'" # Hexadecimal notation | ||
| end | ||
| else | ||
| super | ||
|
|
@@ -1160,7 +1160,7 @@ def translate_exception(exception, message) | |
| FEATURE_NOT_SUPPORTED = "0A000" # :nodoc: | ||
|
|
||
| def exec_no_cache(sql, binds) | ||
| @connection.async_exec(sql) | ||
| @connection.async_exec(sql, []) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rafaelfranca
Author
Member
|
||
| end | ||
|
|
||
| def exec_cache(sql, binds) | ||
|
|
||
What's the significance of this change in addressing the security vulnerability? My team noticed that this causes PostgreSQL to fail with a "
cannot insert multiple commands into a prepared statement" error message if multiple SQL statements are passed in a single query. Is passing the explicit empty array even in the absence of any actual bind parameters intended to force the pg gem to callPQexecParamsinstead ofPQexec? We're going to change our own app, but this breaks compatibility with any Rails app issuing multiple SQL statements in a single query, for no apparent benefit.CC: @agaridata/engineering @vidurapparao @zmt