You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**ByteGuard.FileValidator** is a lightweight security-focused library for validating user-supplied files in .NET applications.
3
+
**ByteGuard.FileValidator** is a lightweight security-focused library for validating user-supplied files in .NET applications.
4
+
4
5
It helps you enforce consistent file upload rules by checking:
5
6
6
7
- Allowed file extensions
7
8
- File size limits
8
9
- File signatures (magic numbers) to detect spoofed types
9
10
- Security validation for Office Open XML / Open Document Formats (`.docx`, `.xlsx`, `.pptx`, `.odt`, `.odp`, `.ods`)
10
-
- Malware scan result using a varity of scanners (_requires the addition of a specific ByteGuard.FileValidator scanner package_)
11
+
- Malware scan result using a varity of scanners (_requires the addition of a specific [ByteGuard.FileValidator](https://github.com/ByteGuard-HQ/byteguard-file-validator-net/wiki/Available-AV-scanners) scanner package_)
11
12
12
13
> ⚠️ **Important:** This package is one layer in a defense-in-depth strategy.
13
14
> It does **not** replace endpoint protection, sandboxing, input validation, or other security controls.
@@ -18,9 +19,10 @@ It helps you enforce consistent file upload rules by checking:
18
19
- ✅ Validate files by **size**
19
20
- ✅ Validate files by **signature (_magic-numbers_)**
20
21
- ✅ Validate **specification conformance** for archive-based formats (_Open XML and Open Document Formats_)
21
-
- ✅ **Ensure no malware** through a variety of antimalware scanners
22
+
- ✅ **Ensure no malware** through a variety of [antimalware scanners](https://github.com/ByteGuard-HQ/byteguard-file-validator-net/wiki/Available-AV-scanners)
22
23
- ✅ Validate using file path, `Stream`, or `byte[]`
23
-
- ✅ Configure which file types to support
24
+
- ✅ [Rich integration with NET Core](https://github.com/ByteGuard-HQ/byteguard-file-validator-extensions-dependency-injection)
25
+
- ✅ Configure which [file types](https://github.com/ByteGuard-HQ/byteguard-file-validator-net/wiki/Validation-features) to support
24
26
- ✅ Configure whether to **throw exceptions** or simply return a boolean
In order to use the antimalware scanning capabilities, ensure you have a ByteGuard.FileValidator antimalware package referenced as well. You can find the relevant scanner package on [NuGet](https://www.nuget.org/packages?q=ByteGuard.FileValidator.Scanner.&includeComputedFrameworks=true&prerel=true&sortby=relevance) under the namespace `ByteGuard.FileValidator.Scanner`.
43
+
In order to use the antimalware scanning capabilities, ensure you have a [ByteGuard.FileValidator antimalware package](https://github.com/ByteGuard-HQ/byteguard-file-validator-net/wiki/Available-AV-scanners) referenced as well. You can find the relevant scanner package on [NuGet](https://www.nuget.org/packages?q=ByteGuard.FileValidator.Scanner.&includeComputedFrameworks=true&prerel=true&sortby=relevance) under the namespace `ByteGuard.FileValidator.Scanner`.
42
44
43
45
## Usage
44
46
@@ -130,38 +132,7 @@ public async Task<IActionResult> Upload(IFormFile file)
130
132
131
133
## Supported File Extensions
132
134
133
-
The following file types are supported by the `FileValidator`:
The file validator supports a variety of different file extensions. The complete list including the individual validation mechanisms per type, is available on the [WIKI](https://github.com/ByteGuard-HQ/byteguard-file-validator-net/wiki/Validation-features).
0 commit comments