Skip to content

Commit 8b8d2f9

Browse files
committed
C#: Add auto-generated stubs.
1 parent ba9cb5e commit 8b8d2f9

File tree

3 files changed

+159
-4
lines changed
  • csharp/ql
    • src/semmle/code/csharp/dataflow/flowsources
    • test/query-tests/Security Features/CWE-079/XSSFlowAspNet

3 files changed

+159
-4
lines changed

csharp/ql/src/semmle/code/csharp/dataflow/flowsources/Remote.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ private import semmle.code.csharp.frameworks.system.web.Services
1111
private import semmle.code.csharp.frameworks.system.web.ui.WebControls
1212
private import semmle.code.csharp.frameworks.WCF
1313
private import semmle.code.csharp.frameworks.microsoft.Owin
14-
private import microsoft.code.csharp.frameworks.microsoft.Primitives
15-
private import microsoft.code.csharp.frameworks.microsoft.AspNetCore
14+
private import semmle.code.csharp.frameworks.microsoft.Primitives
15+
private import semmle.code.csharp.frameworks.microsoft.AspNetCore
1616

1717

1818
/** A data flow source of remote user input. */

csharp/ql/test/query-tests/Security Features/CWE-079/XSSFlowAspNet/XSS.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// semmle-extractor-options: /r:System.Web.dll /r:${testdir}/../../../../../packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.dll /r:${testdir}/../../../../../packages/Microsoft.AspNet.Mvc.5.2.3/lib/net45/System.Web.Mvc.dll
1+
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll /r:System.Runtime.Extensions.dll /r:System.Linq.Expressions.dll
22
namespace ASP
33
{
44
using System;
55
using System.IO;
66
using System.Net;
77
using System.Web;
8-
using System.Web.UI;
8+
// using System.Web.UI;
99
using System.Web.WebPages;
1010

1111
public class _Page_Views_Home_Contact_cshtml : System.Web.Mvc.WebViewPage<dynamic>
@@ -48,3 +48,5 @@ public override void Execute()
4848
}
4949
}
5050
}
51+
52+
// source-extractor-options: /r:${testdir}/../../../../../packages/Microsoft.AspNet.WebPages.3.2.3/lib/net45/System.Web.WebPages.dll /r:${testdir}/../../../../../packages/Microsoft.AspNet.Mvc.5.2.3/lib/net45/System.Web.Mvc.dll /r:System.Dynamic.Runtime.dll /r:System.Runtime.Extensions.dll /r:System.Linq.Expressions.dll /r:System.Web.dll /r:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Web.dll /r:System.Collections.Specialized.dll
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
namespace System
2+
{
3+
namespace Collections
4+
{
5+
namespace Specialized
6+
{
7+
// Generated from `System.Collections.Specialized.NameObjectCollectionBase` in `System.Collections.Specialized, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
8+
abstract public class NameObjectCollectionBase : System.Runtime.Serialization.ISerializable, System.Runtime.Serialization.IDeserializationCallback, System.Collections.IEnumerable, System.Collections.ICollection
9+
{
10+
bool System.Collections.ICollection.IsSynchronized { get => throw null; }
11+
object System.Collections.ICollection.SyncRoot { get => throw null; }
12+
public virtual System.Collections.IEnumerator GetEnumerator() => throw null;
13+
public virtual int Count { get => throw null; }
14+
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) => throw null;
15+
public virtual void OnDeserialization(object sender) => throw null;
16+
void System.Collections.ICollection.CopyTo(System.Array array, int index) => throw null;
17+
}
18+
19+
// Generated from `System.Collections.Specialized.NameValueCollection` in `System.Collections.Specialized, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
20+
public class NameValueCollection : System.Collections.Specialized.NameObjectCollectionBase
21+
{
22+
public string this[string name] { get => throw null; set => throw null; }
23+
}
24+
25+
}
26+
}
27+
namespace IO
28+
{
29+
// Generated from `System.IO.TextWriter` in `System.Runtime.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
30+
abstract public class TextWriter : System.MarshalByRefObject, System.IDisposable
31+
{
32+
public void Dispose() => throw null;
33+
}
34+
35+
}
36+
namespace Web
37+
{
38+
// Generated from `System.Web.HttpContext` in `System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
39+
public class HttpContext : System.Web.IPrincipalContainer
40+
{
41+
public System.Web.HttpServerUtility Server { get => throw null; }
42+
public static System.Web.HttpContext Current { get => throw null; set => throw null; }
43+
}
44+
45+
// Generated from `System.Web.HttpRequestBase` in `System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
46+
abstract public class HttpRequestBase
47+
{
48+
public virtual System.Collections.Specialized.NameValueCollection QueryString { get => throw null; }
49+
}
50+
51+
// Generated from `System.Web.HttpServerUtility` in `System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
52+
public class HttpServerUtility
53+
{
54+
public string HtmlEncode(string s) => throw null;
55+
}
56+
57+
// Generated from `System.Web.HttpUtility` in `System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
58+
public class HttpUtility
59+
{
60+
public static string HtmlEncode(string s) => throw null;
61+
}
62+
63+
// Generated from `System.Web.IHtmlString` in `System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
64+
public interface IHtmlString
65+
{
66+
}
67+
68+
// Generated from `System.Web.IPrincipalContainer` in `System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`
69+
interface IPrincipalContainer
70+
{
71+
}
72+
73+
namespace Mvc
74+
{
75+
// Generated from `System.Web.Mvc.HtmlHelper<>` in `System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
76+
public class HtmlHelper<TModel> : System.Web.Mvc.HtmlHelper
77+
{
78+
}
79+
80+
// Generated from `System.Web.Mvc.HtmlHelper` in `System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
81+
public class HtmlHelper
82+
{
83+
public System.Web.IHtmlString Raw(string value) => throw null;
84+
public string Encode(string value) => throw null;
85+
}
86+
87+
// Generated from `System.Web.Mvc.IViewDataContainer` in `System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
88+
public interface IViewDataContainer
89+
{
90+
}
91+
92+
// Generated from `System.Web.Mvc.IViewStartPageChild` in `System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
93+
interface IViewStartPageChild
94+
{
95+
}
96+
97+
// Generated from `System.Web.Mvc.WebViewPage<>` in `System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
98+
abstract public class WebViewPage<TModel> : System.Web.Mvc.WebViewPage
99+
{
100+
public System.Web.Mvc.HtmlHelper<TModel> Html { get => throw null; set => throw null; }
101+
}
102+
103+
// Generated from `System.Web.Mvc.WebViewPage` in `System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
104+
abstract public class WebViewPage : System.Web.WebPages.WebPageBase, System.Web.Mvc.IViewStartPageChild, System.Web.Mvc.IViewDataContainer
105+
{
106+
}
107+
108+
}
109+
namespace WebPages
110+
{
111+
// Generated from `System.Web.WebPages.ITemplateFile` in `System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
112+
public interface ITemplateFile
113+
{
114+
}
115+
116+
// Generated from `System.Web.WebPages.StringExtensions` in `System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
117+
static public class StringExtensions
118+
{
119+
public static bool IsEmpty(this string value) => throw null;
120+
}
121+
122+
// Generated from `System.Web.WebPages.WebPageBase` in `System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
123+
abstract public class WebPageBase : System.Web.WebPages.WebPageRenderingBase
124+
{
125+
public System.IO.TextWriter Output { get => throw null; }
126+
public override dynamic Page { get => throw null; }
127+
public override string Layout { get => throw null; set => throw null; }
128+
public override void Write(object value) => throw null;
129+
public override void WriteLiteral(object value) => throw null;
130+
}
131+
132+
// Generated from `System.Web.WebPages.WebPageExecutingBase` in `System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
133+
abstract public class WebPageExecutingBase
134+
{
135+
protected void BeginContext(string virtualPath, int startPosition, int length, bool isLiteral) => throw null;
136+
protected void EndContext(string virtualPath, int startPosition, int length, bool isLiteral) => throw null;
137+
public abstract void Execute();
138+
public abstract void Write(object value);
139+
public abstract void WriteLiteral(object value);
140+
public static void WriteLiteralTo(System.IO.TextWriter writer, object content) => throw null;
141+
}
142+
143+
// Generated from `System.Web.WebPages.WebPageRenderingBase` in `System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35`
144+
abstract public class WebPageRenderingBase : System.Web.WebPages.WebPageExecutingBase, System.Web.WebPages.ITemplateFile
145+
{
146+
public abstract dynamic Page { get; }
147+
public abstract string Layout { get; set; }
148+
public virtual System.Web.HttpRequestBase Request { get => throw null; }
149+
}
150+
151+
}
152+
}
153+
}

0 commit comments

Comments
 (0)