Summary
A path traversal flaw in Gladys Assistant's Backup Restore Handler may let a remote attacker access files outside the intended backup path. The risk arises when a request reaches the affected handler and file paths are not sufficiently restricted; the description does not specify whether authentication is required.
Affected context
The issue affects the backup download handler in Gladys Assistant versions up to 4.71.0, specifically server/lib/gateway/gateway.downloadBackup.js. It may be present when the handler resolves paths from request or other externally influenced data without ensuring they remain within the intended backup directory. The available description does not identify the exact function or request details.
Exploit preconditions
- Attack surface: The Backup Restore Handler must be reachable through the application.
- Required access: The description establishes remote attack potential but does not specify whether authentication or other access is required.
- Trigger point: A request processed by the backup download handler that causes it to resolve a file path.
- Why exploitation is possible: Path handling may allow a resolved path to escape the intended directory.
Why this happens
CWE-22 describes improper limitation of a pathname to a restricted directory. In this class of bug, externally influenced path data is used for file access without reliably constraining the final resolved path to the permitted location. The available information does not identify the specific vulnerable code pattern.
Potential impact
- An attacker could access files outside the intended backup directory.
- Sensitive data may be disclosed if readable files are exposed through the handler.
- Exposed files could provide information useful for further compromise.
General mitigation guidance
Mitigation generally focuses on keeping file access within an explicit, trusted directory boundary.
- Resolve and canonicalize paths, then verify the final path remains beneath the allowed directory.
- Prefer server-selected file identifiers or other constrained references over user-controlled filesystem paths.
- Validate inputs with allowlists and reject unexpected path forms.
- Run the application with only the filesystem permissions required for its function.
- Apply consistent access controls to backup files and limit exposure of the handler.
How teams detect issues like this
- Use static analysis to identify file operations that incorporate externally influenced path data.
- Review backup download code for canonicalization and checks that enforce directory boundaries after path resolution.
- Add tests and policy checks for attempts to access paths outside approved storage locations.
- Monitor handler activity for anomalous file access or repeated rejected path requests.
- Automated code review tools may help identify risky path construction patterns.

