http://www.reddit.com/r/drupal/comments/2jbuiz/drupal_732_fi...
Drupal 7 SQL Injection Vulnerability
21–30 of 83 posts
Re: Drupal 7 SQL Injection Vulnerability
#22Re: Drupal 7 SQL Injection Vulnerability
#23In this file:
includes/database/database.inc
Replace line 739: foreach ($data as $i => $value) {
With the patched code: foreach (array_values($data) as $i => $value) {
[1] https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patc...Re: Drupal 7 SQL Injection Vulnerability
#24Could this problem be solved by quoting parameters ? I believe PDO has quoting capabilities when it comes to query parameters in prepared statements.i.e. one can state this parameters is a string , or an integer ....
Re: Drupal 7 SQL Injection Vulnerability
#25There's this common misconception "just use prepared statements and they'll completely prevent SQL injection" floating around. Good to see (yet another) counterexample of that. Prepared statements and parameters are only strategies that can help, but they don't replace an understanding of where the characters in the query are coming from and how they're being used. Escaping shouldn't be a difficult concept to understand either.
Re: Drupal 7 SQL Injection Vulnerability
#26Could this problem be solved by quoting parameters ? I believe PDO has quoting capabilities when it comes to query parameters in prepared statements.i.e. one can state this parameters is a string , or an integer ....
The problem here is that placeholders are added to the query itself to match the amount of array items. These newly constructed placeholders inadvertently contained user data.
They are naming the query placeholders based directly on the indexes passed in the querystring parameters?
And since indexes can be whatever string like ?name[DELETE FROM USERS]=foo&... ,you end up with an exploit ...
Re: Drupal 7 SQL Injection Vulnerability
#27Drupal uses prepared statements in all its SQL queries. There's this common misconception "just use prepared statements and they'll completely prevent SQL injection" floating around. Good to see (yet another) counterexample of that. Prepared statements and parameters are only strategies that can help, but they don't replace an understanding of where the characters in the query are coming from and how they're being us…
It's quite simply shoddy string substitution that's not doing proper escaping, as you pointed out.
Re: Drupal 7 SQL Injection Vulnerability
#28I feel like Hacker News has become home of the "security exploit du jour." There have always been new exploits being found daily, what's changed is the severity and wide reaching nature of said exploits. You might ask, when will we learn? Well, the truth is making secure systems is incredibly hard work and often comes at the price of flexibility/usability/programmer productivity. We know how to do it, it's just not e…
Re: Drupal 7 SQL Injection Vulnerability
#29Drupal uses prepared statements in all its SQL queries. There's this common misconception "just use prepared statements and they'll completely prevent SQL injection" floating around. Good to see (yet another) counterexample of that. Prepared statements and parameters are only strategies that can help, but they don't replace an understanding of where the characters in the query are coming from and how they're being us…