-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate Security
PostPosted: Wed May 17, 2006 12:46 pm 
Newbie

Joined: Wed May 17, 2006 12:25 pm
Posts: 2
Hi!

I trying to figure out, what security methods are implimented by hibernate.

Perhaps you can help me.

Especial SQL-Injection prevention.

There are two ways to create a query, or not?

1.) SQL with integrated parameters:
Of course not SQL injection proove:
Code:
session.createQuery("from SomeClass s where s.someString = '" + someValue + "'");


2.) Bind variables/prepared Statements
Seems to be save...
http://www.jroller.com/page/larrywillia ... sting_with
Quote:
3.3 SQL Injection

With Hibernate you normally don't have to worry about SQL injection. One exception is if you are creating a HQL query dynamically from user input. To avoid problems always use bind variables:

session.createQuery("from person where person.username=:username").setParameter("username, formUsername);


So I wonder if hibernate create always prepared statements in case 2 and where is that documented.

Bye


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

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.