mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
25 lines
705 B
C#
25 lines
705 B
C#
using System;
|
|
|
|
namespace TestNHibernate
|
|
{
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Web.UI.WebControls;
|
|
|
|
class SqlInjection
|
|
{
|
|
private string connectionString;
|
|
public TextBox untrustedData;
|
|
|
|
public void InjectUntrustedData(NHibernate.ISession session, NHibernate.IStatelessSession statelessSession, NHibernate.Impl.AbstractSessionImpl impl)
|
|
{
|
|
session.CreateSQLQuery(untrustedData.Text); // $ Alert[cs/sql-injection]
|
|
|
|
statelessSession.CreateSQLQuery(untrustedData.Text); // $ Alert[cs/sql-injection]
|
|
|
|
impl.CreateSQLQuery(untrustedData.Text); // $ Alert[cs/sql-injection]
|
|
}
|
|
}
|
|
}
|