From ca35f0944ff90064dd6c223105bcbc7fffc29348 Mon Sep 17 00:00:00 2001 From: zkldi Date: Fri, 25 Jun 2021 23:26:02 +0100 Subject: [PATCH] add warning to CDNRoot --- server/src/lib/cdn/cdn.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/lib/cdn/cdn.ts b/server/src/lib/cdn/cdn.ts index fe05018ff..c4cc81a8c 100644 --- a/server/src/lib/cdn/cdn.ts +++ b/server/src/lib/cdn/cdn.ts @@ -13,6 +13,9 @@ const logger = CreateLogCtx(__filename); /** * Joins a file location against the location of the CDN static store. + * + * @danger - This function should **NEVER** be called with unsanitised user input! + * Path directory traversal *is* possible, and *will* ruin your day. */ function CDNRoot(fileLoc: string) { return path.join(KTCDN_ROOT, fileLoc);