Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^3: Multiple SQL statements in DBI

by davido (Archbishop)
on Sep 07, 2012 at 21:57 UTC ( #992386=note: print w/replies, xml ) Need Help??

in reply to Re^2: Multiple SQL statements in DBI
in thread Multiple SQL statements in DBI

Ah, in that case:

Placeholders and bind-values are what you should be using. They would prevent the possibility of an SQL injection attack. Even if the semicolon isn't the issue, there are other things user-supplied input could do when interpolated into the middle of an SQL statement. But placeholders eliminate the interpolation, and overcome that issue. While you might not be able to construct an attack with a semicolon, I wouldn't be too confident that you've eliminated all attack vectors. At least with placeholders you can cross the SQL injection attack off the list.


Replies are listed 'Best First'.
Re^4: Multiple SQL statements in DBI
by tel2 (Monk) on Sep 07, 2012 at 22:16 UTC
    Thanks Dave.  Yeah - I've been using placeholders & bind-variables, but did wonder about the need for those given my findings with DBI not allowing multiple statements, but you've semi-answered that, so thanks!

      Well for one thing a malicious user could supply the necessary values for interpolation, and in the last value, close the parents and continue on with an inner join that is constructed to reveal what you never intended to reveal, or to consume tons of resources. Imagine a chain of "order by".


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992386]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2017-04-30 21:36 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (542 votes). Check out past polls.