diff --git a/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/MyOutput.razor b/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/MyOutput.razor
index e583e6b2e9c..5476d75ccf9 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/MyOutput.razor
+++ b/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/MyOutput.razor
@@ -2,7 +2,7 @@
Value from InputText: @Value
-
Raw value from InputText: @(new MarkupString(Value))
+
Raw value from InputText: @(new MarkupString(Value))
@* $ Alert[cs/web/xss]=r1 *@
@code {
diff --git a/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/Pages/TestPage.razor b/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/Pages/TestPage.razor
index ac3ccbe1920..7a7a02ec222 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/Pages/TestPage.razor
+++ b/csharp/ql/integration-tests/all-platforms/blazor/BlazorTest/Components/Pages/TestPage.razor
@@ -8,7 +8,7 @@
Route parameter
Go to: /test/@XssUrl
Parameter from URL: @UrlParam
- Raw parameter from URL: @((MarkupString)UrlParam)
+ Raw parameter from URL: @((MarkupString)UrlParam)
@* $ Alert[cs/web/xss]=r2 $ Alert[cs/web/xss]=r2 *@
@@ -17,7 +17,7 @@
Query parameter
Go to: /test/?qs=@XssUrl
Parameter from query string: @QueryParam
- Raw parameter from query string: @(new MarkupString(QueryParam))
+ Raw parameter from query string: @(new MarkupString(QueryParam))
@* $ Alert[cs/web/xss]=r3 $ Alert[cs/web/xss]=r3 *@
@@ -82,7 +82,7 @@
-
+ @* $ Source[cs/web/xss]=r1 *@
@code {
diff --git a/csharp/ql/integration-tests/all-platforms/blazor/XSS.qlref b/csharp/ql/integration-tests/all-platforms/blazor/XSS.qlref
index 89b5b951bdb..a71d4784670 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor/XSS.qlref
+++ b/csharp/ql/integration-tests/all-platforms/blazor/XSS.qlref
@@ -1,2 +1,4 @@
query: Security Features/CWE-079/XSS.ql
-postprocess: utils/test/PrettyPrintModels.ql
+postprocess:
+ - utils/test/PrettyPrintModels.ql
+ - utils/test/InlineExpectationsTestQuery.ql
diff --git a/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/MyOutput.razor b/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/MyOutput.razor
index e583e6b2e9c..5476d75ccf9 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/MyOutput.razor
+++ b/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/MyOutput.razor
@@ -2,7 +2,7 @@
Value from InputText: @Value
-
Raw value from InputText: @(new MarkupString(Value))
+
Raw value from InputText: @(new MarkupString(Value))
@* $ Alert[cs/web/xss]=r1 *@
@code {
diff --git a/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/Pages/TestPage.razor b/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/Pages/TestPage.razor
index ac3ccbe1920..7a7a02ec222 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/Pages/TestPage.razor
+++ b/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/BlazorTest/Components/Pages/TestPage.razor
@@ -8,7 +8,7 @@
Route parameter
Go to: /test/@XssUrl
Parameter from URL: @UrlParam
- Raw parameter from URL: @((MarkupString)UrlParam)
+ Raw parameter from URL: @((MarkupString)UrlParam)
@* $ Alert[cs/web/xss]=r2 $ Alert[cs/web/xss]=r2 *@
@@ -17,7 +17,7 @@
Query parameter
Go to: /test/?qs=@XssUrl
Parameter from query string: @QueryParam
- Raw parameter from query string: @(new MarkupString(QueryParam))
+ Raw parameter from query string: @(new MarkupString(QueryParam))
@* $ Alert[cs/web/xss]=r3 $ Alert[cs/web/xss]=r3 *@
@@ -82,7 +82,7 @@
-
+ @* $ Source[cs/web/xss]=r1 *@
@code {
diff --git a/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/XSS.qlref b/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/XSS.qlref
index 89b5b951bdb..a71d4784670 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/XSS.qlref
+++ b/csharp/ql/integration-tests/all-platforms/blazor_build_mode_none/XSS.qlref
@@ -1,2 +1,4 @@
query: Security Features/CWE-079/XSS.ql
-postprocess: utils/test/PrettyPrintModels.ql
+postprocess:
+ - utils/test/PrettyPrintModels.ql
+ - utils/test/InlineExpectationsTestQuery.ql
diff --git a/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/MyOutput.razor b/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/MyOutput.razor
index e583e6b2e9c..5476d75ccf9 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/MyOutput.razor
+++ b/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/MyOutput.razor
@@ -2,7 +2,7 @@
Value from InputText: @Value
-
Raw value from InputText: @(new MarkupString(Value))
+
Raw value from InputText: @(new MarkupString(Value))
@* $ Alert[cs/web/xss]=r1 *@
@code {
diff --git a/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/Pages/TestPage.razor b/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/Pages/TestPage.razor
index ac3ccbe1920..7a7a02ec222 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/Pages/TestPage.razor
+++ b/csharp/ql/integration-tests/all-platforms/blazor_net_8/BlazorTest/Components/Pages/TestPage.razor
@@ -8,7 +8,7 @@
Route parameter
Go to: /test/@XssUrl
Parameter from URL: @UrlParam
- Raw parameter from URL: @((MarkupString)UrlParam)
+ Raw parameter from URL: @((MarkupString)UrlParam)
@* $ Alert[cs/web/xss]=r2 $ Alert[cs/web/xss]=r2 *@
@@ -17,7 +17,7 @@
Query parameter
Go to: /test/?qs=@XssUrl
Parameter from query string: @QueryParam
- Raw parameter from query string: @(new MarkupString(QueryParam))
+ Raw parameter from query string: @(new MarkupString(QueryParam))
@* $ Alert[cs/web/xss]=r3 $ Alert[cs/web/xss]=r3 *@
@@ -82,7 +82,7 @@
-
+ @* $ Source[cs/web/xss]=r1 *@
@code {
diff --git a/csharp/ql/integration-tests/all-platforms/blazor_net_8/XSS.qlref b/csharp/ql/integration-tests/all-platforms/blazor_net_8/XSS.qlref
index 89b5b951bdb..a71d4784670 100644
--- a/csharp/ql/integration-tests/all-platforms/blazor_net_8/XSS.qlref
+++ b/csharp/ql/integration-tests/all-platforms/blazor_net_8/XSS.qlref
@@ -1,2 +1,4 @@
query: Security Features/CWE-079/XSS.ql
-postprocess: utils/test/PrettyPrintModels.ql
+postprocess:
+ - utils/test/PrettyPrintModels.ql
+ - utils/test/InlineExpectationsTestQuery.ql
diff --git a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Components_Pages_TestPage_razor.g.cs b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Components_Pages_TestPage_razor.g.cs
index 8732f8c7e4b..372ee49242f 100644
--- a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Components_Pages_TestPage_razor.g.cs
+++ b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Components_Pages_TestPage_razor.g.cs
@@ -135,7 +135,7 @@ UrlParam
__builder.AddContent(18, "Raw parameter from URL: ");
__builder.AddContent(19,
#nullable restore
-(MarkupString)UrlParam
+(MarkupString)UrlParam // $ Alert[cs/web/xss]=r1 $ Alert[cs/web/xss]=r1
#line default
#line hidden
@@ -185,7 +185,7 @@ QueryParam
__builder.AddContent(35, "Raw parameter from query string: ");
__builder.AddContent(36,
#nullable restore
-new MarkupString(QueryParam)
+new MarkupString(QueryParam) // $ Alert[cs/web/xss]=r2 $ Alert[cs/web/xss]=r2
#line default
#line hidden
diff --git a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Name.cs b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Name.cs
index a9d098470e4..344f5cbf6ac 100644
--- a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Name.cs
+++ b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Name.cs
@@ -10,7 +10,7 @@ namespace VulnerableBlazorApp.Components
{
builder.OpenElement(0, "div");
builder.OpenElement(1, "p");
- builder.AddContent(2, (MarkupString)TheName);
+ builder.AddContent(2, (MarkupString)TheName); // $ Alert[cs/web/xss]=r3 $ Alert[cs/web/xss]=r4
builder.CloseElement();
builder.CloseElement();
}
@@ -19,4 +19,4 @@ namespace VulnerableBlazorApp.Components
[Parameter]
public string TheName { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList.cs b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList.cs
index ceffb35303e..31126310dff 100644
--- a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList.cs
+++ b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList.cs
@@ -28,7 +28,7 @@ namespace VulnerableBlazorApp.Components
builder.OpenElement(6, "p");
builder.AddContent(7, "Name: ");
builder.OpenComponent(8);
- builder.AddComponentParameter(9, nameof(VulnerableBlazorApp.Components.Name.TheName), Name);
+ builder.AddComponentParameter(9, nameof(VulnerableBlazorApp.Components.Name.TheName), Name); // $ Source[cs/web/xss]=r4
builder.CloseComponent();
builder.CloseElement();
}
@@ -47,4 +47,4 @@ namespace VulnerableBlazorApp.Components
public List Names { get; set; } = new List();
}
-}
\ No newline at end of file
+}
diff --git a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList2.cs b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList2.cs
index d27d6f2dcde..fc6298943d3 100644
--- a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList2.cs
+++ b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/NameList2.cs
@@ -28,7 +28,7 @@ namespace VulnerableBlazorApp.Components
builder.OpenElement(6, "p");
builder.AddContent(7, "Name: ");
builder.OpenComponent(8);
- builder.AddComponentParameter(9, "TheName", Name);
+ builder.AddComponentParameter(9, "TheName", Name); // $ Source[cs/web/xss]=r3
builder.CloseComponent();
builder.CloseElement();
}
@@ -47,4 +47,4 @@ namespace VulnerableBlazorApp.Components
public List Names { get; set; } = new List();
}
-}
\ No newline at end of file
+}
diff --git a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Xss.qlref b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Xss.qlref
index 89b5b951bdb..a71d4784670 100644
--- a/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Xss.qlref
+++ b/csharp/ql/test/library-tests/frameworks/microsoft/aspnetcore/blazor/Xss.qlref
@@ -1,2 +1,4 @@
query: Security Features/CWE-079/XSS.ql
-postprocess: utils/test/PrettyPrintModels.ql
+postprocess:
+ - utils/test/PrettyPrintModels.ql
+ - utils/test/InlineExpectationsTestQuery.ql
diff --git a/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWrite.qlref b/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWrite.qlref
index b0835a02ad7..35d5389b718 100644
--- a/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWrite.qlref
+++ b/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWrite.qlref
@@ -1 +1,2 @@
query: ASP/BlockCodeResponseWrite.ql
+postprocess: utils/test/InlineExpectationsTestQuery.ql
diff --git a/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWriteBad.aspx b/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWriteBad.aspx
index 1e4a0fffc01..ebf2cadc8b3 100644
--- a/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWriteBad.aspx
+++ b/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/BlockCodeResponseWriteBad.aspx
@@ -2,6 +2,6 @@
-2 + 3 = <%Response.Write(2 + 3)%>
+2 + 3 = <%Response.Write(2 + 3)%>
<%-- $ Alert[cs/asp/response-write] --%>
diff --git a/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/test.aspx b/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/test.aspx
index 1e4a0fffc01..ebf2cadc8b3 100644
--- a/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/test.aspx
+++ b/csharp/ql/test/query-tests/ASP/BlockCodeResponseWrite/test.aspx
@@ -2,6 +2,6 @@
-2 + 3 = <%Response.Write(2 + 3)%>
+2 + 3 = <%Response.Write(2 + 3)%>
<%-- $ Alert[cs/asp/response-write] --%>
diff --git a/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCode.qlref b/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCode.qlref
index 90a69bb4a3b..9a5bdd6c37e 100644
--- a/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCode.qlref
+++ b/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCode.qlref
@@ -1 +1,2 @@
query: ASP/ComplexInlineCode.ql
+postprocess: utils/test/InlineExpectationsTestQuery.ql
diff --git a/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCodeBad.aspx b/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCodeBad.aspx
index f4457d89606..b8e0a25ac2c 100644
--- a/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCodeBad.aspx
+++ b/csharp/ql/test/query-tests/ASP/ComplexInlineCode/ComplexInlineCodeBad.aspx
@@ -15,6 +15,6 @@
} else {
ec.Emit (Response, OpCodes.Ldloca, builder);
}
-%>
+%> <%-- $ Alert[cs/asp/complex-inline-code] --%>