WebApp Sec mailing list archives
Re: JDBC protections against SQL Injection
From: Rohit Sethi <rklists () gmail com>
Date: Mon, 23 Mar 2009 22:38:42 -0400
You'll be interested in this: http://www.google.com/codesearch/p?hl=en#OzTl4d0Z71Q/mysql-connector-java-3.0.11-stable/com/mysql/jdbc/PreparedStatement.java&q=PreparedStatement%20lang:java%20mysql This is the implementation of the PreparedStatement interface for MySQL. Note the setString() method that escapes several interpreted characters. Conceivable somebody can write a driver that fails to properly implement this kind of method Cheers, Rohit On Thu, Mar 19, 2009 at 4:03 PM, Florian Weimer <fw () deneb enyo de> wrote:
Being paranoid, I wanted to review the source in java and find the area where the input is "escaped" to see how they handle the protections in implementation rather than blindly trust someone saying "just use ... it will protect against SQL injection".It's in the JDBC driver. Escaping is database-specific, so only the driver knows how to do it properly.
-- Rohit Sethi Security Compass http://www.securitycompass.com
Current thread:
- JDBC protections against SQL Injection lister (Mar 16)
- Re: JDBC protections against SQL Injection τ∂υƒιφ * (Mar 16)
- Re: JDBC protections against SQL Injection Marc-André Laverdière (Mar 16)
- Re: JDBC protections against SQL Injection private private (Mar 17)
- RE: JDBC protections against SQL Injection Dave Wichers (Mar 17)
- Re: JDBC protections against SQL Injection Marc-André Laverdière (Mar 16)
- Re: JDBC protections against SQL Injection τ∂υƒιφ * (Mar 16)
- <Possible follow-ups>
- Re: Re: JDBC protections against SQL Injection jjs_ritasa (Mar 18)
- Re: Re: JDBC protections against SQL Injection Pete Jansson (Mar 19)
- Re: Re: JDBC protections against SQL Injection lister (Mar 19)
- Re: JDBC protections against SQL Injection Rogan Dawes (Mar 19)
- Re: JDBC protections against SQL Injection Florian Weimer (Mar 19)
- Re: JDBC protections against SQL Injection Rohit Sethi (Mar 24)
- RE: JDBC protections against SQL Injection Jeff Williams (Mar 26)
- Re: Re: JDBC protections against SQL Injection Pete Jansson (Mar 19)