CVE-2010-1646: Medium severity Todd Miller Sudo vulnerability
Anders Kaseorg and Evan Broder reported a flaw in the way sudo handled duplicated environment variables. When sudo set certain environment variables (such as PATH set to securepath value, or special sudo environment variables SUDO), the value overwrote first value from user's environment (if it had been preserved and had not removed previously due to envreset / envkeep / envdelete settings), but left following environment variables with the same name unchanged.
This problem can be used to override securepath setting from /etc/sudoers file for shell scripts executed using sudo, as bash uses last PATH environment variable value. In configurations where securepath is used to enforce sane PATH setting for shell scripts, this can allow users with the privileges to run some script using sudo to run arbitrary command with the privileges of the target user.
Upstream fixes to handle duplicated environment variables: http://www.sudo.ws/repos/sudo/rev/3057fde43cf0 http://www.sudo.ws/repos/sudo/rev/a09c6812eaec
This issue affects sudo packages shipped in Red Hat Enterprise Linux 5, however not the default configuration. In default configuration, no securepath is set. envreset is used by default, and PATH is not preserved during the environment reset (unlike the upstream sudo default).
The sudo packages in Red Hat Enterprise Linux 3 and 4 do not allow setting securepath in the /etc/sudoers, there is no compile-time default for the securepath either. Whether the user PATH setting is preserved depends on envreset / envdelete configuration.
Current Fedora configuration specifies securepath, but also removes PATH from the environment by default.
Other sources
The secure path feature in env.c in sudo 1.3.1 through 1.6.9p22 and 1.7.0 through 1.7.2p6 does not properly handle an environment that contains multiple PATH variables, which might allow local users to gain privileges via a crafted value of the last PATH variable.
— MITRE
Affected Software
Remediation
Patch Available
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2010-1646?
CVE-2010-1646 has a moderate severity rating, as it can lead to unintended command behavior due to the mishandling of environment variables.
How do I fix CVE-2010-1646?
To fix CVE-2010-1646, upgrade to a patched version of sudo that addresses the issue, such as versions later than 1.6.9p22.
What software is affected by CVE-2010-1646?
CVE-2010-1646 affects various versions of sudo, including 1.3.1 through multiple 1.6.x versions.
What kind of vulnerability is CVE-2010-1646?
CVE-2010-1646 is an environment variable handling flaw that potentially allows overwriting of important environment variables.
Can CVE-2010-1646 be exploited remotely?
CVE-2010-1646 is not a remote vulnerability and requires local access to exploit.