Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-16 Thread John Elrick
dave lilley wrote: > Many thanks to all who have replied, > > I know understand the difference and shall use that approach to creating my > queries. > > regarding the "ruby way" it was more how I saw saving code typing by > injection different table, field and user data into one query thus saving >

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread dave lilley
Many thanks to all who have replied, I know understand the difference and shall use that approach to creating my queries. regarding the "ruby way" it was more how I saw saving code typing by injection different table, field and user data into one query thus saving typing. BUT in the interests of

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread John Elrick
dave lilley wrote: > Many thanks John so if i take that example and push it out so i can have 1 > method that can return a SQL select statement on any table, field and search > criteria i would only need to do this? > > In ruby it would be > > make_SQL (table, field, criteria) >stmt = "sel

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread Jay A. Kreibich
On Mon, Jun 15, 2009 at 07:09:44PM +1200, dave lilley scratched on the wall: > >>e.g. stmt = "select * from customers where cust_no = #{uservar}" > >> row = db.execute(stmt) > > Now i could understand how my code could possibly allow the records in the > table to be deleted but what's the differe

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread John Elrick
dave lilley wrote: > Sorry for posting twice but... > > how does the method you have given me differ to mine? > > eg lets say this is the scenario > > uservar = "delete * from customers where * = *" > > >>> e.g. stmt = "select * from customers where cust_no = #{uservar}" >>> row = db.execute

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread Mohit Sindhwani
dave lilley wrote: > Sorry for posting twice but... > > how does the method you have given me differ to mine? > > eg lets say this is the scenario > > uservar = "delete * from customers where * = *" > > >>> e.g. stmt = "select * from customers where cust_no = #{uservar}" >>> row = db.execute

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread dave lilley
Sorry for posting twice but... how does the method you have given me differ to mine? eg lets say this is the scenario uservar = "delete * from customers where * = *" >>e.g. stmt = "select * from customers where cust_no = #{uservar}" >> row = db.execute(stmt) Now i could understand how my c

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-15 Thread dave lilley
Many thanks John so if i take that example and push it out so i can have 1 method that can return a SQL select statement on any table, field and search criteria i would only need to do this? In ruby it would be make_SQL (table, field, criteria) stmt = "select * from #{table} where #{field

Re: [sqlite] SQlite3 - SQL injection using ruby

2009-06-14 Thread John Elrick
dave lilley wrote: > I am using sqlite3 with ruby and hope I'm not out of place here in ask for > some help on how to stop or reduce injection threats via sql statements made > by a user be it accidental or deliberate. > > I want to build a select query from user entered data and then return rows >

[sqlite] SQlite3 - SQL injection using ruby

2009-06-13 Thread dave lilley
I am using sqlite3 with ruby and hope I'm not out of place here in ask for some help on how to stop or reduce injection threats via sql statements made by a user be it accidental or deliberate. I want to build a select query from user entered data and then return rows that match. e.g. stmt = "sel