Cloudanix VulnDB

CVE-2014-10070

High · 7.8

CVSS

7.8

EPSS

0.5%

Published

Feb 27, 2018

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

On some systems a shell program could let a local user run commands with more access rights than they should have under rare conditions.

Chainable
Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Moderate
Impact
Privilege Gain
Component
Application
Class
Privilege Escalation
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

zsh evaluates initial values of integer variables imported from the environment as executable expressions rather than literal numbers, enabling code execution when invoked in unsanitized elevated contexts.

Why it matters to the business

Local users could gain elevated privileges on systems that invoke zsh through sudo or similar mechanisms without environment sanitization, potentially leading to unauthorized access or system compromise.

How an attack unfolds

An attacker configures a malicious integer environment variable, then triggers zsh in a privilege-elevation context such as sudo with env_reset disabled, causing the variable to be evaluated and execute attacker-controlled code with higher privileges.

How to fix it

Upgrade zsh to version 5.0.7 or later. Ensure sudo configurations enable env_reset and avoid invoking zsh in elevated contexts without full environment sanitization.

How to confirm the fix worked

Verify installed zsh version is 5.0.7 or newer. Audit sudoers files for disabled env_reset and test environment variable handling in privileged zsh invocations.

Typical attack path

  1. Set a crafted integer environment variable containing code
  2. Invoke zsh via an unsanitized privilege-elevation path such as sudo
  3. Trigger evaluation of the imported variable during shell initialization
  4. Execute arbitrary code with elevated privileges

How to detect it

Review sudo and authentication logs for zsh invocations with non-standard environment variables. Examine shell initialization logs or process listings for unexpected variable evaluation artifacts.

What your security team should do

  • Upgrade all zsh installations to 5.0.7 or later
  • Review and enforce env_reset in sudo configurations
  • Identify and restrict use of zsh in privilege-elevation workflows
  • Monitor for legacy zsh versions in package inventories

The record

zsh before 5.0.7 allows evaluation of the initial values of integer variables imported from the environment (instead of treating them as literal numbers). That could allow local privilege escalation, under some specific and atypical conditions where zsh is being invoked in privilege-elevation contexts when the environment has not been properly sanitized, such as when zsh is invoked by sudo on systems where "env_reset" has been disabled.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 zsh 0 5.0.7-3
Debian:12 zsh 0 5.0.7-3
Debian:13 zsh 0 5.0.7-3
Debian:14 zsh 0 5.0.7-3
Debian:7 zsh 0 4.3.17-1+deb7u1
SUSE:Linux Enterprise Desktop 12 SP3 zsh 0 5.0.5-6.7.2
SUSE:Linux Enterprise Point of Sale 11 SP3 zsh 0 4.3.6-67.9.8.1
SUSE:Linux Enterprise Server 11 SP4-LTSS zsh 0 4.3.6-67.9.8.1
SUSE:Linux Enterprise Server 12 SP3 zsh 0 5.0.5-6.7.2
SUSE:Linux Enterprise Server for SAP Applications 12 SP3 zsh 0 5.0.5-6.7.2
Ubuntu:14.04:LTS zsh 0 5.0.2-3ubuntu6.1
Ubuntu:16.04:LTS zsh 0 5.1.1-1ubuntu2.1

Related vulnerabilities