CVE-2016-7076: Command Injection
Last updated 25 August 2025
Other sources
sudo before version 1.8.18p1 is vulnerable to a bypass in the sudo noexec restriction if application run via sudo executed wordexp() C library function with a user supplied argument. A local user permitted to run such application via sudo with noexec restriction could possibly use this flaw to execute arbitrary commands with elevated privileges.
— Launchpad
The sudo allows the use of NOEXEC tag it its configuration to define that program executed via sudo can not execute any other commands. This restriction is implemented via dynamic library which is preloaded for the executed program and which implements wrappers for various exec functions.
It was discovered that the wrapping of exec functions is insufficient to block command execution via glibc APIs that internally call one of the exec functions - system() or popen() (see CVE-2016-7032 tracked via bug 1372830), and wordexp (CVE-2016-7076, tracked via this bug).
This issue was originally tracked under single CVE via bug 1372830, but the CVE assignment was split because of different versions in which problems for system()/popen() and wordexp() were fixed.
The noexec bypass using wordexp() is being fixed in 1.8.18p1 (see bug 1372830 comment 11):
Wrapper for wordexp() was added to sudonoexec.so which forces the use of WRDENOCMD flag in wordexp().
https://www.sudo.ws/repos/sudo/rev/e7d09243e51b https://www.sudo.ws/repos/sudo/rev/7b8357b0a358 https://www.sudo.ws/repos/sudo/rev/167a518d8129
NEWS file entry:
When sudonoexec.so is used, the WRDENOCMD flag is now added if the wordexp() function is called. This prevents commands from being run via wordexp() without disabling it entirely.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/sudoto a version that resolves this vulnerability.Fixed in 1.9.5p2-3+deb11u1Fixed in 1.9.5p2-3+deb11u3Fixed in 1.9.13p3-1+deb12u3Fixed in 1.9.13p3-1+deb12u2Fixed in 1.9.16p2-3+deb13u1Fixed in 1.9.17p2-4 - Upgrade
Upgrade
redhat/sudoto a version that resolves this vulnerability.Fixed in 1.8.18 - Upgrade
Upgrade
sudoto a version that resolves this vulnerability.Fixed in 1.8.18p1
Event History
Frequently Asked Questions
What is the vulnerability ID for this vulnerability?
The vulnerability ID for this vulnerability is CVE-2016-7076.
What is the severity rating of CVE-2016-7076?
CVE-2016-7076 has a severity rating of 7.8 (high).
What is the affected software for CVE-2016-7076?
The affected software for CVE-2016-7076 includes sudo versions before 1.8.18p1.
How can this vulnerability be exploited?
This vulnerability can be exploited by a local user who is permitted to run an application via sudo with the noexec restriction.
Are there any known fixes for this vulnerability?
Yes, there are known fixes for this vulnerability. Please refer to the references for more information.