NHibernate installations with simple vanilla, for example, without free NHibernate, without HQL, nothing but domain objects and NHibernate mapping files. I load objects through:
_lightSabers = session.CreateCriteria(typeof(LightSaber)).List<LightSaber>();
I apply the original user input directly to one property in the "LightSaber" class:
myLightSaber.NameTag = "Raw malicious text from user";
Then I save LightSaber:
session.SaveOrUpdate(myLightSaber);
All that I saw says yes, in this situation you are immune to SQL injection, due to the fact that NHibernate parameterizes and escapes queries under the hood. However, I am also a relative novice of NHibernate, so I wanted to double check.
Thanks!
sql-injection nhibernate
user2189331
source share