From 7ee4d32c07b9ffe79e1554a1ee19c2e823063a5f Mon Sep 17 00:00:00 2001 From: Glax Date: Thu, 13 Mar 2025 21:30:05 +0100 Subject: [PATCH] Add BadRequest Check for width and height on cover endpoint --- API/Controllers/MangaController.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/API/Controllers/MangaController.cs b/API/Controllers/MangaController.cs index 914bb5a..77625a7 100644 --- a/API/Controllers/MangaController.cs +++ b/API/Controllers/MangaController.cs @@ -115,6 +115,8 @@ public class MangaController(PgsqlContext context) : Controller if (width is { } w && height is { } h) { + if (width < 10 || height < 10 || width > 65535 || height > 65535) + return BadRequest(); image.Mutate(i => i.ApplyProcessor(new ResizeProcessor(new ResizeOptions() { Mode = ResizeMode.Max,