Summary
An unrestricted file rename flaw in Bookcars v8.3's /api/create-user endpoint lets authenticated users use directory traversal patterns to relocate files from temporary storage to arbitrary filesystem paths.
When exploited, this behavior can expose sensitive data, overwrite application resources, and potentially enable remote code execution on the server.
Affected context
This vulnerability arises in deployments of Bookcars v8.3 that expose the /api/create-user endpoint and rely on server-side temporary storage for uploaded or generated files.
The risk is present when the server constructs destination file paths using user-influenced data without constraining the final resolved path to an expected directory.
It is especially impactful in environments where the application process has write access to configuration directories, executable code paths, or locations containing sensitive files.
Exploit preconditions
- Attack surface: HTTP interface of the Bookcars /api/create-user endpoint
- Required access: Valid authenticated user account with permission to invoke the endpoint
- Trigger point: File handling logic that renames or moves files from a temporary directory to a final destination
- Why exploitation is possible: The server accepts user-controlled path components that are not normalized or constrained, allowing directory traversal sequences (e.g., ../) to influence the final destination of the renamed file
Why this happens
The core issue is the lack of robust path validation and authorization in the file rename logic inside /api/create-user.
User-supplied or indirectly controllable path segments are combined with server paths and passed directly to filesystem operations, permitting directory traversal beyond the intended upload area.
This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the application fails to verify that the resolved absolute path stays within a safe, predefined directory under application control.
Potential impact
- Overwriting of critical application files that the process can write to
- Placement of attacker-controlled files into executable or interpretable directories, which can lead to remote code execution
- Unauthorized exposure or modification of configuration files and secrets
- Corruption of application data or logs by moving or overwriting existing files
- Escalation of impact if overwritten files are part of deployment, startup, or authentication flows
General mitigation guidance
Effective mitigation focuses on strict control of filesystem paths and limiting the privileges of file operations.
Recommended defensive patterns include:
- Restricting all uploaded or temporary files to a dedicated directory and enforcing that final destinations remain within this directory or a small set of whitelisted paths
- Normalizing and canonicalizing paths before use, then checking that their absolute form is still under the expected base directory
- Treating all path fragments derived directly or indirectly from user input as untrusted and disallowing any traversal tokens or absolute path markers
- Enforcing least privilege for the application process so it cannot modify code, configuration, or system directories even if a path validation flaw exists
- Separating storage for executable/application code from user-controlled or runtime-writable directories
How teams detect issues like this
Path traversal weaknesses can often be identified through:
- Static analysis rules that flag uses of filesystem APIs (rename, move, write) where arguments depend on HTTP parameters or request bodies without normalization and boundary checks
- Code review practices that require explicit validation of any path derived from user input, including verification against a fixed base directory
- Runtime logging and monitoring of unusual file operations, such as writes or renames into code directories, configuration paths, or other unexpected locations
- Security testing and fuzzing focused on file-related endpoints, sending directory traversal patterns in filenames and path parameters to detect improper handling
Automated security scanners and SAST tools can help surface these patterns early in the development lifecycle when combined with clear secure coding guidelines.

