Files
codeql/csharp/ql/test/query-tests/Security Features/CWE-079/XssPageModels/TestModel.cs

20 lines
434 B
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc;
using System.Net;
using System.Threading.Tasks;
namespace test;
class TestModel : PageModel {
public string Name { get; set; } = "abc";
private string source() { return "x"; }
public async Task<IActionResult> OnPostAsync() {
this.Name = source();
return Page();
}
public void OnGet() {
Name = source();
}
}