diff --git a/UI/Store.cpp b/UI/Store.cpp index c467a0f5b4..b2c7b7d6ca 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -34,6 +34,7 @@ #include "Core/Config.h" #include "Core/System.h" #include "Core/Util/GameManager.h" +#include "Core/Util/PathUtil.h" #include "UI/EmuScreen.h" #include "UI/Store.h" @@ -498,6 +499,12 @@ void StoreScreen::ParseListing(const std::string &json) { const char *file = game.getStringOr("file", nullptr); if (!file) continue; + // entry_.file gets joined onto DIRECTORY_GAME verbatim in OnLaunchClick() + // (Path::operator/ does no ".." normalization); on platforms/builds where + // the store index isn't fetched over HTTPS, a MITM'd or compromised + // response could otherwise point "launch" at an arbitrary host path. + if (HasParentDirComponent(file)) + continue; e.file = file; entries_.push_back(e); }