aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/cache/structuredcache.cpp')
-rw-r--r--zenserver/cache/structuredcache.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp
index fc93896fc..9083f764e 100644
--- a/zenserver/cache/structuredcache.cpp
+++ b/zenserver/cache/structuredcache.cpp
@@ -15,6 +15,7 @@
#include "zenstore/cidstore.h"
#include <spdlog/spdlog.h>
+#include <algorithm>
#include <filesystem>
namespace zen {
@@ -311,6 +312,11 @@ HttpStructuredCacheService::ValidateUri(zen::HttpServerRequest& Request, CacheRe
OutRef.BucketSegment = Key.substr(0, BucketSplitOffset);
+ if (!std::all_of(begin(OutRef.BucketSegment), end(OutRef.BucketSegment), [](const char c) { return std::isalnum(c); }))
+ {
+ return false;
+ }
+
std::string_view HashSegment;
std::string_view PayloadSegment;