Skip to content

Arbitrary File Deletion via Path Traversal in `POST /delete`

High
C4illin published GHSA-w372-w6cr-45jp Jan 27, 2026

Package

CovertX (Docker Image)

Affected versions

<= 0.16.1

Patched versions

0.17.0

Description

Summary

The POST /delete endpoint uses a user-controlled filename value to construct a filesystem path and deletes it via unlink without sufficient validation. By supplying path traversal sequences (e.g., ../), an attacker can delete arbitrary files outside the intended uploads directory, limited only by the permissions of the server process.

Details

Vulnerability type: Path Traversal leading to Arbitrary File Deletion

Data flow (high level):

  • Source: filename from the JSON body of POST /delete
  • Sink: fs.unlink(<userUploadsDir> + <filename>) (or equivalent concatenation/interpolation)
  • Issue: No canonicalization / allowlisting / boundary check is performed on filename. Inputs containing traversal sequences (e.g., ../../..) can cause the resolved path to point outside userUploadsDir, enabling deletion of arbitrary files.

Preconditions observed during testing:

  • A valid authenticated session was used, and a jobId cookie was present.
  • The request succeeded when jobId was set to 1 in the request, suggesting the value may be trusted directly from the client.

PoC

Validated on a local instance. The following steps demonstrate deleting a file outside the uploads directory (example: /tmp/test inside Docker/container).

  1. Create a test file in the container/host environment (example shown conceptually):

    • Create /tmp/test (e.g., touch /tmp/test)
  2. Log in to obtain session cookies:

    curl -i -c cookies.txt -L \
      -X POST http://localhost:3000/login \
      -d "email=test@test.pl&password=1qaz@WSX"
  1. Trigger deletion via path traversal:
    curl -b cookies.txt -b "jobId=1" \
      -H "Content-Type: application/json" \
      -X POST http://localhost:3000/delete \
      -d '{"filename":"../../../../../../../../tmp/test"}'

Expected result:

  • The server performs unlink() on the resolved path and /tmp/test is removed (assuming the server process has permission).

Impact

An authenticated attacker (or any attacker able to reach POST /delete and satisfy/bypass its session requirements) can delete arbitrary files accessible to the server process. This can cause:

  • Integrity impact: deletion of application data, configuration, or other files
  • Availability impact: service disruption or permanent data loss (e.g., deleting DB files, uploaded content, logs, etc.)

The practical impact depends on the deployment’s filesystem permissions and containerization, but the issue is inherently high risk due to arbitrary file deletion capability.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

CVE ID

CVE-2026-24741

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

Credits