I have a web project which is developed by asp.net
In my web project, i have a page called as (MainPage). In MainPage according to query string, the last user can see a survey edit form (www.a.com?entity=survey@op=edit) or a parameter insertion form (www.a.com?entity=parameter&op=add) or etc....
The query string examples above are just examples since i encrypt them and actually the last user see some complex words on url
ex: www.a.com?saşlfas571=sflkmlm11sd&13kjn13=1378183
Moreover, in MainPage i m loading a javascript called as MainPageJs and it shows correct js codes according to query string.
I m loading MainPageJs in MainPage.cshtml
@section scripts{
<script type="text/javascript" src="@CustomUrl.CustomAction("MainPageJS", "Home", new { entity= entityName, op = opName })"></script>
}
The below code shows that how MainPageJs works
....
string res = "";
if (queryString == "parameter")
{
res = "var a = 1;";
}
if (queryString == "survey")
{
res = "var a = 2;";
}
if (queryString == "user")
{
res = "var a = 3;";
}
return JavaScript(res.ToString());
Now the thing I wonder is that,
- Does my code style have any security problems?
- Does my web page have any security vulnerability?
- Does this style have a JavaScript code injection vulnerability?