Chapter 2: Injection Flaws
Injection flaws in code can have the most devastating effects on ASP.NET Core web applications. The lack of validation and sanitization of untrusted input allows this vulnerability to be exploited, leading to the execution of arbitrary OS commands, authentication bypass, unexpected data manipulation, and content. At worse, it can disclose sensitive information and lead to an eventual data breach.
This chapter introduces you to various injection flaws and explains how you can remediate this security defect in code.
In this chapter, we're going to cover the following recipes:
- Fixing SQL injection with Entity Framework
- Fixing SQL injection in ADO.NET
- Fixing NoSQL injection
- Fixing command injection
- Fixing LDAP injection
- Fixing XPath injection
By the end of this chapter, you will learn how to properly write secure code and remove security bugs that will prevent injection attacks.