From c9c273040968360e53aa6385f347a0e32be240a2 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 10 Jul 2018 12:51:23 +0900 Subject: [PATCH] check macaroonfilepath is rooted --- BTCPayServer/Controllers/StoresController.LightningLike.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BTCPayServer/Controllers/StoresController.LightningLike.cs b/BTCPayServer/Controllers/StoresController.LightningLike.cs index efb9dc4f1..eb77cb360 100644 --- a/BTCPayServer/Controllers/StoresController.LightningLike.cs +++ b/BTCPayServer/Controllers/StoresController.LightningLike.cs @@ -109,6 +109,11 @@ namespace BTCPayServer.Controllers ModelState.AddModelError(nameof(vm.ConnectionString), "The macaroonfilepath file does exist"); return View(vm); } + if(!System.IO.Path.IsPathRooted(connectionString.MacaroonFilePath)) + { + ModelState.AddModelError(nameof(vm.ConnectionString), "The macaroonfilepath should be fully rooted"); + return View(vm); + } } if (isInternalNode && !CanUseInternalLightning())