in reply to Preventing injection attacks
DBI does a good job of escaping and db-quoting the things you bind this way. Then you can relax. If you use andye's method for filtering the input and paring away only things you -do- want via your favorite untaint method, you can relax even harder.#assuming you're connected, with a $dbh #my $sql = "select ? from ?"; #incorrect, thanks wfsp my $sql = "select ? from myTable"; my $sth=$dbh->prepare( $sql ) ; $sth->bind_param(1, $col_to_select ); #$sth->bind_param(2, $table ) ; #also incorrect $sth->execute ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Preventing injection attacks
by parv (Parson) on Apr 02, 2007 at 23:07 UTC |