Summary
ConvertX exposes a path traversal weakness in its POST /delete endpoint where a user-supplied filename is concatenated into a filesystem path and passed to unlink without adequate validation.
An attacker who can call this endpoint may craft traversal sequences (such as ../) to delete arbitrary files accessible to the server process outside the intended uploads directory.
Affected context
This vulnerability affects self-hosted ConvertX instances that expose the POST /delete endpoint and rely on it to remove uploaded files from a designated storage directory.
The issue appears when the server constructs filesystem paths directly from client-provided filename values and performs deletion operations without normalizing, constraining, or validating the resulting path against an allowed base directory.
Any deployment where the ConvertX process has write/delete permissions on sensitive filesystem locations is at elevated risk.
Exploit preconditions
- Attack surface: HTTP interface, specifically the
POST /deleteendpoint. - Required access: Ability to send authenticated or unauthenticated HTTP requests to the endpoint, depending on how the instance is configured and exposed.
- Trigger point: Supplying a
filenameparameter containing path traversal sequences (e.g.,../../etc/passwd) or absolute paths that resolve outside the intended uploads directory. - Why exploitation is possible: The application concatenates the raw
filenameparameter into a filesystem path and directly callsunlinkwithout: - Normalizing the path and enforcing it remains within the uploads directory, or
- Rejecting traversal tokens and absolute paths.
Why this happens
The root cause aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
ConvertX trusts a user-controlled filename parameter to determine which file to delete and directly constructs a filesystem path from this input.
Because there is no strict canonicalization or enforcement that the path remains within a specific base directory, attackers can inject ../ sequences or other path manipulations to escape the uploads directory and target arbitrary filesystem locations.
This pattern reflects a broader class of bugs where file system operations (read, write, delete) are driven by untrusted input without proper confinement to a safe directory.
Potential impact
- Deletion of arbitrary files accessible to the ConvertX server process.
- Removal of configuration files, logs, or other application assets, potentially leading to denial of service.
- Deletion of security-related files (e.g., keys, tokens, or policy files), which can weaken other defenses or prevent auditing.
- Interference with other applications on the same host if the ConvertX process has broad filesystem permissions.
- In extreme cases, rendering the host partially or fully unusable if critical system files are deleted and the process has sufficient privileges.
General mitigation guidance
Effective mitigation centers on treating all path-derived input as untrusted and strictly confining file operations to controlled directories.
Defensive patterns include:
- Path canonicalization and enforcement:
- Resolve user-supplied filenames to their canonical/absolute paths and verify they remain within a predefined base directory (e.g., the uploads folder) before performing any deletion.
- Reject requests where the resolved path falls outside the allowed directory tree.
- Reject unsafe tokens and forms:
- Explicitly disallow path traversal tokens such as
.., leading slashes, backslashes on relevant platforms, and environment variable expansions where applicable. - Forbid absolute paths and limit filenames to a whitelisted character set if feasible.
- Use server-generated references:
- Instead of accepting raw filenames, use opaque identifiers or database-backed file records that map to server-side paths not directly controlled by the client.
- Least privilege and filesystem isolation:
- Run the ConvertX process under a dedicated account with minimal filesystem permissions, particularly restricting access to system and application configuration directories.
- Where possible, store uploaded files on a dedicated directory or volume isolated from system paths, and consider containerization or chroot-like mechanisms to further contain damage from file operations.
How teams detect issues like this
Detecting this class of vulnerability generally involves combining code-level analysis with runtime monitoring.
Static and code review approaches:
- Search for file deletion or manipulation APIs (e.g.,
unlink,remove,delete) that operate on paths derived from HTTP parameters or other untrusted input. - Check for concatenation of user-supplied strings into filesystem paths without canonicalization, normalization, or base-directory checks.
- Flag patterns where a "base uploads directory" is mentioned but not actually enforced via path checks, or where only superficial validation (like checking for a substring
"..") is performed. - Use static analysis tools configured with rules targeting CWE-22 (path traversal) to highlight unsafe file path constructions.
Runtime and operational indicators:
- Monitor application logs for unexpected deletion activity, especially paths outside the documented uploads directory.
- Enable audit logs on the filesystem or host-level monitoring to detect deletions in sensitive directories initiated by the ConvertX process.
- Add security tests or CI/CD checks that attempt to delete files outside the uploads directory through the
POST /deleteendpoint to ensure regressions are caught early.

