Cloudanix VulnDB

CVE-2017-5899

High · 7.0

CVSS

7.0

EPSS

1.0%

Published

Mar 27, 2017

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

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.

Exploit Available
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

  1. Locate the setuid-root helper binary on the target host
  2. Construct a randstr argument containing ../ sequences pointing to a target file
  3. Execute the binary with the crafted argument to trigger the write
  4. 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