diff --git a/Development/nmos/filesystem_route.cpp b/Development/nmos/filesystem_route.cpp index 19612e3c..c7924d5c 100644 --- a/Development/nmos/filesystem_route.cpp +++ b/Development/nmos/filesystem_route.cpp @@ -76,7 +76,8 @@ namespace nmos nmos::api_gate gate(gate_, req, parameters); slog::log(gate, SLOG_FLF) << "Filesystem request received"; auto relative_path = web::uri::decode(parameters.at(U("filesystem-relative-path"))); - const bool naughty = string_t::npos != relative_path.find(U("/..")); + // Check for directory traversal attempts using both forward and backward slashes + const bool naughty = (string_t::npos != relative_path.find(U("/.."))) || (string_t::npos != relative_path.find(U("\\"))); if (!naughty) { // relative path will begin with a slash