NET reflection - theory, security and all the snippets you need in C#

.NET reflection – theory, security and all the snippets you need in C#

Reflection code snippets tested under .NET Core 2. What is reflection and how can you benefit from it Reflection allows a program to inspect or modify itself during runtime. In practice it means that you can do all sorts of stuff on objects/properties including checking type of an object at runtime (typeof), listing all fields …

.NET reflection – theory, security and all the snippets you need in C# Read More »

ASP.NET Core Security How to prevent mass assignment attacks

How to prevent mass assignment in ASP.NET Core

One of the many security risks which you should consider is a mass assignment vulnerability (cheatsheet) also know as overposting. While it’s not in OWASP Top 10 it’s still considered important. Read on to understand the issue and find out possible ways of fixing it. Mass assignment explained ASP.NET Core allows automatic model binding of …

How to prevent mass assignment in ASP.NET Core Read More »

ASP.NET Core Global exception handler middleware

ASP.NET Core: Global exception handler middleware

Middleware is a piece of software that handles requests and responses in the middle of application pipeline. An example of built-in ASP.NET Core middleware is authentication component and response caching component. In this article I’ll show you how to create global exception handler using custom middleware component. This article will teach you how to create …

ASP.NET Core: Global exception handler middleware Read More »