SqlInjectionGuardToolKit 1.0.4

dotnet add package SqlInjectionGuardToolKit --version 1.0.4
                    
NuGet\Install-Package SqlInjectionGuardToolKit -Version 1.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SqlInjectionGuardToolKit" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SqlInjectionGuardToolKit" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="SqlInjectionGuardToolKit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SqlInjectionGuardToolKit --version 1.0.4
                    
#r "nuget: SqlInjectionGuardToolKit, 1.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SqlInjectionGuardToolKit@1.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SqlInjectionGuardToolKit&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=SqlInjectionGuardToolKit&version=1.0.4
                    
Install as a Cake Tool

🚀 SqlInjectionGuardToolKit

SqlInjectionGuardToolKit is a lightweight, enterprise-grade SQL Injection detection and sanitization library for .NET.

It helps developers automatically validate and sanitize potentially dangerous SQL patterns in user input with minimal configuration.


🎯 Why This Library Matters ⭐⭐⭐⭐⭐

SQL Injection is one of the most critical security vulnerabilities.

Without protection:

❌ Database compromise
❌ Data leakage
❌ Unauthorized data manipulation
❌ Full system takeover

This toolkit provides:

✅ Automatic validation
✅ Safe input handling
✅ Attribute-driven protection
✅ Type-safe string design
✅ DTO sanitization
✅ MVC Filter / Middleware integration


✅ Key Features ⭐⭐⭐⭐⭐🔥

✔ SQL Injection Pattern Detection
✔ Automatic Sanitization
✔ Attribute-Based Validation
✔ SafeSqlString Type
✔ MVC Filter Integration
✔ Middleware Support
✔ Console Validation Support
✔ CLI Tool Support
✔ Minimal Performance Overhead


📦 Installation


✅ NuGet Package Manager

✅ 1️⃣ Enable SQL Injection Guard (Web API)

Register services:

builder.Services.AddControllers();
builder.Services.AddSqlInjectionGuard();

or

app.UseSqlInjectionGuard();

#✅ 2️⃣ DTO Validation (Attribute Mode)

Global Validation (Validate ALL string properties)

[SafeClassString]
public class CreateUserRequest
{
    public string Name { get; set; }
    public string Email { get; set; }
}

Selective Validation (Validate specific properties)

public class SearchRequest
{
    [SafeString]
    public string Keyword { get; set; }

    public string SortOrder { get; set; }
}

✅ 3️⃣ Type-Safe Protection (Recommended ⭐⭐⭐⭐⭐🔥)

public class TestModel
{
    
    public SafeSqlProps Name { get; set; }
    public string? Username { get; set; }
}

✅ 3️⃣ Type-Safe Protection Individual String Check (Recommended ⭐⭐⭐⭐⭐🔥)

public class TestModel
{
    
    public SafeSqlProps Name { get; set; }
    public string? Username { get; set; }
}

model.Username.VerifySQlString();

#🧠 How It Works

✅ Validation Flow

User Input
    ↓
SqlInjectionValidator
    ↓
Pattern Detection Engine
    ↓
Sanitization Logic
    ↓
Safe Output

✅ Web API Protection Flow

HTTP Request
    ↓
Middleware (Optional)
    ↓
MVC Filter
    ↓
DTO Validation

📜 License

MIT License

⭐ Final Thought ⭐⭐⭐⭐⭐🔥

Security should be:

✔ Automatic ✔ Predictable ✔ Hard to misuse

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 133 2/14/2026
1.0.3 121 2/14/2026
1.0.2 119 2/14/2026
1.0.1 117 2/14/2026
1.0.0 127 2/13/2026

# 🚀 Release Notes – SqlInjectionGuardToolKit

---

# ✅ Version 1.0.1 – Initial Stable Release 🎉🔥

📅 Release Date: 2026

---

## 🎯 Overview

This is the first stable release of **SqlInjectionGuardToolKit**, a lightweight SQL Injection detection and sanitization library for .NET.

The toolkit is designed to provide automatic validation and safe input handling with minimal developer effort.

---

## ✅ ✨ Key Features

✔ SQL Injection Pattern Detection Engine  
✔ Automatic String Sanitization  
✔ Attribute-Based Validation  
✔ SafeSqlString Type  
✔ DTO-Level Protection  
✔ MVC Filter Integration  
✔ Middleware Support  
✔ Console Validation Support  
✔ CLI Tooling Support  

---

## ✅ 🛡 Security Capabilities

✔ Detection of common SQL keywords  
✔ Logical operator pattern detection  
✔ Inline comment injection detection  
✔ Batch separator detection  
✔ Stored procedure abuse indicators  

Example detected patterns: