Skip to content

Webgoat net6.0 #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WebGoatCore.sln → WebGoat.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29418.71
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebGoatCore", "WebGoatCore\WebGoatCore.csproj", "{706965ED-4ADB-4E9B-AD9F-6EE2C8B8382F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebGoat.NET", "WebGoat.NET\WebGoat.NET.csproj", "{706965ED-4ADB-4E9B-AD9F-6EE2C8B8382F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 9 additions & 2 deletions WebGoatCore/Startup.cs → WebGoat.NET/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ private static string GetExecDirectory()
{
string? entryDir = null;
string? entryLocation = Assembly.GetEntryAssembly()?.Location;
if(!string.IsNullOrEmpty(entryLocation))
if (!string.IsNullOrEmpty(entryLocation))
{
entryDir = Path.GetDirectoryName(entryLocation);
}
if(!string.IsNullOrEmpty(entryDir))
if (!string.IsNullOrEmpty(entryDir))
{
return entryDir;
}
Expand Down Expand Up @@ -153,5 +153,12 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
pattern: "{controller=Home}/{action=Index}");
});
}

public int startupNotUsed(int a, int b) // Function added to generate same FA Violation
{
var c = 1;
b = 0;
return a / b;
}
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,19 @@
<legend>Product information</legend>
@if (!Model.AddsNew)
{
#pragma warning disable CS8602 // False positive, cannot happen in template usage
Html.HiddenFor(m => m.Product.ProductId);
Html.HiddenFor(m => m.Product.SupplierId);
#pragma warning restore CS8602
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.ProductId)
@{ #pragma warning restore CS8602 }
<span class="textEntry">@Model.Product?.ProductId</span>
</p>
}
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.ProductName)
@Html.TextBoxFor(m => m.Product.ProductName, new { @value = Model.Product?.ProductName })
@Html.ValidationMessageFor(m => m.Product.ProductName)
@{ #pragma warning restore CS8602 }
</p>
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.Category)
<select asp-for="Product.CategoryId">
@foreach (var category in Model.ProductCategories)
Expand All @@ -47,9 +40,7 @@
</option>
}
</select>
@{ #pragma warning restore CS8602 }
</p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
<p>
@Html.LabelFor(m => m.Product.QuantityPerUnit)
@Html.TextBoxFor(m => m.Product.QuantityPerUnit, new { @value = Model.Product?.QuantityPerUnit })
Expand All @@ -75,11 +66,9 @@
@Html.TextBoxFor(m => m.Product.ReorderLevel, new { @value = Model.Product?.ReorderLevel })
@Html.ValidationMessageFor(m => m.Product.ReorderLevel)
</p>
@{ #pragma warning restore CS8602 }
@if (Model.AddsNew)
{
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.LabelFor(m => m.Product.Supplier)
@if(Model.Suppliers != null)
{
Expand All @@ -93,18 +82,15 @@
</select>
}
@Html.ValidationMessageFor(m => m.Product.Supplier)
@{ #pragma warning restore CS8602 }
</p>
}
<p>
@{ #pragma warning disable CS8602 } <!-- False positive, cannot happen in template usage -->
@Html.CheckBoxFor(m => m.Product.Discontinued, new { @checked = Model.Product?.Discontinued ?? false })
@Html.LabelFor(m => m.Product.Discontinued)
@{ #pragma warning restore CS8602 }
</p>
</fieldset>
<p class="submitButton">
<input type="submit" value="Save changes">
</p>
}
</div>
</div>
23 changes: 8 additions & 15 deletions WebGoatCore/WebGoatCore.csproj → WebGoat.NET/WebGoat.NET.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<UserSecretsId>669676e4-410e-47bc-a260-8c851a25b590</UserSecretsId>
</PropertyGroup>
Expand All @@ -13,20 +13,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Json.Net" Version="1.0.23"/>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.0"/>
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="5.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.0"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.0"/>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="5.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="5.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0"/>
<PackageReference Include="System.Data.SqlClient" Version="4.8.2"/>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.2" />
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="6.0.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.