Veracode Scan and CWE-89 (SQL Injection)

210 views
Skip to first unread message

Brian Campbell

unread,
May 25, 2016, 12:23:53 AM5/25/16
to HikariCP, Brian Kraig Campbell
We recently transitioned from BoneCP to HikariCP.  We use Veracode to do security scanning as part of our continuous integration build process.  There were flaws reported against Hikari under the CWE-89 (SQL Injection) flaw.  The two classes flagged were the ProxyStatement and ProxyPreparedStatement classes.

After reading the "Down the Rabbit Hole" article I believe that these three instances of "execute*()" should be mitigated as "by design" due to Hikari intercepting all of these interactions with the java.sql.* classes to properly manage connections.

Can someone confirm this or correct me?

Thanks,
Brian

Brett Wooldridge

unread,
May 25, 2016, 2:50:13 AM5/25/16
to HikariCP, Brian.C...@mckesson.com
Hi Brian,

I would consider that a false positive.  All of the proxy execute() methods simply call the delegate (real) connection, like so:

   public boolean execute(String sql) throws SQLException
   {
      connection.markCommitStateDirty();
      return delegate.execute(sql);
   }

So, if there is a SQL injection issue, it would be with the underlying driver and not HikariCP.

Regards,
Brett

Brian Pontarelli

unread,
May 25, 2016, 8:59:33 AM5/25/16
to hika...@googlegroups.com, Brian.C...@mckesson.com
It's probably much more likely that it is in the application rather than the driver. ;)

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "HikariCP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hikari-cp+...@googlegroups.com.
Visit this group at https://groups.google.com/group/hikari-cp.
For more options, visit https://groups.google.com/d/optout.

Brian Campbell

unread,
May 25, 2016, 9:58:13 AM5/25/16
to HikariCP, Brian.C...@mckesson.com
Thanks for the replies.  I agree that these are false positives and that it's up to the application to guard against the various sql injection scenarios as long as connection pools are only proxying the calls.
Reply all
Reply to author
Forward
0 new messages