-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate and Security (SQL Injection)
PostPosted: Wed Aug 25, 2004 11:33 pm 
Newbie

Joined: Wed Aug 25, 2004 11:16 pm
Posts: 12
Location: San Francisco, CA
Greetings,

I've successfully used hibernate on a few projects, and well, it's almost about to happen again. Thanks for the great work (and making my life easier), you already know how great hibernate is, so I won't say it again! :)

My current client has a very strict security review for all applications before they go into production. We deal with googles of financial information, so the scrutiny is a good thing. I need to explain why using hibernate doesn't introduce any unusual security concerns. I've done a few searches, both here and the net at large, and can't find any discussion on the topic.

The specific concern is SQL Injection (see http://www.securiteam.com/securityrevie ... 1P76E.html for more detail). Assuming that the web application doesn't do any validation whatsoever and thus, accepts any input. The input may contain sql commands which tinker in unorthodox ways.

Here's my take on it: It seems that hibernate uses prepared statements for all database access (is this true?). Generally speaking, prepared statements are precompiled, and their structure can't be changed by the parameters being set.

Is that it? Does that cover it? Is there anything more to make a more convincing argument? Am I missing something altogether?

Kindest regards,
Christian

PS: We are using hibernate 2.1.6 against a MS SQL Server 2000 database.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 25, 2004 11:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yup, that covers it perfactly.

(Of course, you have to make sure you use HQL parameters, instead of HQL string manipulation for queries.)


Top
 Profile  
 
 Post subject: Thanks...
PostPosted: Thu Aug 26, 2004 12:11 am 
Newbie

Joined: Wed Aug 25, 2004 11:16 pm
Posts: 12
Location: San Francisco, CA
We always use HQL parameters or build queries by the criteria api... so I think we're safe. Not to mention validate inputs meticulously.

Thanks for the speedy response!
Christian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.