CVE-2017-5899
High · 7.0CVSS
7.0
EPSS
1.0%
Published
Mar 27, 2017
CISA due date
—
Cloudanix analysis
A bug in an older email program on Linux systems lets anyone already logged in take over the whole computer by tricking a helper tool into writing files anywhere.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- High
- Impact
- Privilege Gain
- Component
- Application
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Directory traversal in a setuid-root helper binary allows local users to supply a randstr argument containing .. sequences, resulting in the binary writing attacker-controlled data to arbitrary filesystem paths as root.
Why it matters to the business
Any local account on an affected system can obtain full root privileges, enabling complete system takeover, persistence, and lateral movement with minimal effort.
How an attack unfolds
A local attacker locates the setuid helper, crafts a randstr value that traverses directories, and invokes the binary so that it overwrites security-critical files such as /etc/passwd, authorized_keys, or cron jobs, thereby gaining root.
How to fix it
Upgrade the s-nail package to version 14.8.16 or later; if an upgrade is not immediately possible, remove the setuid bit from the helper binary or restrict execution to trusted users only.
How to confirm the fix worked
Confirm the installed s-nail version is 14.8.16 or newer; verify the helper binary no longer has the setuid bit or test that traversal sequences are rejected.
Typical attack path
- Locate the setuid-root helper binary on the target host
- Construct a randstr argument containing ../ sequences pointing to a target file
- Execute the binary with the crafted argument to trigger the write
- Verify the target file was modified and leverage the change for privilege escalation
How to detect it
Review process execution logs and audit trails for invocations of the s-nail helper binary containing unusual randstr arguments; inspect recent file modifications or ownership changes on sensitive system files.
What your security team should do
- Apply the 14.8.16 update across all affected hosts without delay
- Audit setuid binaries and remove unnecessary privileges
- Monitor for local privilege-escalation attempts involving mail-related helpers
- Harden local user accounts and restrict shell access where feasible
The record
Directory traversal vulnerability in the setuid root helper binary in S-nail (later S-mailx) before 14.8.16 allows local users to write to arbitrary files and consequently gain root privileges via a .. (dot dot) in the randstr argument.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | s-nail | 0 | 14.8.16-1 |
| Debian:12 | s-nail | 0 | 14.8.16-1 |
| Debian:13 | s-nail | 0 | 14.8.16-1 |
| Ubuntu:18.04:LTS | s-nail | 0 | 14.8.16-1 |
| Ubuntu:Pro:16.04:LTS | s-nail | 0 | 14.8.6-1ubuntu0.1~esm1 |
Related vulnerabilities
- CVE-2026-81163 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')… CWE-22
- CVE-2026-112049 Vita3K before build 4187 contains a path traversal (zip slip) vulnerability in… CWE-22
- CVE-2026-112005 WhoDB 0.104.0 before 0.135.0 contains a path traversal vulnerability that allows remote… CWE-22
- CVE-2026-61702 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like… CWE-22
- CVE-2026-104871 The Angular SSR is a server-rise rendering tool for Angular applications. CWE-22
- CVE-2026-102991 Mako is a template library written in Python. CWE-22
- CVE-2026-101894 The decompress package for Node.js extracts archives. CWE-22
- CVE-2026-100689 GitPython before 3.1.62 does not validate the `path` field read from an untrusted… CWE-22