DiscIO: Only allow alphanumeric ASCII in game IDs

We often use game IDs in paths, so we should try to make sure path
traversal is impossible in game IDs. Admittedly, doing any kind of real
attack using the six bytes available in game IDs is unrealistic, but no
game ID should contain non-alphanumeric or non-ASCII characters anyway.

Might also fix https://bugs.dolphin-emu.org/issues/13982 by skipping
converting between encodings for game IDs.
This commit is contained in:
JosJuice
2026-02-23 20:59:46 +01:00
parent 1d74321212
commit 7b372db559
6 changed files with 24 additions and 10 deletions

View File

@@ -247,7 +247,7 @@ std::string VolumeWAD::GetMakerID(const Partition& partition) const
if (!Common::IsPrintableCharacter(temp[0]) || !Common::IsPrintableCharacter(temp[1]))
return "00";
return DecodeString(temp);
return FilterGameID(temp);
}
std::optional<u64> VolumeWAD::GetTitleID(const Partition& partition) const