There are several incorrect statements in the initial report and the linked CVE.
1. bash doesn't drop its privilege when setuid when called as sh. It only does so when called as bash and without the -p option. It does however go into a mode where it does not trust its environment as much as when it's not setuid. It still trusts $PATH though. 2. pdksh like AT&T ksh or bash when called as sh, does not drop privileges on startup. It enters the "privileged" mode in which it is more careful in what it does with the environment (for instance, ignores ENV as mandated by POSIX). Only recent versions of mksh (and possibly OpenBSD sh/ksh) based on pdksh drop the privileges. 3. Non-Linux sh are generally not pdksh. From the major ones, only OpenBSD and MirBSD have shells *based* on pdksh. Other BSDs generally have a shell based on the Almquist shell (dash itself is mostly based on NetBSD sh) or bash (like OS/X) and commercial unices generally on AT&T ksh88 4. So it's not most shells dropping privileges. bash (as sh), dash, pdksh, AT&T ksh, yash don't. Only some pdksh derivatives and bash when called as sh do. 5. calling popen("/usr/bin/lsb-release") as root is not the right solution as lsb-release doesn't need super-user privileges and is not guaranteed to be found in /usr/bin and is at least on Debian a python script (python's behaviour can also be affected by env vars) that relies on PATH to find other utilities, so PATH would still need to be sanitized). So dash is not any more vulnerable that any other shell in that regard and is certainly a much better choice in terms of security for /bin/sh than any other bigger shell like bash, zsh or AT&T ksh. Changing dash so it drops privileges is likely to break some usages (rare as it's widely known that calling shells in setuid contexts is very risky). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1215660 Title: dash does not drop privileges when euid != uid, this can cause local root exploits when setuid programs use system() or popen() To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/dash/+bug/1215660/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs