/

CVE-2026-48070

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-22) in Docmost Avatar Cleanup Logic

CVE-2026-48070

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File and Directory Deletion

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Docmost versions before 0.80.1 allow authenticated users to save attacker-controlled avatar URL values that are later used by avatar cleanup operations without sufficient directory confinement. On local-storage deployments, a low-privileged user may cause the Docmost service account to delete files or directories outside the intended avatar storage location.

Affected context

The issue occurs in Docmost deployments that use local storage for avatars and perform cleanup based on user-controlled avatar URL values. It becomes risky when the cleanup logic resolves those values as filesystem paths without reliably restricting the result to the designated avatar directory.

Exploit preconditions

  • Attack surface: Authenticated avatar management and cleanup functionality
  • Required access: A valid Docmost user account with permission to create or update avatar-related data
  • Deployment condition: Local-storage mode must be enabled
  • Trigger point: Avatar cleanup processes a stored attacker-controlled URL or path
  • Why exploitation is possible: The resolved path may escape the intended storage directory and target filesystem objects accessible to the Docmost service account

Why this happens

The underlying bug is insufficient validation and confinement of a user-controlled path before it is used in a filesystem deletion operation. A value presented as an avatar URL is treated as a trusted local path without consistently verifying that its canonical form remains within the permitted storage directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • An attacker may delete arbitrary files accessible to the Docmost service account
  • An attacker could remove application data, uploaded content, or operational files
  • Deletion of directories could disrupt application functionality or availability
  • The incident may cause data loss and complicate recovery or forensic analysis

General mitigation guidance

Mitigation generally focuses on treating avatar references as untrusted data and enforcing filesystem boundaries before any cleanup operation.

Common defensive patterns include:

  • Store opaque identifiers rather than user-controlled filesystem paths
  • Resolve and canonicalize candidate paths before use
  • Require the final path to remain within a fixed, dedicated avatar directory
  • Reject absolute paths, traversal segments, unexpected schemes, and path forms
  • Use allowlisted storage keys and server-generated filenames
  • Run the service with the least filesystem privileges required
  • Separate user-upload storage from application code, secrets, and operational data
  • Prefer storage abstractions that do not expose arbitrary filesystem paths

How teams detect issues like this

Organizations can look for:

  • Static analysis findings where request-derived values reach file deletion or recursive removal APIs
  • Code review signals involving path joining without canonicalization and directory-boundary checks
  • Tests using absolute paths, traversal sequences, symbolic links, and alternate path representations
  • Runtime policy alerts for deletion attempts outside approved upload directories
  • File-integrity monitoring for unexpected removals by the Docmost service account
  • Automated security review tools that identify user-controlled filesystem operations

Sources

SourceLink
github.comgithub.com/docmost/docmost/commit/a573acedd0317f3472cb0f8b95f6aa15315312e5
github.comgithub.com/docmost/docmost/releases/tag/v0.80.1
github.comgithub.com/docmost/docmost/security/advisories/GHSA-95f8-h5hf-8248

Frequently asked

questions

It may be exploitable through Docmost's authenticated application interface when the deployment uses local storage and the affected cleanup behavior is reachable.

The attacker generally needs a valid, low-privileged Docmost account capable of creating or updating avatar-related data. The resulting impact is limited by the filesystem permissions of the Docmost service account.

Treat avatar references as untrusted identifiers, use server-generated storage keys, and enforce canonical path confinement within a dedicated storage directory before deletion.

Apply least-privilege filesystem permissions, test all user-controlled file operations against traversal and symlink cases, and monitor application-driven deletions outside approved storage locations.

Find out what's already
exploitable in your codebase.