node.module:521 - node_load()
foreach ($param as $key => $value) {
$cond[] = 'n.'. db_escape_string($key) ." = '%s'";
$arguments[] = $value;
}
As $key is not used in a string context (surrouned by ''),
db_escape_string is useless. (initial report by Heine).
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | node_load-db_escape_table.patch | 1000 bytes | dmitrig01 |
| #6 | node_load-db_escape_table-0.1.patch | 780 bytes | hswong3i |
| #1 | node-escape-table.patch | 690 bytes | AjK |
Comments
Comment #1
AjK commentedAnd the patch.
Comment #2
AjK commentedAs per originating issue, changing to RTBC.
Comment #3
gábor hojtsyApplicable to 5.x and 7.x as well. Moving back to 5.x but also need to be committed to 7.x then.
Comment #4
gábor hojtsy(I committed to 6.x.).
Comment #5
heine commentedFor the record, the initial report was by Stefan Esser, Mayflower & Zend in an audit commissioned by Die Zeit.
Comment #6
hswong3i commentedpatch for D7, from http://drupal.org/node/228233
Comment #7
drummCommitted to 5.x.
Comment #8
catchThis no longer applies, but it's going to be obsolete after #225450: Database Layer: The Next Generation gets in anyway.
Comment #9
dmitrig01 commentedSince it was RTBC before, this is a re-roll, and this is not a huge patch, marking RTBC again
Comment #10
dries commentedCommitted to CVS HEAD. Thanks!
Comment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.