/

CVE-2026-123621

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in Usermin Attachment Handler

CVE-2026-123621

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write, Potential Command Execution

Severity:

HIGH RISK

(8.8)

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

Usermin's mailbox attachment handling may allow a crafted attachment filename to escape the intended temporary directory when a recipient downloads all attachments. A remote unauthenticated attacker who can get a recipient to trigger that action could overwrite files accessible to the Usermin process, potentially enabling command execution in affected configurations.

Affected context

The issue occurs in Usermin's mailbox/detachall.cgi attachment handling when filenames are used to construct file paths without adequate containment checks. It becomes risky when an attacker can supply an attachment with a traversal-style filename and a recipient downloads all attachments, allowing the resulting write to reach a location outside the intended temporary directory. The effects depend on the files writable by the service and the target system's configuration.

Exploit preconditions

  • Attack surface: Usermin mailbox attachment handling
  • Required access: The attacker does not need to authenticate to Usermin, but must be able to deliver a crafted email attachment to a recipient.
  • Trigger point: The recipient downloads all attachments through the affected handler.
  • Why exploitation is possible: Attachment filenames are not sufficiently constrained to the temporary directory, so path resolution may permit writes elsewhere.

Why this happens

The underlying issue is improper limitation of a pathname to a restricted directory, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. The handler uses attacker-influenced attachment filenames without reliably ensuring that the resolved destination remains within the intended temporary directory. This insecure path construction can turn a filename into a path outside the designated storage area.

Potential impact

  • The attacker may overwrite files that are writable by the Usermin process.
  • Sensitive or operational files could be modified, potentially disrupting services.
  • In configurations where a writable file can trigger command execution, an attacker could gain execution in the affected service's context.
  • Further compromise may be possible depending on the service's permissions and the host environment.

General mitigation guidance

Defensive approaches focus on treating attachment filenames as untrusted and ensuring all file operations remain within an explicitly permitted directory.

  • Prefer server-generated filenames rather than using supplied names as filesystem paths.
  • Normalize and validate filenames, and verify the resolved destination is contained within the intended directory before writing.
  • Use safe file-handling APIs and avoid path concatenation with untrusted input.
  • Limit the service account's filesystem permissions and isolate temporary storage from sensitive locations.
  • Apply controls that reduce the risk of attachments triggering file operations without recipient awareness.

How teams detect issues like this

  • Use static analysis to identify filesystem writes built from user-controlled filenames or paths.
  • Review attachment-handling code for normalization, canonical-path containment checks, and unsafe path concatenation.
  • Monitor for unexpected writes outside designated temporary directories, especially to user configuration or service startup files.
  • Enforce code review and security policies requiring untrusted paths to be validated before file access; automated review tools may help identify risky patterns.

Sources

SourceLink
github.comgithub.com/webmin/usermin
github.comgithub.com/webmin/usermin/blob/2.570/mailbox/detachall.cgi#L43-L51
github.comgithub.com/webmin/usermin/commit/cb4614e8319e0932b10533a4d5606debf5f40e14
github.comgithub.com/webmin/usermin/issues/142
hackmd.iohackmd.io/@leediay/H144QKY6zl
vulncheck.comvulncheck.com/advisories/usermin-through-2.570-path-traversal-file-write-via-detachall-cgi

Frequently asked

questions

The described attack can originate remotely without Usermin authentication, but it depends on delivering a crafted attachment and having a recipient download all attachments through the affected handler.

Not according to the description. The recipient's download action is the trigger, while the attacker needs a way to deliver the attachment.

Avoid using supplied filenames as filesystem paths. Generate storage names server-side and confirm that each resolved destination remains inside the intended directory.

Treat filenames and paths from external sources as untrusted, apply containment checks before file operations, and run services with only the filesystem permissions they require.

Find out what's already
exploitable in your codebase.