Open Helius01 opened 3 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Antiforgery currently catches InvalidDataException
and produces a 400 bad response - https://github.com/dotnet/aspnetcore/blob/main/src/Antiforgery/src/Internal/DefaultAntiforgeryTokenStore.cs#L66. If we changed UrlDecoder.DecodeCore
to throw this exception instead of InvalidOperationException, this should get resolved.
Describe the bug
there is a bug in CSRF token parsing inside the framework if you give invalid value to CSRF field or cookie then server returns exception with status code 500. it should return status code 400
To Reproduce
Change the value of CSRF to
\%0a<%00>%bf%27
Exceptions (if any)
Further technical details
ASP.NET Core 3.1.16
Runtime Environment: OS Name: ubuntu OS Version: 20.04 OS Platform: Linux RID: ubuntu.20.04-x64 Base Path: /usr/share/dotnet/sdk/3.1.410/
Host (useful for support): Version: 3.1.16 Commit: 4c6b4aa257
.NET Core SDKs installed: 2.1.816 [/usr/share/dotnet/sdk] 3.1.410 [/usr/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.28 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.28 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.16 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.28 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.16 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download