File tree Expand file tree Collapse file tree
csharp/ql/test/query-tests/Security Features/CWE-089 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ namespace TestSqlite
4+ {
5+
6+ using System . Data . SQLite ;
7+ using System . Web . UI . WebControls ;
8+
9+ class SqlInjection
10+ {
11+ private string connectionString ;
12+ public TextBox untrustedData ;
13+
14+ public void InjectUntrustedData ( )
15+ {
16+ // BAD: untrusted data is not sanitized.
17+ SQLiteCommand cmd = new SQLiteCommand ( untrustedData . Text ) ;
18+
19+ // BAD: untrusted data is not sanitized.
20+ using ( var connection = new SQLiteConnection ( connectionString ) )
21+ {
22+ cmd = new SQLiteCommand ( untrustedData . Text , connection ) ;
23+ }
24+
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 11semmle-extractor-options: /nostdlib /noconfig
22semmle-extractor-options: --load-sources-from-project:../../../resources/stubs/Dapper/2.0.90/Dapper.csproj
33semmle-extractor-options: --load-sources-from-project:../../../resources/stubs/System.Data.SqlClient/4.8.3/System.Data.SqlClient.csproj
4+ semmle-extractor-options: --load-sources-from-project:../../../resources/stubs/System.Data.SQLite/1.0.116/System.Data.SQLite.csproj
45semmle-extractor-options: ${testdir}/../../../resources/stubs/EntityFramework.cs
56semmle-extractor-options: ${testdir}/../../../resources/stubs/System.Windows.cs
You can’t perform that action at this time.
0 commit comments