Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Apr 10, 2024
1 parent 6eb15bd commit febbcef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions articles/imagesharp/security.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Security Considerations

Image processing is a memory-intensive application. Most image processing libraries (including ImageSharp and SkiaSharp) decode images into in-memory buffers. Any publicly facing service using such a library might be vulnerable to DoS attacks without implementing further measures.
Image processing is a memory-intensive application. Most image processing libraries (including ImageSharp, SkiaSharp and Magick.NET) decode images into in-memory buffers for further processing. Without additional measures, any publicly facing service that consumes images coming from untrusted sources might be vulnerable to DoS attacks attempting to deplate process memory.

For solutions using ImageSharp such measures can be:
Such measures can be:
- Authentication, for example by using HMAC. See [Securing Processing Commands in ImageSharp.Web](../imagesharp.web/processingcommands.md#securing-processing-commands).
- Offloading to separate services/containers.
- Placing the solution behind a reverse proxy.
Expand All @@ -12,7 +12,7 @@ For solutions using ImageSharp such measures can be:
```csharp
Configuration.Default.MemoryAllocator = MemoryAllocator.Create(new MemoryAllocatorOptions()
{
// Note that this limits the maximum image size to 64 megapixels.
// Note that this limits the maximum image size to 64 megapixels of Rgba32.
// Any attempt to create a larger image will throw.
AllocationLimitMegabytes = 256
});
Expand Down

0 comments on commit febbcef

Please sign in to comment.