Summary
A path traversal vulnerability in Microweber up to version 2.0.20 allows attackers to manipulate the cache_path_relative parameter in the /api_nosession/thumbnail_img endpoint to influence filesystem paths.
When exploited remotely, this weakness may enable access to files outside the intended directory scope, depending on deployment configuration and server permissions.
Affected context
The vulnerability occurs in Microweber installations up to version 2.0.20 that expose the /api_nosession/thumbnail_img API endpoint.
The issue is tied to the userfiles_path handling, where the cache_path_relative argument influences how paths are constructed for file operations.
It becomes risky in environments where this endpoint is reachable over the network and the application runs with permissions to read sensitive files beyond the intended user files or cache directories.
Exploit preconditions
- Attack surface: HTTP interface via the
/api_nosession/thumbnail_imgAPI endpoint. - Required access: Remote, unauthenticated or low-authenticated access (depending on configuration) to the endpoint accepting
cache_path_relative. - Trigger point: Supplying crafted path components (e.g., sequences that traverse directories) through
cache_path_relativeso that the backend resolves paths outside the expected directory. - Why exploitation is possible: The server-side logic appears to trust the
cache_path_relativeinput when building filesystem paths, without consistently normalizing, constraining, or validating it against an allowed base directory, allowing traversal outside the intended path.
Why this happens
This issue stems from improper restriction of filesystem paths derived from user-controlled input, aligning with CWE-22: Path Traversal.
The affected userfiles_path logic appears to concatenate or otherwise combine the cache_path_relative parameter with a base directory for file operations without robust canonicalization or enforcement of a fixed root.
As a result, attackers can craft values that navigate upward or sideways in the directory tree, causing the application to operate on files outside the intended storage area.
Potential impact
- May allow reading files outside the intended userfiles or cache directory, depending on server permissions.
- Could expose application configuration files, keys, or other sensitive data present on the filesystem.
- Can potentially aid in reconnaissance that supports further exploitation of the host or application.
- Might enable partial overwrite or file creation in writable directories, if the vulnerable code path is used for writing as well as reading.
General mitigation guidance
Mitigation typically focuses on constraining how user input influences filesystem paths and reducing the privileges of the code that handles such input.
Common defensive patterns include:
- Enforcing strict canonicalization of user-supplied path segments and rejecting any that contain traversal elements or absolute paths.
- Resolving requested paths against a fixed, known-safe base directory and explicitly verifying that the final normalized path remains within that directory.
- Using whitelists or mapping identifiers to pre-defined directories or filenames instead of accepting raw path segments from clients.
- Running the web application under an account with minimal filesystem privileges and limiting access to only the directories required for normal operation.
- Separating user-controlled file storage from directories that contain configuration, code, and secrets, and applying OS-level access controls accordingly.
How teams detect issues like this
High-level detection approaches for this class of vulnerability include:
- Static analysis rules that flag direct concatenation of user input into filesystem paths, especially in APIs like file open, read, write, or image processing utilities.
- Code review checklists that call out any usage of "relative path" parameters or cache paths and require verification of canonicalization and base-directory checks.
- Runtime application logging and monitoring for suspicious path patterns (e.g., sequences resembling directory traversal) in request parameters such as
cache_path_relative. - Security testing (SAST/DAST) integrated into CI/CD pipelines that specifically probe endpoints using user-supplied paths for traversal behavior.

