File tree Expand file tree Collapse file tree
csharp/ql/test/utils/model-generator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ | Sinks;NewSinks;false;WrapFieldResponseWriteFile;();Argument[Qualifier];html |
2+ | Sinks;NewSinks;false;WrapResponseWrite;(System.Object);Argument[0];html |
3+ | Sinks;NewSinks;false;WrapResponseWriteFile;(System.String);Argument[0];html |
Original file line number Diff line number Diff line change 1+ utils/model-generator/CaptureSinkModels.ql
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Web ;
3+
4+ namespace Sinks ;
5+
6+ public class NewSinks
7+ {
8+ private string tainted ;
9+
10+ // New sink
11+ public void WrapResponseWrite ( object o )
12+ {
13+ var response = new HttpResponse ( ) ;
14+ response . Write ( o ) ;
15+ }
16+
17+ // NOT new sink as method is private
18+ private void PrivateWrapResponseWrite ( object o )
19+ {
20+ var response = new HttpResponse ( ) ;
21+ response . Write ( o ) ;
22+ }
23+
24+ // New sink
25+ public void WrapResponseWriteFile ( string s )
26+ {
27+ var response = new HttpResponse ( ) ;
28+ response . WriteFile ( s ) ;
29+ }
30+
31+ // New sink
32+ public void WrapFieldResponseWriteFile ( )
33+ {
34+ var response = new HttpResponse ( ) ;
35+ response . WriteFile ( tainted ) ;
36+ }
37+
38+ }
Original file line number Diff line number Diff line change 1- semmle-extractor-options: /r:System.Linq.dll
1+ semmle-extractor-options: /r:System.Linq.dll /r:System.Collections.Specialized.dll
2+ semmle-extractor-options: ${testdir}/../../resources/stubs/System.Web.cs
You can’t perform that action at this time.
0 commit comments