Summary
OpenProject versions 16.6.1 and below contain a command injection vulnerability in the email configuration feature, where the sendmail binary path can be controlled by an administrator.
By setting a malicious sendmail path and triggering a test email, an authenticated admin can execute arbitrary commands on the underlying server.
Affected context
This vulnerability occurs in OpenProject deployments that rely on the application's email configuration interface and allow administrators to customize the sendmail binary path.
It is relevant where:
- Email is configured using a local sendmail-like binary
- Application-level administrator accounts exist and are not fully trusted
- The sendmail path is interpolated into a shell command without robust validation or escaping
Exploit preconditions
- Attack surface: OpenProject web UI, specifically the admin email configuration panel.
- Required access: Authenticated OpenProject administrator account (no need for OS-level access).
- Trigger point: Saving a crafted sendmail binary path and using the "send test email" or equivalent function.
- Why exploitation is possible: The configured sendmail path is incorporated into a shell command in an unsafe manner, allowing command separators or injected arguments to be interpreted by the OS shell.
Why this happens
The core issue aligns with CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
User-controlled configuration data (the sendmail executable path) is passed into a system-level command context without strict validation, canonicalization, or avoidance of shell interpretation.
Instead of treating the path as an opaque executable reference, the implementation allows shell metacharacters or additional arguments to be processed, enabling arbitrary command execution in the application's privilege context.
Potential impact
- Execution of arbitrary OS commands with the permissions of the OpenProject server process
- Reading, modifying, or deleting application data and configuration
- Installing backdoors or additional malicious software on the host
- Pivoting to other internal services reachable from the server
- Full compromise of the OpenProject instance and potentially the underlying host
General mitigation guidance
Effective mitigation centers on removing shell interpretation from the execution path and constraining configurability:
- Treat external binary paths as strict filesystem paths, not shell command lines, and avoid invoking them via a shell.
- Use safe process execution APIs that accept argument arrays and do not perform shell expansion.
- Validate and normalize configured paths against an allowlist of expected locations or binaries, rejecting anything that is not a valid executable path.
- Limit the need for highly dynamic configuration of system-level tools; prefer predefined, vetted options where possible.
- Run the application with least-privilege OS accounts and apply operating system hardening to limit impact if command execution occurs.
How teams detect issues like this
Detection typically involves a combination of code and configuration review:
- Static analysis: Scan for uses of shell-invoking APIs (e.g., system, popen, backticks, or shell=True patterns) where user or admin-supplied data is concatenated into command strings.
- Code review: Examine email configuration and outbound mail routines to ensure sendmail paths and similar fields are not incorporated into shell commands or unescaped argument strings.
- Configuration auditing: Monitor administrative configuration changes involving sendmail or external tool paths, and flag unusual or non-standard values.
- Runtime monitoring: Use application and system logs to detect abnormal command executions or unexpected processes spawned by the OpenProject service.

