Summary
A path traversal vulnerability in Talishar's ParseGamestate.php script allows crafted values in the gameName parameter to include directory traversal sequences such as ../.
When this script is accessed directly, missing internal sanitization can lead to unauthorized file access on the server if attacker-controlled paths are resolved against the filesystem.
Affected context
This vulnerability appears in the Talishar fan-made Flesh and Blood project when the ParseGamestate.php component is invoked directly as a standalone script, bypassing the application's main entry points.
In this context, the gameName request parameter is used to build file paths without sufficient sanitization to prevent directory traversal.
The issue is relevant in deployments where the script is web-accessible and the surrounding filesystem contains sensitive or unintended files relative to the script's working directory.
Exploit preconditions
- Attack surface: HTTP(S) requests to
ParseGamestate.phpexposed by the web server. - Required access: Network-level access to the Talishar web application; no special authentication is necessarily required for the vulnerable script if it is publicly reachable.
- Trigger point: Supplying a
gameNameparameter that includes traversal sequences (e.g.,../) or other crafted path components. - Why exploitation is possible: The script uses user-controlled input when constructing file paths and omits internal validation or normalization checks when accessed directly, allowing traversal outside the intended game state directory.
Why this happens
The underlying issue is improper neutralization of user-supplied path components before they are used in filesystem operations, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Instead of resolving gameName against a constrained, validated set of filenames or IDs, the code trusts the raw parameter value and concatenates it into a filesystem path.
Without normalizing and validating the resulting path or enforcing a strict allowlist, sequences like ../ are interpreted by the operating system and web server, enabling navigation to directories outside the intended game state storage area.
Potential impact
- Unauthorized reading of local files that are reachable from the web server process.
- Exposure of configuration files, logs, or source code that may contain credentials or internal implementation details.
- Discovery of filesystem layout and other sensitive metadata that could aid further attacks.
- Potential indirect impact on player privacy or game integrity if game-related data files are accessed.
General mitigation guidance
Effective mitigation focuses on constraining how user input influences filesystem paths and avoiding direct path construction from raw parameters:
- Treat
gameNameand similar parameters as opaque identifiers rather than filenames; resolve them through a mapping layer or database, not direct string concatenation into paths. - Enforce strict allowlists on acceptable values (e.g., known game IDs or patterns) and reject any input containing directory separators, traversal sequences, or null bytes.
- Normalize and canonicalize paths before use, ensuring the final resolved path resides inside a designated base directory and rejecting requests that escape it.
- Isolate application data into dedicated directories with least-privilege file system permissions, minimizing the impact of accidental path exposure.
- Design standalone scripts to reuse centralized input validation routines so that security checks are consistent across all entry points.
How teams detect issues like this
Identifying this type of flaw benefits from a combination of static and dynamic approaches:
- Static analysis rules that flag filesystem operations where paths are built using unsanitized request parameters (e.g.,
_GET,_POST, or framework-specific input objects). - Code review checklists that explicitly ask reviewers to verify that all file access paths are derived from validated identifiers or constrained to a safe base directory.
- Security linters or automated review tools configured to detect string concatenation into file paths, especially when combined with user input or query string parameters.
- Targeted dynamic testing or fuzzing that injects traversal payloads (
../,..\\, URL-encoded variants) into file-related endpoints and monitors responses for unexpected file content or error messages.

