Skip to content

Commit 33186ac

Browse files
Add integration tests
1 parent 82fbae3 commit 33186ac

File tree

6 files changed

+32
-0
lines changed

6 files changed

+32
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace test;
2+
3+
using System.Net;
4+
using Microsoft.AspNetCore.Mvc;
5+
using Microsoft.AspNetCore.Mvc.Razor;
6+
7+
public class UserData
8+
{
9+
public string Name { get; set; }
10+
}
11+
12+
public class TestController : Controller {
13+
public IActionResult Test(UserData tainted1) {
14+
return View("Test", tainted1);
15+
}
16+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@namespace test
2+
@model UserData
3+
@{
4+
}
5+
6+
@if (Model != null)
7+
{
8+
<h3>Hello "@Html.Raw(Model.Name)"</h3>
9+
}

csharp/ql/integration-tests/all-platforms/cshtml_standalone_flowsteps/XSS.expected

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Security Features/CWE-079/XSS.ql

csharp/ql/integration-tests/all-platforms/cshtml_standalone_flowsteps/cshtml.csproj

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
from create_database_utils import *
3+
4+
5+
os.environ['CODEQL_EXTRACTOR_CSHARP_STANDALONE_EXTRACT_WEB_VIEWS'] = 'true'
6+
run_codeql_database_create(lang="csharp", extra_args=["--extractor-option=buildless=true", "--extractor-option=cil=false"])

0 commit comments

Comments
 (0)