Summary
Usermin's Read Mail module may pass unsanitized IMAP folder names to an operating-system command. An authenticated user who can create a folder through an external IMAP client and then delete it in Usermin may cause commands to run as the Usermin system account.
Affected context
The issue is described in Usermin through version 2.570 and occurs in the Read Mail module's handling of IMAP folder names during deletion. It becomes risky when a folder name is incorporated into an OS command without adequate neutralization, and a user can create that folder externally and trigger its deletion through Usermin.
Exploit preconditions
- Attack surface: Usermin's Read Mail module and its folder-deletion handling
- Required access: An authenticated Usermin account, plus the ability to create an IMAP folder using an external client
- Trigger point: Deleting the crafted folder through Usermin
- Why exploitation is possible: Unsanitized folder-name data reaches OS command handling, allowing shell metacharacters to affect command execution
Why this happens
The underlying issue is OS command injection, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command. The vulnerable pattern is incorporating externally influenced folder-name data into an operating-system command without safely separating data from command syntax.
Potential impact
- An attacker may execute commands with the privileges of the Usermin system account.
- The attacker could access or alter data available to that account.
- The issue may bypass controls intended to limit users to webmail-only actions.
- Further compromise could be possible depending on the account's privileges and the surrounding system.
General mitigation guidance
Defensive patterns focus on avoiding shell interpretation of user-controlled values. Prefer APIs that pass arguments directly to a process without invoking a shell, and validate folder names against a narrow, documented format before use. Reduce trust in externally supplied IMAP data, apply least privilege to the service account, and use operating-system and application controls to limit the impact of any command execution.
How teams detect issues like this
- Use static analysis to identify shell-command construction that includes folder names or other externally influenced values.
- Review Read Mail code paths for shell invocation, string concatenation, and missing validation or argument separation.
- Apply code-review and CI policies that prohibit shell execution with untrusted input unless a reviewed safe pattern is used.
- Monitor for unexpected child processes or command activity initiated by the Usermin service account.

